Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Want to commit in file during Bamboo Build

Prahaladsinh Rathod April 11, 2019

I have one javascript file in my bit bucket repo. I want to update only one line in js file during bamboo build. 

Example :

version.js

myVersion="alt-1"

.......

.......

 

During the bamboo build, I want to change the value of myVersion variable . 

1 answer

0 votes
Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2019

Hi @Prahaladsinh Rathod ,

You can use sed.

For example in a script:

sed -i 's|myVersion="alt-1"|myVersion="alt-2"|' version.js

and use variables instead of the hardcoded values of alt-1 and alt-2.

Prahaladsinh Rathod May 8, 2019

@Edwin Kyalangalilwa 

Thanks for the reply.

But I have to commit in bitbucket repository using git command.

Like : https://confluence.atlassian.com/bamkb/how-to-commit-and-push-to-a-git-repo-during-a-build-720641378.html

In my bitbucket repository, the version.js file is already there. I just want to update one line during the bamboo build process

Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2019

@Prahaladsinh Rathod ,

Are you looking to make the edit before pushing to Bitbucket or when the repository is checked out?

Prahaladsinh Rathod May 10, 2019

@Edwin Kyalangalilwa 

Yes, I want to edit before the source code checkout

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events