From b69f5588f4c05d184a5d1e983ffa7898affa0e4d Mon Sep 17 00:00:00 2001 From: Robie Basak Date: Tue, 3 Sep 2019 15:41:11 +0100 Subject: [PATCH] Continued improvements * Remove legacy Store upload credentials These have not been needed since 5d7969a. * Work around dev part dependency failure case Get pip to install certbot from its VCS repository directly during the build of the nginx and apache plugin parts. This works around issue #12 when it affects the interaction between the apache or nginx plugin and certbot itself. It does not work around the case where the same problem occurs in the interaction between certbot and acme. This looks harder to work around because pip's VCS URL handling doesn't appear to include a facility to install from a subdirectory of a git repository and this is where the acme source is located. * Switch to using lxd for the snapcraft run The Docker image is 16.04 only. Before we can switch to 18.04, we need to remove Docker, which means using the snapcraft snap using Travis' new snap support, and then using the lxd functionality in snapcraft so that it is enabled to build in the appropriate environment. * Switch build to use core 18 Fixes: #14 * Move constraints into a list This seems to be a requirement either either newer snapcraft, snapcraft in lxd or in the move to core18 (it isn't clear to me which). This fixes the error: Failed to load plugin: properties failed to load for certbot: The 'constraints' property does not match the required schema: '$SNAPCRAFT_PART_SRC/constraints.txt' is not of type 'array' * version-script -> snapcraftctl set-version The use of version-script seems to break with either newer snapcraft, snapcraft with lxd or core18 (it's not clear to me which). The breakage is related to "parts/certbot/src" not being found. This can be fixed with $SNAPCRAFT_PART_SRC, but this doesn't seem to be defined at "version-script time". However https://snapcraft.io/docs/deprecation-notices/dn10 deprecates the use of version-script, and if we convert to the recommended new way, then we use override-pull instead and $SNAPCRAFT_PART_SRC is defined there, so this conveniently fixes both problems at once. * Do not explicitly install snapd Since this is now handled by the Travis addon, we do not need to do it explicitly. --- snap/.snapcraft/travis_snapcraft.cfg | Bin 2448 -> 0 bytes snap/.travis.yml | 14 ++++++++++++-- snap/snapcraft.yaml | 17 +++++++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) delete mode 100644 snap/.snapcraft/travis_snapcraft.cfg diff --git a/snap/.snapcraft/travis_snapcraft.cfg b/snap/.snapcraft/travis_snapcraft.cfg deleted file mode 100644 index d54f41155fe3ff5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(ejja|i3_H1`oa_5J!En2hP6+YL!M zIBhzz;jj3PDtKgr+I^_Kc8W!2*+E_V)T*OBqww_Wid151=!vll3u)HxK(#&)f&YYYsC>SyoUOOF(0Z{V(qivF0#(W6oYjMvR6$S|`s9Jl zS%Ztzb~ouF4Q>Ow7Q3#JZiI&!FXfNmx(1kv!w OnZUwb{V>Dqu1Ux#JH%H2 diff --git a/snap/.travis.yml b/snap/.travis.yml index 3c934b7bd..418407558 100644 --- a/snap/.travis.yml +++ b/snap/.travis.yml @@ -1,12 +1,15 @@ language: python before_install: - - sudo -E apt-get -yq --no-install-suggests --no-install-recommends install nginx-light snapd python3-venv + - sudo -E apt-get -yq --no-install-suggests --no-install-recommends install nginx-light python3-venv - sudo -E /etc/init.d/nginx stop install: + - sudo /snap/bin/lxd.migrate -yes + - sudo /snap/bin/lxd waitready + - sudo /snap/bin/lxd init --auto - git clone https://github.com/certbot/certbot.git certbot --branch master - certbot/tools/strip_hashes.py certbot/letsencrypt-auto-source/pieces/dependency-requirements.txt > certbot/constraints.txt before_script: - - docker run -v $(pwd):$(pwd) -t snapcore/snapcraft sh -c "apt-get update -qq && apt-get install -qq git && cd $(pwd) && snapcraft" + - sudo snapcraft --use-lxd script: - sudo snap install --dangerous --classic *.snap - sudo bash test.sh @@ -21,3 +24,10 @@ notifications: email: recipients: [robie.basak@canonical.com] on_failure: change +addons: + snaps: + - name: snapcraft + channel: stable + classic: true + - name: lxd + channel: stable diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b7bfab9ca..38d32ed0b 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,4 @@ name: certbot -version: script -version-script: cd parts/certbot/src && git describe|sed s/^v// summary: Automatically configure HTTPS using Let's Encrypt description: | The objective of Certbot, Let's Encrypt, and the ACME (Automated @@ -17,6 +15,8 @@ description: | - Help you revoke the certificate if that ever becomes necessary. confinement: classic grade: devel +base: core18 +adopt-info: certbot apps: certbot: @@ -47,26 +47,31 @@ parts: plugin: python source: certbot source-subdir: acme - constraints: $SNAPCRAFT_PART_SRC/constraints.txt + constraints: [$SNAPCRAFT_PART_SRC/constraints.txt] python-version: python3 certbot: plugin: python source: certbot - constraints: $SNAPCRAFT_PART_SRC/constraints.txt + constraints: [$SNAPCRAFT_PART_SRC/constraints.txt] python-version: python3 after: [acme] + override-pull: | + snapcraftctl pull + snapcraftctl set-version `cd $SNAPCRAFT_PART_SRC && git describe|sed s/^v//` certbot-apache: plugin: python source: certbot source-subdir: certbot-apache - constraints: $SNAPCRAFT_PART_SRC/constraints.txt + constraints: [$SNAPCRAFT_PART_SRC/constraints.txt] python-version: python3 after: [python-augeas, certbot] stage-packages: [libaugeas0] + python-packages: ['git+https://github.com/certbot/certbot.git'] # workaround for #12 certbot-nginx: plugin: python source: certbot source-subdir: certbot-nginx - constraints: $SNAPCRAFT_PART_SRC/constraints.txt + constraints: [$SNAPCRAFT_PART_SRC/constraints.txt] python-version: python3 after: [certbot] + python-packages: ['git+https://github.com/certbot/certbot.git'] # workaround for #12