File tree Expand file tree Collapse file tree 6 files changed +94
-0
lines changed Expand file tree Collapse file tree 6 files changed +94
-0
lines changed Original file line number Diff line number Diff line change
1
+ * .md
2
+ .gitignore
Original file line number Diff line number Diff line change
1
+ .DS_Store
Original file line number Diff line number Diff line change
1
+ FROM newrelic/cli:latest
2
+
3
+ # Copies your code file from your action repository to the filesystem path `/` of the container
4
+ # COPY entrypoint.sh /entrypoint.sh
5
+ COPY entrypoint.sh /entrypoint.sh
6
+
7
+ # Code file to execute when the docker container starts up (`entrypoint.sh`)
8
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ # New Relic Application Deployment Marker
2
+ New Relic App Deployment Marker
3
+
4
+ [ ![ GitHub Marketplace version] ( https://img.shields.io/github/release/newrelic/deployment-marker-action.svg?label=Marketplace&logo=github )] ( https://github.com/marketplace/actions/new-relic-application-deployment-marker )
5
+
6
+ A GitHub Action to add New Relic deployment markers during your release pipeline.
7
+
8
+ ## Inputs
9
+
10
+ | Key | | Description |
11
+ | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
12
+ | ` api_key ` | required | Your New Relic [ personal API key] ( https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key ) . |
13
+ | ` applicationId ` | required | The New Relic application ID to apply the deployment marker. |
14
+ | ` region ` | optional | The region of your New Relic account. Default: "US" |
15
+ | ` revision ` | optional | Metadata to apply to the deployment marker - e.g. the latest release tag |
16
+ | ` accountId ` | optional | The account number the application falls under. This could also be a subaccount. |
17
+
18
+ ## Example usage
19
+
20
+ ``` yaml
21
+ # Add a New Relic application deployment marker on release
22
+ on :
23
+ - release
24
+
25
+ jobs :
26
+ release :
27
+ runs-on : ubuntu-latest
28
+ steps :
29
+ - name : Apply New Relic deployment marker
30
+ uses : sanderblue/newrelic-deployment-marker@master
31
+ with :
32
+ api_key : ${{ secrets.NEW_RELIC_API_KEY }}
33
+ applicationId : <your application ID>
34
+ revision : ${{ github.ref }}-${{ github.sha }} # optional
35
+ region : US # optional
36
+ accountId : <your New Relic account ID> # optional
37
+ ` ` `
Original file line number Diff line number Diff line change
1
+ name : ' New Relic Application Deployment Marker'
2
+ author : ' New Relic'
3
+ description : ' Apply a New Relic application deployment marker to an application that is monitored by New Relic.'
4
+ branding :
5
+ icon : ' upload-cloud'
6
+ color : ' blue'
7
+ inputs :
8
+ api_key :
9
+ description : ' Your New Relic Personal API Key.'
10
+ required : true
11
+ region :
12
+ description : ' The geographical region for your New Relic account - US or EU. Default: US'
13
+ required : false
14
+ default : US
15
+ applicationId :
16
+ description : ' The application ID to apply the deployment marker.'
17
+ required : true
18
+ revision :
19
+ description : ' Custom revision information to add to the deployment marker - e.g. the latest tag.'
20
+ required : false
21
+ accountId :
22
+ description : ' Your New Relic account ID. This account ID should have access to the specified application.'
23
+ required : false
24
+ runs :
25
+ using : ' docker'
26
+ image : ' Dockerfile'
27
+ env :
28
+ NEW_RELIC_API_KEY : ${{ inputs.api_key }}
29
+ NEW_RELIC_REGION : ${{ inputs.region }}
30
+ APPLICATION_ID : ${{ inputs.applicationId }}
31
+ REVISION : ${{ inputs.revision }}
32
+ ACCOUNT_ID : ${{ inputs.accountId }}
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ RED=' \033[0;31m'
4
+ NO_COLOR=' \033[0m'
5
+
6
+ result=$( newrelic apm deployment create --applicationId " ${APPLICATION_ID} " --revision " ${REVISION} " 2>&1 )
7
+
8
+ exitStatus=$?
9
+
10
+ if [ $exitStatus -ne 0 ]; then
11
+ printf " ${RED} Error:${NO_COLOR} $result "
12
+ fi
13
+
14
+ exit $exitStatus
You can’t perform that action at this time.
0 commit comments