You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
We are using Bamboo v6.3 and I wanted to get some help from experts regarding:
Q: Is there a way to checkout the only files from Bitbucket that were committed, pushed and caught by plan triggers?
What I am attempting to do is:
1- only checkout the files (from multiple subfolders) which triggered the plan's triggers (Repo polling, etc.) using "Source Code Checkout task" or something similar from plan
2- Generate Artifcats that only hold checked out files, etc. (e.g. in my case single file) and access it in the master build plan.
I am comfortable with the task-2 but not sure how to proceed or whether Bamboo can support something what is required at (1). I am assuming that since a change in repo (e.g. Bitbucket, etc.) can triggers a Bamboo plan, Bamboo must be knowing what has changed in that repo attached / linked to the plan Or is it too much to assume :(
You cannot checkout only the modified files using the Source Code Checkout task, you will need a script task for this. The challenge is more related to git than Bamboo itself.
I was able to get it working with the following approach:
# Clean working directory
rm -rf *
# Clone your repository without a checkout
git clone --no-checkout http://admin:password@localhost:7990/bitbucket/scm/proj/repository.git
# Navigate to your repository folder
# Get the the list of modified files
FILES=`git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $bamboo_repository_revision_number`
# Checkout the modified files only
git checkout $bamboo_repository_revision_number -- $FILES
I hope it helps!