dokku / github-action

MIT License
161 stars 28 forks source link

feature request :) ability to destroy db #77

Open MortenHusted opened 3 months ago

MortenHusted commented 3 months ago

Description of problem

As per discussed in dokku forum on slack we're looking into cloning our "master"/staging database so that we can have a bit better database integrity.

In the the ci-predeploy-script we can add logic to clone the master database and link the new review-app to this cloned version, but we don't have an automated solution to destroying the database on destruction of the review-app

would that be possible to implement?

josegonzalez commented 2 months ago

I think adding something here would work:

https://github.com/dokku/ci-docker-image/blob/master/bin/dokku-deploy#L56-L60

Basically adding something into that if statement after the destroy (and before the exit 0) that looks like the following:

if [ -f "bin/ci-post-review-app-destroy" ]; then
  log-info "Executing bin/ci-post-review-app-destroy script"
  chmod +x bin/ci-post-review-app-destroy
  APP_NAME="$REVIEW_APP_NAME" IS_REVIEW_APP="true" SSH_REMOTE="$ssh_remote" bin/ci-pre-deploy
fi

Mind making a PR to that repo with the change?

MortenHusted commented 2 months ago

yup :) will try and see if I can implement a solution this or next week