File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1010 "build-client" : " webpack" ,
1111 "build-client-watch" : " webpack -w" ,
1212 "deploy" : " script/deploy" ,
13+ "heroku-token" : " script/encrypt-heroku-auth-token" ,
1314 "lint" : " eslint ./ --ignore-path .gitignore" ,
1415 "lint-fix" : " npm run lint -- --fix" ,
1516 "precommit" : " # lint-staged # un-comment to enable" ,
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ function cleanup_at_exit {
6+ # remove temporary key file
7+ rm tmp.pem
8+ }
9+
10+ trap cleanup_at_exit EXIT
11+
12+ # Get the repo name from the `origin` git remote.
13+ export REPO=$( git remote get-url origin | \
14+ sed ' s/^.*[\/:]\([^\/:]*\)\/\([^\/]*\)$/\1\/\2/' | \
15+ sed ' s/^\(.*\)\.git$/\1/'
16+ )
17+
18+ # Get the Travis public key for this repo.
19+ export TRAVIS_KEY=$( curl --silent https://api.travis-ci.org/repos/$REPO /key)
20+
21+ # Save the key to a file.
22+ node -e " console.log($TRAVIS_KEY ['key'])" > tmp.pem
23+
24+ # Generate a Heroku token, encrypt and encode it and print it in YAML.
25+ echo -n $( heroku auth:token) | \
26+ openssl rsautl -encrypt -pubin -inkey tmp.pem | \
27+ base64 | awk ' {print " secure: "$1}'
You can’t perform that action at this time.
0 commit comments