From e80ff6f9d43731d8c1943cd154ef5f317f380414 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Wed, 10 Mar 2021 23:49:59 +0300 Subject: [PATCH] Azure: Template docs build The distros may use different sphinx builder paths, for example, by exporting of SPHINXBUILD env var. Signed-off-by: Stanislav Levin Reviewed-By: Alexander Bokovoy --- ipatests/azure/azure-pipelines.yml | 22 ++++++++++++------- .../azure/templates/build-docs-fedora.yml | 6 +++++ ipatests/azure/templates/publish-build.yml | 11 +++++++++- .../templates/setup-test-environment.yml | 8 +++---- ipatests/azure/templates/variables-fedora.yml | 3 +++ .../azure/templates/variables-rawhide.yml | 3 +++ 6 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 ipatests/azure/templates/build-docs-fedora.yml diff --git a/ipatests/azure/azure-pipelines.yml b/ipatests/azure/azure-pipelines.yml index 3367b7678..9cc9406c5 100644 --- a/ipatests/azure/azure-pipelines.yml +++ b/ipatests/azure/azure-pipelines.yml @@ -29,7 +29,7 @@ jobs: - template: templates/${{ variables.BUILD_TEMPLATE }} - template: templates/publish-build.yml parameters: - artifactName: 'packages-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)' + artifactName: 'packages' targetPath: $(Build.Repository.LocalPath)/dist displayName: Publish packages @@ -44,7 +44,7 @@ jobs: displayName: Create container image for test - template: templates/publish-build.yml parameters: - artifactName: 'image-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)' + artifactName: 'image' targetPath: $(Build.Repository.LocalPath)/freeipa-azure-builder-container.tar.gz displayName: Publish container image - template: templates/generate-matrix.yml @@ -71,13 +71,13 @@ jobs: set -e echo "Running make target 'lint'" make V=0 lint - echo "Building documentation" - make -C doc/ html - displayName: Lint sources and documentation - - template: templates/save-test-artifacts.yml + displayName: Lint sources + - template: templates/${{ variables.BUILD_DOCS_TEMPLATE }} + - template: templates/publish-build.yml parameters: - logsPath: doc/_build/html - logsArtifact: docs-$(System.JobIdentifier)-$(Build.BuildId)-$(System.StageAttempt)-$(System.PhaseAttempt)-$(System.JobPositionInPhase) + artifactName: 'docs' + targetPath: doc/_build/html + displayName: Publish docs - job: Tox pool: @@ -129,6 +129,9 @@ jobs: pool: vmImage: $(VM_IMAGE) dependsOn: Build + variables: + IPA_IMAGE_ARTIFACT: $[ dependencies.Build.outputs['artifacts_image.image'] ] + IPA_PACKAGES_ARTIFACT: $[ dependencies.Build.outputs['artifacts_packages.packages'] ] condition: succeeded() strategy: matrix: $[ dependencies.Build.outputs['base_matrix.matrix'] ] @@ -140,6 +143,9 @@ jobs: pool: vmImage: $(VM_IMAGE) dependsOn: Build + variables: + IPA_IMAGE_ARTIFACT: $[ dependencies.Build.outputs['artifacts_image.image'] ] + IPA_PACKAGES_ARTIFACT: $[ dependencies.Build.outputs['artifacts_packages.packages'] ] condition: succeeded() strategy: matrix: $[ dependencies.Build.outputs['gating_matrix.matrix'] ] diff --git a/ipatests/azure/templates/build-docs-fedora.yml b/ipatests/azure/templates/build-docs-fedora.yml new file mode 100644 index 000000000..d22b7378c --- /dev/null +++ b/ipatests/azure/templates/build-docs-fedora.yml @@ -0,0 +1,6 @@ +steps: +- script: | + set -e + echo "Building documentation" + make -C doc/ html + displayName: Build documentation diff --git a/ipatests/azure/templates/publish-build.yml b/ipatests/azure/templates/publish-build.yml index 94b034a2d..9eba6a73a 100644 --- a/ipatests/azure/templates/publish-build.yml +++ b/ipatests/azure/templates/publish-build.yml @@ -4,8 +4,17 @@ parameters: displayName: '' steps: +- script: | + set -e + ARTIFACT_NAME="${{ parameters.artifactName }}-$(Build.BuildId)-$(System.StageAttempt)-$(System.PhaseAttempt)-$(Agent.OS)-$(Agent.OSArchitecture)" + + echo "Artifact name: '${ARTIFACT_NAME}'" + echo "##vso[task.setvariable variable=${{ parameters.artifactName }};isOutput=true]${ARTIFACT_NAME}" + name: artifacts_${{ parameters.artifactName }} + displayName: Generate unique artifact name for ${{ parameters.artifactName }} + - task: PublishPipelineArtifact@1 inputs: - artifactName: ${{ parameters.artifactName }} + artifactName: $(artifacts_${{ parameters.artifactName }}.${{ parameters.artifactName }}) targetPath: ${{ parameters.targetPath }} displayName: ${{ parameters.displayName }} diff --git a/ipatests/azure/templates/setup-test-environment.yml b/ipatests/azure/templates/setup-test-environment.yml index 9edefa17c..f6d33fab6 100644 --- a/ipatests/azure/templates/setup-test-environment.yml +++ b/ipatests/azure/templates/setup-test-environment.yml @@ -18,15 +18,15 @@ steps: displayName: Configure NFS to allow NFS server/client within containers - task: DownloadPipelineArtifact@0 - displayName: Download prebuilt packages + displayName: Download prebuilt packages '$(IPA_PACKAGES_ARTIFACT)' inputs: - artifactName: 'packages-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)' + artifactName: $(IPA_PACKAGES_ARTIFACT) targetPath: $(Build.Repository.LocalPath)/dist - task: DownloadPipelineArtifact@0 - displayName: Download pre-built container + displayName: Download pre-built container '$(IPA_IMAGE_ARTIFACT)' inputs: - artifactName: 'image-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)' + artifactName: $(IPA_IMAGE_ARTIFACT) targetPath: $(Build.Repository.LocalPath) - script: | diff --git a/ipatests/azure/templates/variables-fedora.yml b/ipatests/azure/templates/variables-fedora.yml index 133a4a10a..eaada50a3 100644 --- a/ipatests/azure/templates/variables-fedora.yml +++ b/ipatests/azure/templates/variables-fedora.yml @@ -17,4 +17,7 @@ variables: PREPARE_TOX_TEMPLATE: ${{ format('prepare-tox-{0}.yml', variables.IPA_PLATFORM) }} PREPARE_WEBUI_TEMPLATE: ${{ format('prepare-webui-{0}.yml', variables.IPA_PLATFORM) }} + # the template to build sphinx docs + BUILD_DOCS_TEMPLATE: ${{ format('build-docs-{0}.yml', variables.IPA_PLATFORM) }} + TOX_COMMAND: tox diff --git a/ipatests/azure/templates/variables-rawhide.yml b/ipatests/azure/templates/variables-rawhide.yml index 3fb0cddc3..1a0b9f8d7 100644 --- a/ipatests/azure/templates/variables-rawhide.yml +++ b/ipatests/azure/templates/variables-rawhide.yml @@ -20,4 +20,7 @@ variables: PREPARE_TOX_TEMPLATE: ${{ format('prepare-tox-{0}.yml', variables.IPA_PLATFORM) }} PREPARE_WEBUI_TEMPLATE: ${{ format('prepare-webui-{0}.yml', variables.IPA_PLATFORM) }} + # the template to build sphinx docs + BUILD_DOCS_TEMPLATE: ${{ format('build-docs-{0}.yml', variables.IPA_PLATFORM) }} + TOX_COMMAND: tox