Skip to content

Instantly share code, notes, and snippets.

@michalpenka
Created March 21, 2020 09:28
Show Gist options
  • Save michalpenka/50b588ebb74a01afea805e0f385a9928 to your computer and use it in GitHub Desktop.
Save michalpenka/50b588ebb74a01afea805e0f385a9928 to your computer and use it in GitHub Desktop.
trigger:
- master
resources:
- repo: self
variables:
tagBuild: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Docker@2
displayName: Build and push the image
inputs:
containerRegistry: 'Docker Hub'
repository: 'YOUR_DOCKERHUBID/YOUR_DOCKERHUBREPONAME'
command: buildAndPush
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
tags: |
$(tagBuild)
- task: PublishPipelineArtifact@1
displayName: Publish KubernetesDeploymentManifest
inputs:
targetPath: '$(Build.SourcesDirectory)/kubernetes-deployment.yml'
artifact: 'KubernetesDeploymentManifest'
publishLocation: 'pipeline'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment