I am using SpringBoot, gitflow-maven plugin, AWS CodeBuild and Github connector to deploy on changes to master branch.
Currently, each release branch requires manual setting of the artifacts:files
to match the versioned jar name.
Can this be automated by injecting the version or artifact name? Or is there a best practice?
The CODEBUILD_SOURCE_VERSION
env variable is availble, but docs show that for Github, this is either
commit ID, branch name, or tag name associated with the version https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
version: 0.2
phases:
build:
commands:
- cd pipelinedemo
- mvn install
- echo $CODEBUILD_SRC_DIR
artifacts:
base-directory: pipelinedemo/target
files:
- pipelinedemo-0.0.2.jar <- must be updated to 0.0.3 in next release branch