Compare commits

...

6 Commits

Author SHA1 Message Date
Adrien Ferrand
a17de713c6 Focus on docker jobs 2020-10-22 17:34:58 +02:00
Adrien Ferrand
0c6ee0e921 And finally the proper test command 2020-10-22 17:34:41 +02:00
Adrien Ferrand
c6a71d2721 Fix image references 2020-10-22 17:27:17 +02:00
Adrien Ferrand
9bb31f545e Fix image listing 2020-10-22 17:20:21 +02:00
Adrien Ferrand
004d400ba7 Fix 2020-10-22 17:01:26 +02:00
Adrien Ferrand
19b7c2df28 Prepare basic integration tests for certbot dockers 2020-10-22 16:56:29 +02:00
2 changed files with 184 additions and 166 deletions

View File

@@ -31,172 +31,190 @@ jobs:
path: $(Build.ArtifactStagingDirectory)
artifact: docker_$(DOCKER_ARCH)
displayName: Store Docker artifact
- job: installer_build
pool:
vmImage: vs2017-win2016
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
architecture: x86
addToPath: true
- script: python windows-installer/construct.py
displayName: Build Certbot installer
- task: CopyFiles@2
inputs:
sourceFolder: $(System.DefaultWorkingDirectory)/windows-installer/build/nsis
contents: '*.exe'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishPipelineArtifact@1
inputs:
path: $(Build.ArtifactStagingDirectory)
# If we change the artifact's name, it should also be changed in tools/create_github_release.py
artifact: windows-installer
displayName: Publish Windows installer
- job: installer_run
dependsOn: installer_build
strategy:
matrix:
win2019:
imageName: windows-2019
win2016:
imageName: vs2017-win2016
pool:
vmImage: $(imageName)
steps:
- powershell: |
if ($PSVersionTable.PSVersion.Major -ne 5) {
throw "Powershell version is not 5.x"
}
condition: eq(variables['imageName'], 'vs2017-win2016')
displayName: Check Powershell 5.x is used in vs2017-win2016
- task: UsePythonVersion@0
inputs:
versionSpec: 3.8
addToPath: true
- task: DownloadPipelineArtifact@2
inputs:
artifact: windows-installer
path: $(Build.SourcesDirectory)/bin
displayName: Retrieve Windows installer
# pip 9.0 provided by pipstrap is not able to resolve properly the pywin32 dependency
# required by certbot-ci: as a temporary workaround until pipstrap is updated, we install
# a recent version of pip, but we also to disable the isolated feature as described in
# https://github.com/certbot/certbot/issues/8256
- script: |
py -3 -m venv venv
venv\Scripts\python -m pip install pip==20.2.3 setuptools==50.3.0 wheel==0.35.1
venv\Scripts\python tools\pip_install.py -e certbot-ci
env:
PIP_NO_BUILD_ISOLATION: no
displayName: Prepare Certbot-CI
- script: |
set PATH=%ProgramFiles(x86)%\Certbot\bin;%PATH%
venv\Scripts\python -m pytest certbot-ci\windows_installer_integration_tests --allow-persistent-changes --installer-path $(Build.SourcesDirectory)\bin\certbot-beta-installer-win32.exe
displayName: Run windows installer integration tests
- script: |
set PATH=%ProgramFiles(x86)%\Certbot\bin;%PATH%
venv\Scripts\python -m pytest certbot-ci\certbot_integration_tests\certbot_tests -n 4
displayName: Run certbot integration tests
- job: snaps_build
pool:
vmImage: ubuntu-18.04
timeoutInMinutes: 0
variables:
# Do not run the heavy non-amd64 builds for test branches
${{ if not(startsWith(variables['Build.SourceBranchName'], 'test-')) }}:
ARCHS: amd64 arm64 armhf
${{ if startsWith(variables['Build.SourceBranchName'], 'test-') }}:
ARCHS: amd64
steps:
- script: |
set -e
sudo apt-get update
sudo apt-get install -y --no-install-recommends snapd
sudo snap install --classic snapcraft
displayName: Install dependencies
- task: UsePythonVersion@0
inputs:
versionSpec: 3.8
addToPath: true
- task: DownloadSecureFile@1
name: credentials
inputs:
secureFile: launchpad-credentials
- script: |
set -e
git config --global user.email "$(Build.RequestedForEmail)"
git config --global user.name "$(Build.RequestedFor)"
mkdir -p ~/.local/share/snapcraft/provider/launchpad
cp $(credentials.secureFilePath) ~/.local/share/snapcraft/provider/launchpad/credentials
python3 tools/snap/build_remote.py ALL --archs ${ARCHS}
displayName: Build snaps
- script: |
set -e
mv *.snap $(Build.ArtifactStagingDirectory)
mv certbot-dns-*/*.snap $(Build.ArtifactStagingDirectory)
displayName: Prepare artifacts
- task: PublishPipelineArtifact@1
inputs:
path: $(Build.ArtifactStagingDirectory)
artifact: snaps
displayName: Store snaps artifacts
- job: snap_run
dependsOn: snaps_build
- job: docker_run
dependsOn: docker_build
pool:
vmImage: ubuntu-18.04
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.8
addToPath: true
- script: |
set -e
sudo apt-get update
sudo apt-get install -y --no-install-recommends nginx-light snapd
python3 -m venv venv
venv/bin/python letsencrypt-auto-source/pieces/pipstrap.py
venv/bin/python tools/pip_install.py -U tox
displayName: Install dependencies
- task: DownloadPipelineArtifact@2
inputs:
artifact: snaps
path: $(Build.SourcesDirectory)/snap
displayName: Retrieve Certbot snaps
- script: |
set -e
sudo snap install --dangerous --classic snap/certbot_*_amd64.snap
displayName: Install Certbot snap
- script: |
set -e
venv/bin/python -m tox -e integration-external,apacheconftest-external-with-pebble
displayName: Run tox
- job: snap_dns_run
dependsOn: snaps_build
pool:
vmImage: ubuntu-18.04
steps:
- script: |
set -e
sudo apt-get update
sudo apt-get install -y --no-install-recommends snapd
displayName: Install dependencies
- task: UsePythonVersion@0
inputs:
versionSpec: 3.8
addToPath: true
- task: DownloadPipelineArtifact@2
inputs:
artifact: snaps
path: $(Build.SourcesDirectory)/snap
displayName: Retrieve Certbot snaps
- script: |
set -e
python3 -m venv venv
venv/bin/python letsencrypt-auto-source/pieces/pipstrap.py
venv/bin/python tools/pip_install.py -e certbot-ci
displayName: Prepare Certbot-CI
- script: |
set -e
sudo -E venv/bin/pytest certbot-ci/snap_integration_tests/dns_tests --allow-persistent-changes --snap-folder $(Build.SourcesDirectory)/snap --snap-arch amd64
displayName: Test DNS plugins snaps
artifact: docker_amd64
path: $(Build.SourcesDirectory)
displayName: Retrieve Docker images
- bash: set -e && docker load --input $(Build.SourcesDirectory)/images.tar
displayName: Load Docker images
- bash: |
set -ex
DOCKER_IMAGES=$(docker images --filter reference='*/certbot' --filter reference='*/dns-*' --format '{{.Repository}}:{{.Tag}}')
for DOCKER_IMAGE in ${DOCKER_IMAGES}
do docker run --rm "${DOCKER_IMAGE}" plugins --prepare
done
# - job: installer_build
# pool:
# vmImage: vs2017-win2016
# steps:
# - task: UsePythonVersion@0
# inputs:
# versionSpec: 3.7
# architecture: x86
# addToPath: true
# - script: python windows-installer/construct.py
# displayName: Build Certbot installer
# - task: CopyFiles@2
# inputs:
# sourceFolder: $(System.DefaultWorkingDirectory)/windows-installer/build/nsis
# contents: '*.exe'
# targetFolder: $(Build.ArtifactStagingDirectory)
# - task: PublishPipelineArtifact@1
# inputs:
# path: $(Build.ArtifactStagingDirectory)
# # If we change the artifact's name, it should also be changed in tools/create_github_release.py
# artifact: windows-installer
# displayName: Publish Windows installer
# - job: installer_run
# dependsOn: installer_build
# strategy:
# matrix:
# win2019:
# imageName: windows-2019
# win2016:
# imageName: vs2017-win2016
# pool:
# vmImage: $(imageName)
# steps:
# - powershell: |
# if ($PSVersionTable.PSVersion.Major -ne 5) {
# throw "Powershell version is not 5.x"
# }
# condition: eq(variables['imageName'], 'vs2017-win2016')
# displayName: Check Powershell 5.x is used in vs2017-win2016
# - task: UsePythonVersion@0
# inputs:
# versionSpec: 3.8
# addToPath: true
# - task: DownloadPipelineArtifact@2
# inputs:
# artifact: windows-installer
# path: $(Build.SourcesDirectory)/bin
# displayName: Retrieve Windows installer
# # pip 9.0 provided by pipstrap is not able to resolve properly the pywin32 dependency
# # required by certbot-ci: as a temporary workaround until pipstrap is updated, we install
# # a recent version of pip, but we also to disable the isolated feature as described in
# # https://github.com/certbot/certbot/issues/8256
# - script: |
# py -3 -m venv venv
# venv\Scripts\python -m pip install pip==20.2.3 setuptools==50.3.0 wheel==0.35.1
# venv\Scripts\python tools\pip_install.py -e certbot-ci
# env:
# PIP_NO_BUILD_ISOLATION: no
# displayName: Prepare Certbot-CI
# - script: |
# set PATH=%ProgramFiles(x86)%\Certbot\bin;%PATH%
# venv\Scripts\python -m pytest certbot-ci\windows_installer_integration_tests --allow-persistent-changes --installer-path $(Build.SourcesDirectory)\bin\certbot-beta-installer-win32.exe
# displayName: Run windows installer integration tests
# - script: |
# set PATH=%ProgramFiles(x86)%\Certbot\bin;%PATH%
# venv\Scripts\python -m pytest certbot-ci\certbot_integration_tests\certbot_tests -n 4
# displayName: Run certbot integration tests
# - job: snaps_build
# pool:
# vmImage: ubuntu-18.04
# timeoutInMinutes: 0
# variables:
# # Do not run the heavy non-amd64 builds for test branches
# ${{ if not(startsWith(variables['Build.SourceBranchName'], 'test-')) }}:
# ARCHS: amd64 arm64 armhf
# ${{ if startsWith(variables['Build.SourceBranchName'], 'test-') }}:
# ARCHS: amd64
# steps:
# - script: |
# set -e
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends snapd
# sudo snap install --classic snapcraft
# displayName: Install dependencies
# - task: UsePythonVersion@0
# inputs:
# versionSpec: 3.8
# addToPath: true
# - task: DownloadSecureFile@1
# name: credentials
# inputs:
# secureFile: launchpad-credentials
# - script: |
# set -e
# git config --global user.email "$(Build.RequestedForEmail)"
# git config --global user.name "$(Build.RequestedFor)"
# mkdir -p ~/.local/share/snapcraft/provider/launchpad
# cp $(credentials.secureFilePath) ~/.local/share/snapcraft/provider/launchpad/credentials
# python3 tools/snap/build_remote.py ALL --archs ${ARCHS}
# displayName: Build snaps
# - script: |
# set -e
# mv *.snap $(Build.ArtifactStagingDirectory)
# mv certbot-dns-*/*.snap $(Build.ArtifactStagingDirectory)
# displayName: Prepare artifacts
# - task: PublishPipelineArtifact@1
# inputs:
# path: $(Build.ArtifactStagingDirectory)
# artifact: snaps
# displayName: Store snaps artifacts
# - job: snap_run
# dependsOn: snaps_build
# pool:
# vmImage: ubuntu-18.04
# steps:
# - task: UsePythonVersion@0
# inputs:
# versionSpec: 3.8
# addToPath: true
# - script: |
# set -e
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends nginx-light snapd
# python3 -m venv venv
# venv/bin/python letsencrypt-auto-source/pieces/pipstrap.py
# venv/bin/python tools/pip_install.py -U tox
# displayName: Install dependencies
# - task: DownloadPipelineArtifact@2
# inputs:
# artifact: snaps
# path: $(Build.SourcesDirectory)/snap
# displayName: Retrieve Certbot snaps
# - script: |
# set -e
# sudo snap install --dangerous --classic snap/certbot_*_amd64.snap
# displayName: Install Certbot snap
# - script: |
# set -e
# venv/bin/python -m tox -e integration-external,apacheconftest-external-with-pebble
# displayName: Run tox
# - job: snap_dns_run
# dependsOn: snaps_build
# pool:
# vmImage: ubuntu-18.04
# steps:
# - script: |
# set -e
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends snapd
# displayName: Install dependencies
# - task: UsePythonVersion@0
# inputs:
# versionSpec: 3.8
# addToPath: true
# - task: DownloadPipelineArtifact@2
# inputs:
# artifact: snaps
# path: $(Build.SourcesDirectory)/snap
# displayName: Retrieve Certbot snaps
# - script: |
# set -e
# python3 -m venv venv
# venv/bin/python letsencrypt-auto-source/pieces/pipstrap.py
# venv/bin/python tools/pip_install.py -e certbot-ci
# displayName: Prepare Certbot-CI
# - script: |
# set -e
# sudo -E venv/bin/pytest certbot-ci/snap_integration_tests/dns_tests --allow-persistent-changes --snap-folder $(Build.SourcesDirectory)/snap --snap-arch amd64
# displayName: Test DNS plugins snaps

View File

@@ -1,6 +1,6 @@
stages:
- stage: TestAndPackage
jobs:
- template: ../jobs/standard-tests-jobs.yml
- template: ../jobs/extended-tests-jobs.yml
# - template: ../jobs/standard-tests-jobs.yml
# - template: ../jobs/extended-tests-jobs.yml
- template: ../jobs/packaging-jobs.yml