Created
September 6, 2018 02:22
-
-
Save drch-/5ac3e5262c4e8497e83cc9fe52d3feb9 to your computer and use it in GitHub Desktop.
conditionally run template depending on branch - doesn't work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build docker image | |
- template: tasks/_docker-build.yml | |
parameters: | |
workingDirectory: $(projectBaseDir) | |
tag: $(dockerImage)-$(Build.BuildId) | |
# tag and push images if branch is master or develop | |
- ${{ if in('$(Build.SourceBranchName)', 'develop', 'master') }}: | |
- template: tasks/_awscli-docker-login.yml | |
parameters: | |
awsSecret: $(AWS.Secret) | |
awsKey: $(AWS.Key) | |
- template: tasks/_docker-tag-and-push.yml | |
parameters: | |
sourceImage: $(dockerImage)-$(Build.BuildId) | |
targetImage: ${{ format('{0}/{1}:{2}-{3}', '$(dockerRegistryHost)', '$(dockerImage)','$(Build.SourceBranchName)', '$(Build.BuildId)')}} | |
- template: tasks/_docker-tag-and-push.yml | |
parameters: | |
sourceImage: $(dockerImage)-$(Build.BuildId) | |
targetImage: ${{ format('{0}/{1}:{2}-{3}', '$(dockerRegistryHost)', '$(dockerImage)','$(Build.SourceBranchName)', 'latest')}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment