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)
|
# 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:
|
|
||||||
- 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
|
- job: playwright_tests
|
||||||
dependsOn: build_docker_image
|
dependsOn: build_docker_image
|
||||||
continueOnError: true
|
continueOnError: true
|
||||||
|
|
@ -79,21 +66,14 @@ stages:
|
||||||
shardNumber: 4
|
shardNumber: 4
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: Docker@2
|
||||||
|
displayName: 'Build Docker Image'
|
||||||
inputs:
|
inputs:
|
||||||
targetPath: '$(System.DefaultWorkingDirectory)/docker_build'
|
command: build
|
||||||
displayName: Download docker image
|
dockerfile: Dockerfile.playwright
|
||||||
- script: |
|
repository: $(dockerImageName)
|
||||||
ls
|
tags: $(imageTag)
|
||||||
for dir in $(System.DefaultWorkingDirectory)/docker_build/*/; do
|
arguments: '--no-cache --pull'
|
||||||
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
|
||||||
|
|
@ -150,26 +130,18 @@ stages:
|
||||||
- job: download_and_merge_reports
|
- job: download_and_merge_reports
|
||||||
dependsOn: playwright_tests
|
dependsOn: playwright_tests
|
||||||
steps:
|
steps:
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: Docker@2
|
||||||
|
displayName: 'Build Docker Image'
|
||||||
inputs:
|
inputs:
|
||||||
targetPath: '$(System.DefaultWorkingDirectory)/docker_build'
|
command: build
|
||||||
displayName: Download docker image
|
dockerfile: Dockerfile.playwright
|
||||||
- script: |
|
repository: $(dockerImageName)
|
||||||
ls
|
tags: $(imageTag)
|
||||||
for dir in $(System.DefaultWorkingDirectory)/docker_build/*/; do
|
arguments: '--no-cache --pull'
|
||||||
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
|
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
inputs:
|
inputs:
|
||||||
targetPath: '$(System.DefaultWorkingDirectory)/playwright-reports'
|
targetPath: '$(System.DefaultWorkingDirectory)/playwright-reports'
|
||||||
- script: |
|
- script: |
|
||||||
npm i ortoni-report &&
|
|
||||||
for dir in $(System.DefaultWorkingDirectory)/playwright-reports/*/; do
|
for dir in $(System.DefaultWorkingDirectory)/playwright-reports/*/; do
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
mv "$dir"* $(System.DefaultWorkingDirectory)/playwright-reports/
|
mv "$dir"* $(System.DefaultWorkingDirectory)/playwright-reports/
|
||||||
|
|
@ -192,6 +164,7 @@ stages:
|
||||||
source $(System.DefaultWorkingDirectory)/devops/scripts/jira_writeback.sh &&
|
source $(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
|
||||||
|
shell: bash
|
||||||
env:
|
env:
|
||||||
JIRA_API_KEY: $(JIRA_API_KEY)
|
JIRA_API_KEY: $(JIRA_API_KEY)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue