From ee72db1f2a6ca32dc555c5e6bf4f838b85546535 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 7 Nov 2024 14:13:39 -0700 Subject: [PATCH] Changed release runners and sheel script date --- .github/workflows/release.yml | 135 ++++++++++++++++++---------------- bootstrap-salt.sh | 2 +- 2 files changed, 71 insertions(+), 66 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9744f33..a62d35a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,9 +52,10 @@ jobs: update-develop: name: Update CHANGELOG.md and bootstrap-salt.sh runs-on: - - self-hosted - - linux - - repo-release + - ubuntu-latest + ## - self-hosted + ## - linux + ## - repo-release permissions: contents: write # To be able to publish the release environment: release @@ -151,9 +152,10 @@ jobs: merge-develop-into-stable: name: Merge develop into stable runs-on: - - self-hosted - - linux - - repo-release + - ubuntu-latest + ## - self-hosted + ## - linux + ## - repo-release needs: - update-develop environment: release @@ -249,8 +251,9 @@ jobs: publish-release: name: Create GitHub Release runs-on: - - self-hosted - - linux + - ubuntu-latest + ## - self-hosted + ## - linux needs: - merge-develop-into-stable environment: release @@ -296,73 +299,75 @@ jobs: name: release-details failOnError: false - update-s3-bucket: - name: Update S3 Bucket - runs-on: - - self-hosted - - linux - - repo-release - needs: - - publish-release - environment: release + ## update-s3-bucket: + ## name: Update S3 Bucket + ## runs-on: + ## - ubuntu-latest + ## ## - self-hosted + ## ## - linux + ## ## - repo-release + ## needs: + ## - publish-release + ## environment: release - steps: - - uses: actions/checkout@v4 - with: - ref: stable - repository: ${{ github.repository }} - ssh-key: ${{ secrets.SALT_BOOTSTRAP_RELEASE_KEY }} + ## steps: + ## - uses: actions/checkout@v4 + ## with: + ## ref: stable + ## repository: ${{ github.repository }} + ## ssh-key: ${{ secrets.SALT_BOOTSTRAP_RELEASE_KEY }} - - name: Get Salt Project GitHub Actions Bot Environment - run: | - TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30") - SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment) - echo "SPB_ENVIRONMENT=$SPB_ENVIRONMENT" >> "$GITHUB_ENV" + ## - name: Get Salt Project GitHub Actions Bot Environment + ## run: | + ## TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30") + ## SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment) + ## echo "SPB_ENVIRONMENT=$SPB_ENVIRONMENT" >> "$GITHUB_ENV" - ## - name: Setup GnuPG - ## run: | - ## sudo install -d -m 0700 -o "$(id -u)" -g "$(id -g)" /run/gpg - ## GNUPGHOME="$(mktemp -d -p /run/gpg)" - ## echo "GNUPGHOME=${GNUPGHOME}" >> "$GITHUB_ENV" - ## cat < "${GNUPGHOME}/gpg.conf" - ## batch - ## no-tty - ## pinentry-mode loopback - ## EOF + ## ## - name: Setup GnuPG + ## ## run: | + ## ## sudo install -d -m 0700 -o "$(id -u)" -g "$(id -g)" /run/gpg + ## ## GNUPGHOME="$(mktemp -d -p /run/gpg)" + ## ## echo "GNUPGHOME=${GNUPGHOME}" >> "$GITHUB_ENV" + ## ## cat < "${GNUPGHOME}/gpg.conf" + ## ## batch + ## ## no-tty + ## ## pinentry-mode loopback + ## ## EOF - ## - name: Get Secrets - ## id: get-secrets - ## env: - ## SECRETS_KEY: ${{ secrets.SECRETS_KEY }} - ## run: | - ## SECRETS_KEY_FILE=$(mktemp /tmp/output.XXXXXXXXXX) - ## echo "$SECRETS_KEY" > "$SECRETS_KEY_FILE" - ## aws --region us-west-2 secretsmanager get-secret-value --secret-id /cmbu-saltstack/signing/repo-signing-keys-sha256-2023 \ - ## --query SecretString --output text | jq .default_key -r | base64 -d \ - ## | gpg --passphrase-file "${SECRETS_KEY_FILE}" -d - \ - ## | gpg --import - - ## sync - ## aws --region us-west-2 secretsmanager get-secret-value --secret-id /cmbu-saltstack/signing/repo-signing-keys-sha256-2023 \ - ## --query SecretString --output text| jq .default_passphrase -r | base64 -d \ - ## | gpg --passphrase-file "${SECRETS_KEY_FILE}" -o "${GNUPGHOME}/passphrase" -d - - ## sync - ## rm "$SECRETS_KEY_FILE" - ## echo "passphrase-file ${GNUPGHOME}/passphrase" >> "${GNUPGHOME}/gpg.conf" + ## ## - name: Get Secrets + ## ## id: get-secrets + ## ## env: + ## ## SECRETS_KEY: ${{ secrets.SECRETS_KEY }} + ## ## run: | + ## ## SECRETS_KEY_FILE=$(mktemp /tmp/output.XXXXXXXXXX) + ## ## echo "$SECRETS_KEY" > "$SECRETS_KEY_FILE" + ## ## aws --region us-west-2 secretsmanager get-secret-value --secret-id /cmbu-saltstack/signing/repo-signing-keys-sha256-2023 \ + ## ## --query SecretString --output text | jq .default_key -r | base64 -d \ + ## ## | gpg --passphrase-file "${SECRETS_KEY_FILE}" -d - \ + ## ## | gpg --import - + ## ## sync + ## ## aws --region us-west-2 secretsmanager get-secret-value --secret-id /cmbu-saltstack/signing/repo-signing-keys-sha256-2023 \ + ## ## --query SecretString --output text| jq .default_passphrase -r | base64 -d \ + ## ## | gpg --passphrase-file "${SECRETS_KEY_FILE}" -o "${GNUPGHOME}/passphrase" -d - + ## ## sync + ## ## rm "$SECRETS_KEY_FILE" + ## ## echo "passphrase-file ${GNUPGHOME}/passphrase" >> "${GNUPGHOME}/gpg.conf" - ## - name: Install Requirements - ## run: | - ## python3 -m pip install -r requirements/release.txt + ## ## - name: Install Requirements + ## ## run: | + ## ## python3 -m pip install -r requirements/release.txt - ## - name: Upload Stable Release to S3 - ## run: | - ## tools release s3-publish --key-id 64CBBC8173D76B3F stable + ## ## - name: Upload Stable Release to S3 + ## ## run: | + ## ## tools release s3-publish --key-id 64CBBC8173D76B3F stable update-develop-checksums: name: Update Release Checksums on Develop runs-on: - - self-hosted - - linux - - repo-release + - ubuntu-latest + ## - self-hosted + ## - linux + ## - repo-release needs: - publish-release environment: release diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index faf8a03..d4fa965 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -26,7 +26,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.11.06" +__ScriptVersion="2024.11.07" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0"