How can I let pipelines resolve the current datetime for a VERSION_LABEL?
Cuurentlly I have this but its only adding the string "YYY-mm-dd_HHMMSS" to my resulting version tag:
Just to confirm (I'm assume from the syntax), this is for a Pipe?
Pipelines supports environment variables as parameters for pipes. You should be able to use variables with the following configuration:
thanks for your response. Yes your are right: I am talking about Pipes.
Unfortunately that doesnt work. Tested it right ahead and its still not resolving the date time pattern. It does resolve the env variables though (as expected). With the configuration you suggested I get this result (again):
Seems Pipes is not capable of resolving those patterns yet.
Oh sorry, I misinterpreted what you wanted.
The value you provide here is passed into a Docker shell command, so standard Bash string substitution should work here.
See LOCAL_PATH. It will be set as "hello-world"
- mkdir hello-world
- pipe: atlassian/aws-s3-deploy:0.2.1
LOCAL_PATH: '$(echo "hello-world")' # This line here.
You should be able to get what you want with roughly:
VERSION_LABEL: '$APPLICATION_ENVIRONMENT"_"$(date +%Y%m%d_%H%M%S)"_"$BITBUCKET_BUILD_NUMBER'
Obviously it's not the nicest looking config, so you could instead create the variable like this:
- export LABEL=$APPLICATION_ENVIRONMENT"_"$(date +%Y%m%d_%H%M%S)"_"$BITBUCKET_BUILD_NUMBER
Or something along those lines. There might be some syntax errors in those examples. But hopefully you see what I mean.
Thanks for your response. It works. finally ended up with this:
name: Development EB-Deplyoment
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.1
VERSION_LABEL: $APPLICATION_ENVIRONMENT_$(date +%Y-%m-%d_%H:%M:%S)_$BITBUCKET_BUILD_NUMBER
We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events