Author of the post you linked to here! Agreed it was a really hackish thing we did. I found a slightly nicer way to do this by running a git reset --hard on the folder. This also fixed the race condition of sorts that if someone else commited to dev between the test running and the second git clone, the newer (untested) code would be pulled. It is still some what of a hack but cleaner
- git reset --hard && rm -rf vendor && rm -rf log/* && cd _deploy && ./deploy.sh Dockerfile.template
If you want you can remove the && and just run each command individually now as we are no longer leaving the top line directory
- git reset --hard
- rm -rf vendor
- rm -rf log/*
- ./_depoly/deploy.sh Dockerfile.template
Note for us we rm -rf’d the vendor and log folder as they ballooned the size of the docker image by 500mb. Our .gitignore ignores the vendor and logfile so we had to rm it as git reset --hard didn’t ignore it. The reset should revert your database file correctly.
Again not the best by far but a step forward from my last post :).