From 885ebf80e35332e5736b1dd0f87632317bccb68a Mon Sep 17 00:00:00 2001 From: ohemorange Date: Sun, 19 Jun 2022 13:37:40 -0700 Subject: [PATCH] Change snapcraft authentication to use SNAPCRAFT_STORE_CREDENTIALS (#9326) * try the easy thing of just doing what the error message says * temporarily add deploy stage to extended tests to see if it uploads properly * follow instructions on https://forum.snapcraft.io/t/snapcraft-authentication-options/30473 * just run the packaging jobs for speed * fix formatting * import changes from test- branch and revert temporary changes * Update instructions in deploy-stage.yml --- .azure-pipelines/templates/stages/deploy-stage.yml | 6 +++--- .gitignore | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/stages/deploy-stage.yml b/.azure-pipelines/templates/stages/deploy-stage.yml index 4ae4c563e..88aeab60e 100644 --- a/.azure-pipelines/templates/stages/deploy-stage.yml +++ b/.azure-pipelines/templates/stages/deploy-stage.yml @@ -13,8 +13,8 @@ stages: # credential file was created by running: # # snapcraft logout - # snapcraft login (provide the shared snapcraft credentials when prompted) # snapcraft export-login --channels=beta,edge snapcraft.cfg + # (provide the shared snapcraft credentials when prompted) # # Then the file was added as a secure file in Azure pipelines # with the name snapcraft.cfg by following the instructions at @@ -24,7 +24,7 @@ stages: # https://docs.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops#q-how-do-i-authorize-a-secure-file-for-use-in-a-specific-pipeline. # # This file has a maximum lifetime of one year and the current - # file will expire on 2022-07-25 which is also tracked by + # file will expire on 2023-06-17 which is also tracked by # https://github.com/certbot/certbot/issues/7931. The file will # need to be updated before then to prevent automated deploys # from breaking. @@ -64,7 +64,7 @@ stages: secureFile: snapcraft.cfg - bash: | set -e - snapcraft login --with $(snapcraftCfg.secureFilePath) + export SNAPCRAFT_STORE_CREDENTIALS=$(cat $(snapcraftCfg.secureFilePath)) for SNAP_FILE in snap/*.snap; do tools/retry.sh eval snapcraft upload --release=${{ parameters.snapReleaseChannel }} "${SNAP_FILE}" done diff --git a/.gitignore b/.gitignore index d87bacc91..05e3cf47c 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ certbot-dns*/certbot-dns*_arm*.txt /certbot_amd64*.txt /certbot_arm*.txt certbot-dns*/snap +snapcraft.cfg