Skip to content

Commit

Permalink
Update APM version on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr authored Aug 2, 2023
1 parent c5248e4 commit bbdad76
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
description: 'If "true", will run the index-download-site job. If "false", will not.'
required: true
default: 'true'
update-apm-version:
description: 'If "true", will run the update-apm job. If "false", will not.'
required: true
default: 'true'

permissions:
contents: read
Expand Down Expand Up @@ -334,3 +338,37 @@ jobs:
run: |
curl -i -X POST -H 'Fastly-Key:${{ secrets.FASTLY_TOKEN }}' ${{ secrets.FASTLY_URL }}
shell: bash

update-apm:
name: Update System Configuration Page
runs-on: ubuntu-latest
if: ${{ github.event.inputs.update-apm-version == true }}
steps:
- name: Update system configuration page
run: |
PAYLOAD="{
\"system_configuration\": {
\"key\": \"dotnet_agent_version\",
\"value\": \"${{ github.event.inputs.agent_version }}\"
}
}"
CONTENT_TYPE='Content-Type: application/json'
# STAGING
curl -X POST 'https://staging-api.newrelic.com/v2/system_configuration.json' \
-H "X-Api-Key:${{ secrets.NEW_RELIC_API_KEY_STAGING }}" -i \
-H "$CONTENT_TYPE" \
-d "$PAYLOAD"
# PRODUCTION
curl -X POST 'https://api.newrelic.com/v2/system_configuration.json' \
-H "X-Api-Key:${{ secrets.NEW_RELIC_API_KEY_PRODUCTION }}" -i \
-H "$CONTENT_TYPE" \
-d "$PAYLOAD"
# EU PRODUCTION
curl -X POST 'https://api.eu.newrelic.com/v2/system_configuration.json' \
-H "X-Api-Key:${{ secrets.NEW_RELIC_API_KEY_PRODUCTION }}" -i \
-H "$CONTENT_TYPE" \
-d "$PAYLOAD"

0 comments on commit bbdad76

Please sign in to comment.