I'm working through my first circleci build using aws-ecr orb and I want my tag to be set dynamically based on the current timestamp. How can I do that?
orbs:
aws-ecr: circleci/[email protected]
version: 2.1
workflows:
# Build and push to ECR on builds to master
build_and_push_image:
jobs:
- aws-ecr/build-and-push-image:
account-url: AWS_ACCOUNT_URL
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
region: AWS_REGION
repo: node
tag: <HOW TO SET TAG TO CURRENT DATETIME????>
filters:
branches:
only: master
You can append the date using Linux formatting (date +FORMAT).
As user Al-un mentioned above, this is a great reference on how to use those formats.
Here is another user who does something similar.
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