I'm using AWS CodePipeline with CodeBuild to build and deploy my application to ElasticBeanstalk.
CodePipeline generates version names like this:
code-pipeline-1122334455667-MyApp-1ac31f7c-1343-471x-a7e8-46b24f1785a
Is it possible to customize these labels?
To edit a pipelineSign in to the AWS Management Console and open the CodePipeline console at http://console.aws.amazon.com/codesuite/codepipeline/home . The names of all pipelines associated with your AWS account are displayed. In Name, choose the name of the pipeline you want to edit.
You can edit a pipeline using the AWS Management Console. On the List Pipelines page, check the Pipeline ID and Name columns for your pipeline, and then choose your Pipeline ID. Then choose Edit Pipeline to display the pipeline Architect page.
Tags are case-sensitive key-value pairs that consist of a key and an optional value, both defined by the user. You can apply up to ten tags to each pipeline. Tag keys must be unique for each pipeline.
You can set a version label if you use an AWS CodeBuild action provider instead of an AWS ElasticBeanstalk deploy action provider.
CodeBuild has the ability to run AWS CLI commands in the buildspec, which you can use to
Below is an example buildspec uploading an artifact with a custom label, file name, and description.
version: 0.2 phases: build: commands: - mvn clean package - export POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) - export JAR_NAME='application-'$POM_VERSION'.jar' - export EB_VERSION=$POM_VERSION'-'$(date +%s) - aws s3 cp target/application.jar s3://bucket-name/$JAR_NAME - aws elasticbeanstalk create-application-version --application-name "Application Name" --version-label "$EB_VERSION" --description "$CommitMessage" --source-bundle S3Bucket=bucket-name,S3Key=$JAR_NAME - aws elasticbeanstalk update-environment --application-name "Application Name" --version-label "$EB_VERSION" --environment-name "EnvironmentName"
Notes:
$CommitMessage
is coming in from CodePipeline as an environment variable.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With