Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Run script on each changed file?

We have some standards checking type scripts that we want to run on each file of a certain type that has changed. We also use model based develop, and would like to try regenerating code from the model if the model changes. Is there any functionality that allows for this within Bamboo? Right now, I'm thinking I will have to write my own script to list out of the changed files from the previous build to the current build. Then loop over that list and perform the task on each one in the list. I didn't want to reinvent the wheel though if Bamboo already provides a similar functionality.

1 answer

0 votes
Bill Carreon Atlassian Team Mar 29, 2018

Hi Cory,

While Bamboo does not have a “track changed files” feature, the database does log the commit changes. The below query should provide a decent starting point for your project, as it includes code and file commits per build.

SELECT a.AUTHOR_NAME,

   uc.COMMIT_DATE,

   uc.COMMIT_REVISION,

   uc.COMMIT_COMMENT_CLOB,

   cf.COMMIT_FILE_NAME

   FROM USER_COMMIT uc

JOIN REPOSITORY_CHANGESET rc ON (uc.REPOSITORY_CHANGESET_ID = rc.REPOSITORY_CHANGESET_ID)

JOIN BUILDRESULTSUMMARY brs ON (rc.BUILDRESULTSUMMARY_ID = brs.BUILDRESULTSUMMARY_ID)

JOIN AUTHOR a ON (a.AUTHOR_ID = uc.AUTHOR_ID)

JOIN COMMIT_FILES cf ON (uc.COMMIT_ID = cf.COMMIT_ID)

WHERE brs.BUILD_KEY = '<BUILD_KEY>'

 AND brs.BUILD_NUMBER = <BUILD_NUMBER>;

 

Cheers,

Bill

Dev Tools Support | Atlassian 

Suggest an answer

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

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

46 views 0 3
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