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)
|
# npmLocation: $(Build.SourcesDirectory)
|
||||||
# testResultsFile: junit.xml
|
# testResultsFile: junit.xml
|
||||||
# summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.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
|
- job: playwright_tests
|
||||||
|
dependsOn: build_docker_image
|
||||||
continueOnError: true
|
continueOnError: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -65,14 +85,21 @@ stages:
|
||||||
shardNumber: 4
|
shardNumber: 4
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- task: Docker@2
|
- task: DownloadPipelineArtifact@2
|
||||||
displayName: 'Build Docker Image'
|
|
||||||
inputs:
|
inputs:
|
||||||
command: build
|
targetPath: '$(System.DefaultWorkingDirectory)/docker_build'
|
||||||
dockerfile: Dockerfile.playwright
|
displayName: Download docker image
|
||||||
repository: $(dockerImageName)
|
- script: |
|
||||||
tags: $(imageTag)
|
ls
|
||||||
arguments: '--no-cache --pull'
|
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: |
|
- script: |
|
||||||
# Create container and run tests
|
# Create container and run tests
|
||||||
|
|
@ -149,7 +176,6 @@ stages:
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_JUNIT_OUTPUT_FILE: "test-results/results.xml"
|
PLAYWRIGHT_JUNIT_OUTPUT_FILE: "test-results/results.xml"
|
||||||
- script: |
|
- script: |
|
||||||
sudo apt-get install -y jq
|
|
||||||
. $(System.DefaultWorkingDirectory)/devops/scripts/jira_writeback.sh
|
. $(System.DefaultWorkingDirectory)/devops/scripts/jira_writeback.sh
|
||||||
add_comment "$(Build.SourceBranchName)" "AUTOMATED TEST RUN: $(date)" "$(System.DefaultWorkingDirectory)/ortoni-report/index.html"
|
add_comment "$(Build.SourceBranchName)" "AUTOMATED TEST RUN: $(date)" "$(System.DefaultWorkingDirectory)/ortoni-report/index.html"
|
||||||
displayName: publish_results_to_jira
|
displayName: publish_results_to_jira
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue