Skip to content

Commit

Permalink
fix: referencing NR_LICENSE_KEY correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
devfreddy committed Nov 13, 2020
1 parent b3ae2b6 commit fb52d85
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Deliver a consistent user experience, open source ecosystem, and platform servic

in 5 minutes or less.

## Authoring a recipe

### Common variables

The [newrelic-cli] injects at runtime of a go-task the following variables:

- `{{.NR_LICENSE_KEY}}` populated by the key associated with the profile run with the cli

## Testing

The testing of recipes is automated, and those are tested on a freshly provisioned environment and re-provisioned on every test run.
Expand Down
6 changes: 0 additions & 6 deletions examples/sample-linux-infrastructure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ install:

version: "3"

env:
NR_LICENSE_KEY: "{{.NR_LICENSE_KEY}}"

variables:
- FOO_VAR: foo-value

tasks:
install:
cmds:
Expand Down
8 changes: 1 addition & 7 deletions recipes/newrelic/infra-agent/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ install:

version: "3"

env:
NR_LICENSE_KEY: "{{.NR_LICENSE_KEY}}"

variables:
- FOO_VAR: foo-value

tasks:
default:
cmds:
Expand All @@ -57,7 +51,7 @@ install:

setup_license:
cmds:
- echo "license_key: $NR_LICENSE_KEY" | sudo tee -a /etc/newrelic-infra.yml
- 'echo "license_key: {{.NR_LICENSE_KEY}}" | sudo tee -a /etc/newrelic-infra.yml'

install_infra:
cmds:
Expand Down
5 changes: 2 additions & 3 deletions recipes/newrelic/node-agent/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ install:
version: "3"

env:
NR_LICENSE_KEY: "{{.NR_LICENSE_KEY}}"
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED: true

tasks:
Expand All @@ -63,7 +62,7 @@ install:
echo "Enter a name for your application and press [ENTER]:"
read appname
echo ""
if [ -z "$NR_LICENSE_KEY" ]; then
if [ -z "{{.NR_LICENSE_KEY}}" ]; then
echo "Please provide a license key and press [ENTER]:"
read NR_LICENSE_KEY
echo ""
Expand All @@ -84,7 +83,7 @@ install:
/**
* Your New Relic license key.
*/
license_key: '$NR_LICENSE_KEY',
license_key: '{{.NR_LICENSE_KEY}}',
/**
* This setting controls distributed tracing.
* Distributed tracing lets you see the path that a request takes through your
Expand Down

0 comments on commit fb52d85

Please sign in to comment.