Moved docker build to its own job
This commit is contained in:
parent
1a38f1dc7d
commit
fa9920a56a
1 changed files with 34 additions and 8 deletions
|
|
@ -51,7 +51,27 @@ stages:
|
|||
# npmLocation: $(Build.SourcesDirectory)
|
||||
# testResultsFile: junit.xml
|
||||
# summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml
|
||||
- job: build_docker_image
|
||||
steps:
|
||||
- task: Docker@2
|
||||
displayName: 'Build Docker Image'
|
||||
inputs:
|
||||
command: build
|
||||
dockerfile: Dockerfile.playwright
|
||||
repository: $(dockerImageName)
|
||||
tags: $(imageTag)
|
||||
arguments: '--no-cache --pull'
|
||||
- script: |
|
||||
docker save -o docker_build.tar $(dockerImageName):$(imageTag)
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: 'Publish Docker Image'
|
||||
condition: always()
|
||||
inputs:
|
||||
targetPath: '$(System.DefaultWorkingDirectory)/docker_build.tar'
|
||||
artifact: 'docker_build'
|
||||
publishLocation: 'pipeline'
|
||||
- job: playwright_tests
|
||||
dependsOn: build_docker_image
|
||||
continueOnError: true
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -65,14 +85,21 @@ stages:
|
|||
shardNumber: 4
|
||||
|
||||
steps:
|
||||
- task: Docker@2
|
||||
displayName: 'Build Docker Image'
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
command: build
|
||||
dockerfile: Dockerfile.playwright
|
||||
repository: $(dockerImageName)
|
||||
tags: $(imageTag)
|
||||
arguments: '--no-cache --pull'
|
||||
targetPath: '$(System.DefaultWorkingDirectory)/docker_build'
|
||||
displayName: Download docker image
|
||||
- script: |
|
||||
ls
|
||||
for dir in $(System.DefaultWorkingDirectory)/docker_build/*/; do
|
||||
if [ -d "$dir" ]; then
|
||||
mv "$dir"* $(System.DefaultWorkingDirectory)/docker_build/
|
||||
rmdir "$dir"
|
||||
fi
|
||||
done
|
||||
docker load -i $(System.DefaultWorkingDirectory)/docker_build/docker_build.tar
|
||||
ls
|
||||
displayName: Load docker image
|
||||
|
||||
- script: |
|
||||
# Create container and run tests
|
||||
|
|
@ -149,7 +176,6 @@ stages:
|
|||
env:
|
||||
PLAYWRIGHT_JUNIT_OUTPUT_FILE: "test-results/results.xml"
|
||||
- script: |
|
||||
sudo apt-get install -y jq
|
||||
. $(System.DefaultWorkingDirectory)/devops/scripts/jira_writeback.sh
|
||||
add_comment "$(Build.SourceBranchName)" "AUTOMATED TEST RUN: $(date)" "$(System.DefaultWorkingDirectory)/ortoni-report/index.html"
|
||||
displayName: publish_results_to_jira
|
||||
|
|
|
|||
Loading…
Reference in a new issue