build: add credentials for the github builds repo

This commit is contained in:
Hans Larsen 2017-06-05 11:51:33 -07:00 committed by Hans
parent 398356503a
commit 9dfcdcecfd
2 changed files with 17 additions and 2 deletions

View File

@ -32,9 +32,14 @@ matrix:
- node_js: "6"
os: linux
env: NODE_SCRIPT="tests/run_e2e.js --eject --glob=tests/build/**"
# Deploy builds.
- node_js: "6"
os: linux
env: DEPLOY_SCRIPT="scripts/git-builds.js"
# GITHUB_TOKEN_ANGULAR=<github token, a personal access token of the angular-builds account, account access in valentine>
# This is needed for the e2e Travis matrix task to publish packages to github for continuous packages delivery.
secure: "aCdHveZuY8AT4Jr1JoJB4LxZsnGWRe/KseZh1YXYe5UtufFCtTVHvUcLn0j2aLBF0KpdyS+hWf0i4np9jthKu2xPKriefoPgCMpisYeC0MFkwbmv+XlgkUbgkgVZMGiVyX7DCYXVahxIoOUjVMEDCbNiHTIrfEuyq24U3ok2tHc="
# Optional builds.
- node_js: "6"
@ -66,5 +71,5 @@ before_install:
script:
- if [[ "$SCRIPT" ]]; then npm run-script $SCRIPT; fi
- if [[ "$NODE_SCRIPT" ]]; then node $NODE_SCRIPT; fi
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" && "$DEPLOY_SCRIPT" ]]; then node $DEPLOY_SCRIPT; fi
- if [[ "$NODE_SCRIPT" ]]; then node -e $NODE_SCRIPT; fi
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" && "$DEPLOY_SCRIPT" ]]; then node -e $DEPLOY_SCRIPT; fi

View File

@ -95,6 +95,11 @@ Promise.resolve()
.then(() => execute('git', './ngtools-webpack-builds', 'add', '-A'))
.then(() => getCommitMessage('./angular-cli'))
.then((message) => execute('git', './ngtools-webpack-builds', 'commit', '-am', message.substr(1)))
// Update the credentials using the GITHUB TOKEN.
.then(() => execute('git', './ngtools-webpack-builds', 'config', 'credential.helper',
'store --file=.git/credentials'))
.then(() => fs.appendFileSync('./ngtools-webpack-builds/.git/credentials',
`https://${process.env['GITHUB_TOKEN_ANGULAR']}:@github.com`))
.then(() => execute('git', './ngtools-webpack-builds', 'push'))
//---------------------------- cli-builds ----------------------------------//
.then(() => printMessage('Copying cli-builds dist....'))
@ -107,6 +112,11 @@ Promise.resolve()
.then(() => execute('git', './cli-builds', 'add', '-A'))
.then(() => getCommitMessage('./angular-cli'))
.then((message) => execute('git', './cli-builds', 'commit', '-am', message.substr(1)))
// Update the credentials using the GITHUB TOKEN.
.then(() => execute('git', './cli-builds', 'config', 'credential.helper',
'store --file=.git/credentials'))
.then(() => fs.appendFileSync('./cli-builds/.git/credentials',
`https://${process.env['GITHUB_TOKEN_ANGULAR']}:@github.com`))
.then(() => execute('git', './cli-builds', 'push'))
//---------------------------- done ----------------------------------------//
.then(() => console.log('Done...'))