문제

I need to show version number including three figures 1. Using pom version (done) 2. Commit number from Git (done) 3. Build number from Bamboo ( worst part :( )

I tried to make one property file with placeholders as bamboo.properties in my project. I am expecting that when Bamboo prepares the build it will replace those properties and include that file in war. Later I will read those properties and expose to Web Layer.

Am I doing right? Because I need that my other team members should able to make build locally without Bamboo?

bamboo.properties:

bamboo.buildKey=${bamboo.buildKey}

bamboo.buildResultsUrl=${bamboo.buildResultsUrl}

bamboo.buildNumber=${bamboo.buildNumber}

bamboo.buildPlanName=${bamboo.buildPlanName}

bamboo.buildTimeStamp=${bamboo.buildTimeStamp}

도움이 되었습니까?

해결책

Here is how we achieve above after long time.

  1. Pom version A simple maven property that can be accessed.

  2. Commit id from git
    Since in this project we are using git only, there is a maven plugin that gives you information about commit number. With the help of it you can retrieve Git commit id. For details please look for

    git-commit-id-plugin

  3. For bamboo there is environment variable that you need to configure in bamboo settings (For me this has done by client as he owns it). But after it we access it in our env as "<bamboo.build.no>"

Thanks

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top