As title says I would love to have a way to separate changed files (that were commited) from rest of the repository. It could help me save a TON of time and deployment proccess, although if you know any better way to deploy on a VPS, sure write me about it :D Currently I am using scp deploy from atlassian.
Thanks in advance for any help!
JK
Hi Jan and welcome to the community!
You could use the rsync pipe instead:
I am copying from the rsync man page:
Rsync finds files that need to be transferred using a "quick check" algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file’s data does not need to be updated.
Getting a list of changed files may not be easy or straightforward, depending on the type of pipeline and how it was triggered. The following command will show changed files in the commit that triggered the build:
git diff --name-only HEAD HEAD~1
This will work if you have a pipeline running on a branches definition and you push one commit at a time. However, if you push e.g. five commits, the build will be triggered for the last commit only, and this command will miss the changed files in the previous four commits.
Figuring out how many commits you need to go back to adjust the git diff command would need to involve some scripting using our APIs. You would need to check the previous builds one by one: e.g. if the current build is number 50, first check if build 49 ran on the same branch and for the same definition, and if so, get the commit hash of the commit that triggered this build. If not, continue the process for the previous build.
For builds running on a pull-requests definition, the list of changed files in that pull request is easier to get with the following API endpoint:
Kind regards,
Theodora
Thanks a lot! The rsync pipe did the job!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's good to hear and you are very welcome!
Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.