From 8bfd2b788b222534639523f294577d724a3be5bb Mon Sep 17 00:00:00 2001 From: Uma Annamalai Date: Mon, 18 Dec 2023 13:58:10 -0800 Subject: [PATCH] Remove RPM config workflow. (#1007) --- .github/actions/update-rpm-config/action.yml | 69 -------------------- .github/workflows/deploy-python.yml | 10 --- 2 files changed, 79 deletions(-) delete mode 100644 .github/actions/update-rpm-config/action.yml diff --git a/.github/actions/update-rpm-config/action.yml b/.github/actions/update-rpm-config/action.yml deleted file mode 100644 index 01a367c51..000000000 --- a/.github/actions/update-rpm-config/action.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: "update-rpm-config" -description: "Set current version of agent in rpm config using API." -inputs: - agent-language: - description: "Language agent to configure (eg. python)" - required: true - default: "python" - agent-version: - description: "3-4 digit agent version number (eg. 1.2.3) with optional leading v (ignored)" - required: true - dry-run: - description: "Dry Run" - required: true - default: "false" - production-api-key: - description: "API key for New Relic Production" - required: false - -runs: - using: "composite" - steps: - - name: Trim potential leading v from agent version - shell: bash - run: | - AGENT_VERSION=${{ inputs.agent-version }} - echo "AGENT_VERSION=${AGENT_VERSION#"v"}" >> $GITHUB_ENV - - - name: Generate Payload - shell: bash - run: | - echo "PAYLOAD='{ \"system_configuration\": { \"key\": \"${{ inputs.agent-language }}_agent_version\", \"value\": \"${{ env.AGENT_VERSION }}\" } }'" >> $GITHUB_ENV - - - name: Generate Content-Type - shell: bash - run: | - echo "CONTENT_TYPE='Content-Type: application/json'" >> $GITHUB_ENV - - - name: Update system configuration page - shell: bash - if: ${{ inputs.dry-run == 'false' }} - run: | - curl -X POST 'https://api.newrelic.com/v2/system_configuration.json' \ - -H "X-Api-Key:${{ inputs.production-api-key }}" -i \ - -H ${{ env.CONTENT_TYPE }} \ - -d ${{ env.PAYLOAD }} - - - name: Verify system configuration update - shell: bash - if: ${{ inputs.dry-run == 'false' }} - run: | - PROD_VERSION=$(curl -X GET 'https://api.newrelic.com/v2/system_configuration.json' \ - -H "X-Api-Key:${{ inputs.production-api-key }}" \ - -H "${{ env.CONTENT_TYPE }}" | jq ".system_configurations | from_entries | .${{inputs.agent-language}}_agent_version") - - if [ "${{ env.AGENT_VERSION }}" != "$PROD_VERSION" ]; then - echo "Version mismatch: $PROD_VERSION" - exit 1 - fi - - - name: (dry-run) Update system configuration page - shell: bash - if: ${{ inputs.dry-run != 'false' }} - run: | - cat << EOF - curl -X POST 'https://api.newrelic.com/v2/system_configuration.json' \ - -H "X-Api-Key:**REDACTED**" -i \ - -H ${{ env.CONTENT_TYPE }} \ - -d ${{ env.PAYLOAD }} - EOF diff --git a/.github/workflows/deploy-python.yml b/.github/workflows/deploy-python.yml index 6ad06398f..fe16ee485 100644 --- a/.github/workflows/deploy-python.yml +++ b/.github/workflows/deploy-python.yml @@ -80,13 +80,3 @@ jobs: env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - - - name: Update RPM Config - uses: ./.github/actions/update-rpm-config - with: - agent-language: "python" - target-system: "all" - agent-version: "${{ github.ref_name }}" - dry-run: "false" - production-api-key: ${{ secrets.NEW_RELIC_API_KEY_PRODUCTION }} - staging-api-key: ${{ secrets.NEW_RELIC_API_KEY_STAGING }}