docker.yml 1.51 KB
Newer Older
1 2
# These are the steps used in a container-based build in VSTS.
steps:
3 4 5 6
- ${{ if eq(parameters.qemu, 'true') }}:
  - script: docker run --rm --privileged multiarch/qemu-user-static:register --reset
    displayName: 'Register Docker QEMU'

7 8 9 10
- script: |
    cd $(Build.SourcesDirectory)/azure-pipelines/docker
    docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} .
  displayName: 'Build Docker image'
11 12 13 14
- task: docker@0
  displayName: Build
  inputs:
    action: 'Run an image'
15
    imageName: libgit2/${{ parameters.docker.image }}
16
    volumes: |
17 18
     $(Build.SourcesDirectory):/home/libgit2/source
     $(Build.BinariesDirectory):/home/libgit2/build
19
    envVars: ${{ parameters.environmentVariables }}
20 21
    workDir: '/home/libgit2/build'
    containerCommand: '/home/libgit2/source/azure-pipelines/build.sh'
22 23 24 25 26
    detached: false
- task: docker@0
  displayName: Test
  inputs:
    action: 'Run an image'
27
    imageName: libgit2/${{ parameters.docker.image }}
28
    volumes: |
29 30
     $(Build.SourcesDirectory):/home/libgit2/source
     $(Build.BinariesDirectory):/home/libgit2/build
31
    envVars: ${{ parameters.environmentVariables }}
32 33
    workDir: '/home/libgit2/build'
    containerCommand: '/home/libgit2/source/azure-pipelines/test.sh'
34 35 36 37 38 39 40 41
    detached: false
- task: publishtestresults@2
  displayName: Publish Test Results
  condition: succeededOrFailed()
  inputs:
    testResultsFiles: 'results_*.xml'
    searchFolder: '$(Build.BinariesDirectory)'
    mergeTestResults: true