Skip to content

Commit

Permalink
Create azure-pipelines.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jawaidm authored Feb 23, 2023
1 parent 531919a commit c039871
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker

trigger:
- main

resources:
- repo: self

variables:
tag: '$(Build.BuildId)'
tagDate: $[ format('{0:yyyy}.{0:MM}.{0:dd}.{0:HH}.{0:mm}{0:ss}', pipeline.startTime) ]
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]

stages:
- stage: Build
condition: and(succeeded(), eq(variables.isMain, 'true'))
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Build an image and Push
inputs:
command: buildAndPush
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
tags: |
latest
$(tagDate)
containerRegistry: DockerHub
repository: dbcawa/mooringlicensing
env:
DOCKER_BUILDKIT: 1
- task: Docker@2
displayName: Dev Build image and Push
inputs:
command: buildAndPush
dockerfile: '$(Build.SourcesDirectory)/dockerdev/Dockerfile'
tags: |
mooringlicensing_dev_latest
mooringlicensing_dev_$(tagDate)
containerRegistry: DockerHub
repository: dbcawa/docker_app_dev
env:
DOCKER_BUILDKIT: 1

0 comments on commit c039871

Please sign in to comment.