Created
April 28, 2016 11:13
-
-
Save hilkeheremans/5866ef2957eec9ccb010383077300aec to your computer and use it in GitHub Desktop.
Drone CI with nodejs, npm and private modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# drone.yml for node js CI with npm login | |
# Don't forget to configure DRONE_SERVER and DRONE_SERVER | |
# Now create a secrets.yml (OUTSIDE of your repo!!) (see other file) | |
# then run drone secure --repo <drone_repo_name> --in <path>/secrets.yml | |
build: | |
unit_tests: | |
image: risingstack/alpine:3.3-v4.2.6-1.1.3 | |
commands: | |
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN | |
- npm install | |
- npm run build | |
- npm run test | |
# the environment is transient so cleanup isn't really necessary | |
environment: | |
- NPM_TOKEN="$$NPM_TOKEN" | |
cache: | |
mount: | |
- node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set this to npm token in ~/.npmrc, can be revoked via npmjs.com later | |
# Do not commit this to any repo (duh) | |
environment: | |
NPM_TOKEN: <npm_token> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment