From af8b74292dbed502c8dd25cd2293de57638fefbc Mon Sep 17 00:00:00 2001 From: Stefano Verna Date: Fri, 13 Dec 2024 11:32:35 +0100 Subject: [PATCH] wip --- .github/workflows/deploy.yml | 5 +++-- .kamal/secrets.production | 4 ++-- .kamal/secrets.staging | 6 ++++-- config/deploy.yml | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 17c341b8..9b9a30fb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,8 +46,9 @@ jobs: - name: Deploy Application env: - GITHUB_CONTAINER_REGISTRY_API_TOKEN: ${{ secrets.GCR_API_TOKEN }} + CONTAINER_REGISTRY_API_TOKEN: ${{ secrets.GCR_API_TOKEN }} PRIVATE_KEY: ${{ secrets.KAVO_PRIVATE_KEY }} run: | - sed -i -E -e 's/\-\-break 0/--wrap=0/g' -e '/^SECRETS=/d' -e 's/^GITHUB_CONTAINER_REGISTRY_API_TOKEN=.*$/GITHUB_CONTAINER_REGISTRY_API_TOKEN=$GITHUB_CONTAINER_REGISTRY_API_TOKEN/' .kamal/secrets.$KAMAL_DESTINATION + sed -i -E -e 's/\-\-break 0/--wrap=0/g' -e '/^SECRETS=/d' -e 's/^CONTAINER_REGISTRY_API_TOKEN=.*$/CONTAINER_REGISTRY_API_TOKEN=$CONTAINER_REGISTRY_API_TOKEN/' .kamal/secrets.$KAMAL_DESTINATION + ruby -e 'require "dotenv"; puts ::Dotenv.parse(".kamal/secrets.staging").inspect' kamal deploy -d $KAMAL_DESTINATION diff --git a/.kamal/secrets.production b/.kamal/secrets.production index 7e35ba61..c515bca2 100644 --- a/.kamal/secrets.production +++ b/.kamal/secrets.production @@ -11,5 +11,5 @@ ROLLBAR_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^ROLLBAR_TOKEN= SECRET_API_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^SECRET_API_TOKEN=//p') SLACK_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^SLACK_TOKEN=//p') -SECRETS=$(kamal secrets fetch --adapter bitwarden --account s.verna@datocms.com GITHUB_CONTAINER_REGISTRY_API_TOKEN) -GITHUB_CONTAINER_REGISTRY_API_TOKEN=$(kamal secrets extract GITHUB_CONTAINER_REGISTRY_API_TOKEN $SECRETS) +SECRETS=$(kamal secrets fetch --adapter bitwarden --account s.verna@datocms.com CONTAINER_REGISTRY_API_TOKEN) +CONTAINER_REGISTRY_API_TOKEN=$(kamal secrets extract CONTAINER_REGISTRY_API_TOKEN $SECRETS) diff --git a/.kamal/secrets.staging b/.kamal/secrets.staging index b62cd697..aa171088 100644 --- a/.kamal/secrets.staging +++ b/.kamal/secrets.staging @@ -11,5 +11,7 @@ ROLLBAR_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^ROLLBAR_TOKEN= SECRET_API_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^SECRET_API_TOKEN=//p') SLACK_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^SLACK_TOKEN=//p') -SECRETS=$(kamal secrets fetch --adapter bitwarden --account s.verna@datocms.com GITHUB_CONTAINER_REGISTRY_API_TOKEN) -GITHUB_CONTAINER_REGISTRY_API_TOKEN=$(kamal secrets extract GITHUB_CONTAINER_REGISTRY_API_TOKEN $SECRETS) +PPP=$PRIVATE_KEY + +SECRETS=$(kamal secrets fetch --adapter bitwarden --account s.verna@datocms.com CONTAINER_REGISTRY_API_TOKEN) +CONTAINER_REGISTRY_API_TOKEN=$(kamal secrets extract CONTAINER_REGISTRY_API_TOKEN $SECRETS) diff --git a/config/deploy.yml b/config/deploy.yml index bac20688..d88e0296 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -6,7 +6,7 @@ registry: server: ghcr.io username: datocms password: - - GITHUB_CONTAINER_REGISTRY_API_TOKEN + - CONTAINER_REGISTRY_API_TOKEN servers: web: