In our BitBucket Pipeline we must provide a variable to `pipe: atlassian/aws-elasticbeanstalk-deploy:0.3.0` that must be unique everytime.
What we are currently using :
- step:
name: Deploy to AWS
deployment: production-aws
image: atlassian/default-image:2
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.3.0
variables:
...
VERSION_LABEL: "name.$BITBUCKET_BUILD_NUMBER-bitbucket"
We currently have an issue : if the step fails and we use "Retry only failed steps", the $BITBUCKET_BUILD_NUMBER is not incremented. This is causing an error on our end because the "VERSION_LABEL" is already in use.
Is there another way to generate a unique version label?
Thank you !
I'm not sure if there is an easy way to identify if a build is rerun in pipelines, but what you could use in your label is a Linux timestamp. You could create a variable and use it in your label to distinguish builds based on the time the ran.
This would be the way to create the variable
script:
- TIMESTAMP=`date +%s`
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.3.0
variables:
...
VERSION_LABEL: "name.$BITBUCKET_BUILD_NUMBER-$TIMESTAMP-bitbucket"
I hope that is a possible solution for this issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! I'm glad that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.