README
apollo-newrelic-ext
Provides an extension for Apollo server to integrate with New Relic agent
Installing & Configuring Drone CLI
Before you can publish a package to NPM you will need to first install the Drone CLI.
We are currently using version v0.8.6
to deploy our packages as it contains the drone deploy
command.
Downloading
First we need to download the specific version of the CLI we would like to use:
$ curl -L https://github.com/drone/drone-cli/releases/download/v0.8.6/drone_darwin_amd64.tar.gz | tar zx
Once the files have downloaded we will now copy it to our /bin folder so it can be used within the terminal:
$ sudo cp drone /usr/local/bin
If you now restart your terminal and run drone --help
the command should be available.
Configuring
Now we have the CLI installed we need to configure it to our Drone server.
In order to do this we need to find your server address and token:
- Navigate to https://drone.daznplatform.com/account/token
- Scroll to the heading Example CLI Usage
- Copy the content (example shown below)
export DRONE_SERVER=https://drone.daznplatform.com
export DRONE_TOKEN=123XYZABC
- You will now need to open one of the following files:
.bash_profile
,.bash_rc
or.zshrc
- At the bottom paste the content containing
DRONE_SERVER
andDRONE_TOKEN
- Save the file and restart your terminal to ensure the changes have taken effect
Publishing a package
Once you have made changes to a package, you will need to publish the updated package. To do this you need to:
- Ensure you have Drone CLI installed locally
- Merge your changes to master
- Find the drone build number of the merge into master (https://drone.daznplatform.com/getndazn/apollo-newrelic-ext)
- Run the following command to publish your updated package:
drone deploy getndazn/apollo-newrelic-ext [build-number] --param VERSION_BUMP_TYPE=[version-bump-type]
Example deploy command:
drone deploy getndazn/apollo-newrelic-ext 73 --param VERSION_BUMP_TYPE=patch
Once this command has been run, drone should commit back to this repo and update the version of the package you have published. If you need to publish multiple packages, make sure to use the new build number once drone has committed back to the repo.
You can view the NPM package links above to check your version has been published.