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

Run script on each changed file?

Cory Mohling March 27, 2018

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
Atlassian Team members are employees working across the company in a wide variety of roles.
March 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
AUG Leaders

Atlassian Community Events