grandfathermagic

Azure pipeline

Aug 26th, 2022 (edited)
975
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.19 KB | Source Code | 0 0
  1. # Starter pipeline
  2.  
  3. # Start with a minimal pipeline that you can customize to build and deploy your code.
  4. # Add steps that build, run tests, deploy, and more:
  5. # https://aka.ms/yaml
  6.  
  7. trigger:
  8. - main
  9.  
  10. pool:
  11.   vmImage: ubuntu-latest
  12.  
  13. steps:
  14. - script: echo Hello, world!
  15.   displayName: 'Run a one-line script'
  16.  
  17. - script: |
  18.    echo Add other tasks to build, test, and deploy your project.
  19.     echo See https://aka.ms/yaml
  20.   displayName: 'Run a multi-line script'
  21. - task: DockerInstaller@0
  22.   inputs:
  23.     dockerVersion: '17.09.0-ce'
  24.     releaseType: stable
  25.    
  26.  
  27. - task: Docker@2
  28.   inputs:
  29.     containerRegistry: 'DockerHub'
  30.     command: 'login'
  31.  
  32. - task: Docker@2
  33.   displayName: Build
  34.   inputs:
  35.     command: 'build'
  36.     containerRegistry: 'DockerHub'
  37.     repository:
  38.     Dockerfile: '**/Dockerfile'
  39.     arguments: '-t onetimemail/test:$(Build.BuildId)'
  40.  
  41. - task: Docker@2
  42.   displayName: Push
  43.   inputs:
  44.     command: 'push'
  45.     containerRegistry: 'DockerHub'
  46.     repository: onetimemail
  47.     tags: |
  48.      test:$(Build.BuildId)
  49. - script:
  50.     docker image ls
  51. - script: |
  52.    /opt/hostedtoolcache/docker-stable/17.9.0-ce/x64/docker push onetimemail/test:$(Build.BuildId)
  53.  
  54.  
  55.  
Advertisement
Add Comment
Please, Sign In to add comment