Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo SCP - is it possible just to copy changed files?

I'm using Bamboo and the SCP plugin to copy our web application to testing and production servers.

I'm wondering is it possible to have bamboo ONLY copy files that have been changed since the last deployment.

We previously used DeployHQ for this and this feature was available.

Thanks,

Peter

5 answers

You can set a task using a script that make the desired action. Please take a look on https://confluence.atlassian.com/display/BAMBOO/Script.

Lucas Lima

I also look for the solution but didn't find anything. I need to deploy (SCP) files that has been changed since last git commit. I think this possibility must be a default option in SCP,FTP tasks. Can anybody from Atlassian give a ready to use example of it?

Anyone have any idea with this? I also need to grab the latest files from the last repo update! Bamboo definintly has a record of the files, its just getting that listing.

This thread is quite old, has anything changed?

The only way to copy just the changed files is with the script??

My source code is around 500Mb (code + assets) i can't upload the entire source if I just changed a few files and the script solution doesn't feel right, bamboo should have this out of the box.

Use this option to see only the files changed in the previous commit :

git diff --name-only HEAD HEAD^1

and you can create and archive of changed files using the below command :

git archive --output=latest_artifact.zip HEAD $(git diff --name-only HEAD HEAD^1) 

To make sure this runs correctly, You have to do the following :

1. Make sure your merge strategy is Merge commit - Usually makes a merge commit every time resulting in your latest commit having changes of all the commits from source branch to target branch

2. Disable Automatic merging under Branching model - Merging master to dev automatically

3. Run the command in script task after your source code checkout task

The only problem with the merge strategy being merge commit is that it will create a large commit history and with Automatic merging it can further mess up the commit history. Also you can`t have any .zip files in your repo and in bamboo you can create an artifact of the *.zip file and then use deployment project / SCP task to copy the zip file to server. 

Hope this helps. The version is 5.12 when I`m writing this answer.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

684 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you