Moved docker build inside other steps to reduce runtime
This commit is contained in:
parent
63aa0421d0
commit
8635a5f1cf
1 changed files with 15 additions and 42 deletions
|
|
@ -51,19 +51,6 @@ stages:
|
|||
# npmLocation: $(Build.SourcesDirectory)
|
||||
# testResultsFile: junit.xml
|
||||
# summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml
|
||||
- job: build_docker_image
|
||||
steps:
|
||||
- script: |
|
||||
docker build -f Dockerfile.playwright -t $(dockerImageName):$(imageTag) . --no-cache --pull
|
||||
docker save -o docker_build.tar $(dockerImageName):$(imageTag)
|
||||
displayName: Save docker image as tar
|
||||
- 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
|
||||
|
|
@ -79,21 +66,14 @@ stages:
|
|||
shardNumber: 4
|
||||
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
- task: Docker@2
|
||||
displayName: 'Build Docker Image'
|
||||
inputs:
|
||||
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
|
||||
command: build
|
||||
dockerfile: Dockerfile.playwright
|
||||
repository: $(dockerImageName)
|
||||
tags: $(imageTag)
|
||||
arguments: '--no-cache --pull'
|
||||
|
||||
- script: |
|
||||
# Create container and run tests
|
||||
|
|
@ -150,26 +130,18 @@ stages:
|
|||
- job: download_and_merge_reports
|
||||
dependsOn: playwright_tests
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
- task: Docker@2
|
||||
displayName: 'Build Docker Image'
|
||||
inputs:
|
||||
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
|
||||
command: build
|
||||
dockerfile: Dockerfile.playwright
|
||||
repository: $(dockerImageName)
|
||||
tags: $(imageTag)
|
||||
arguments: '--no-cache --pull'
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
targetPath: '$(System.DefaultWorkingDirectory)/playwright-reports'
|
||||
- script: |
|
||||
npm i ortoni-report &&
|
||||
for dir in $(System.DefaultWorkingDirectory)/playwright-reports/*/; do
|
||||
if [ -d "$dir" ]; then
|
||||
mv "$dir"* $(System.DefaultWorkingDirectory)/playwright-reports/
|
||||
|
|
@ -192,6 +164,7 @@ stages:
|
|||
source $(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
|
||||
shell: bash
|
||||
env:
|
||||
JIRA_API_KEY: $(JIRA_API_KEY)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue