Created
August 4, 2017 09:08
-
-
Save spikeheap/5962b50154fe6757838150a23c84bb4e to your computer and use it in GitHub Desktop.
Faster dependencies for Docker NPM/Bundler (http://ryanbrooks.co.uk/posts/2016-04-28-docker-speedy-dependencies/)
This file contains hidden or 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
# Requires the following environment variables: | |
# | |
# - COMMIT_REF | |
# - GITHUB_OAUTH_TOKEN | |
source .env.docker | |
curl -s -H "Authorization: token $GITHUB_OAUTH_TOKEN" "https://api.github.com/repos/growkudos/growkudos/contents/Gemfile?ref=$COMMIT_REF" \ | |
| jq '.content' --raw-output \ | |
| base64 --decode \ | |
> Gemfile | |
curl -s -H "Authorization: token $GITHUB_OAUTH_TOKEN" "https://api.github.com/repos/growkudos/growkudos/contents/Gemfile.lock?ref=$COMMIT_REF" \ | |
| jq '.content' --raw-output \ | |
| base64 --decode \ | |
> Gemfile.lock | |
bundle install | |
# NPM | |
curl -s -H "Authorization: token $GITHUB_OAUTH_TOKEN" "https://api.github.com/repos/growkudos/growkudos/contents/package.json?ref=$COMMIT_REF" \ | |
| jq '.content' --raw-output \ | |
| base64 --decode \ | |
> package.json | |
npm install | |
# Bower packages, cached | |
curl -s -H "Authorization: token $GITHUB_OAUTH_TOKEN" "https://api.github.com/repos/growkudos/growkudos/contents/.bowerrc?ref=$COMMIT_REF" \ | |
| jq '.content' --raw-output \ | |
| base64 --decode \ | |
> .bowerrc | |
curl -s -H "Authorization: token $GITHUB_OAUTH_TOKEN" "https://api.github.com/repos/growkudos/growkudos/contents/bower.json?ref=$COMMIT_REF" \ | |
| jq '.content' --raw-output \ | |
| base64 --decode \ | |
> bower.json | |
./node_modules/.bin/bower install --allow-root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment