I am trying to get started with an automated build process using Jenkins.
So far i have managed to get Jenkins to build a project from BitBucket, run tests and upload the files to a production server using the Publish Over SSH plugin.
When i delete files from my git repo, i would like those files to be deleted on the remote server. There are a few ways that i have thought about doing this already.
Wipe all the files on the production server, then upload the latest build release.
- seems like a bad solution for me, as this would cause more downtime than i would like.
Create a script that lives on the remote server to clean up the files after the new build process. I would need to find out from git (somehow?) what the deleted files on that commit were.
Instead of having Jenkin use the publish over ssh plugin, have git installed on the production server, so after a successful build, we can get Jenkins (somehow?) to push the project to the git production server.
This seems like a common task for developers, and i feel like i am missing something here. Is there any standard practice for this.
diffs
andrsync
to upload just the differences. For Dev sandboxes, there is nothing wrong in havinggit
directly in the server, and update it as the files get changed ingit