Skip to content

Commit d02363c

Browse files
hanslfilipesilva
authored andcommitted
build: add credentials for the github builds repo
1 parent d51155e commit d02363c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ matrix:
3232
- node_js: "6"
3333
os: linux
3434
env: NODE_SCRIPT="tests/run_e2e.js --eject --glob=tests/build/**"
35+
36+
# Deploy builds.
3537
- node_js: "6"
3638
os: linux
3739
env: DEPLOY_SCRIPT="scripts/git-builds.js"
40+
# GITHUB_TOKEN_ANGULAR=<github token, a personal access token of the angular-builds account, account access in valentine>
41+
# This is needed for the e2e Travis matrix task to publish packages to github for continuous packages delivery.
42+
secure: "aCdHveZuY8AT4Jr1JoJB4LxZsnGWRe/KseZh1YXYe5UtufFCtTVHvUcLn0j2aLBF0KpdyS+hWf0i4np9jthKu2xPKriefoPgCMpisYeC0MFkwbmv+XlgkUbgkgVZMGiVyX7DCYXVahxIoOUjVMEDCbNiHTIrfEuyq24U3ok2tHc="
3843

3944
# Optional builds.
4045
- node_js: "6"
@@ -66,5 +71,5 @@ before_install:
6671

6772
script:
6873
- if [[ "$SCRIPT" ]]; then npm run-script $SCRIPT; fi
69-
- if [[ "$NODE_SCRIPT" ]]; then node $NODE_SCRIPT; fi
70-
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" && "$DEPLOY_SCRIPT" ]]; then node $DEPLOY_SCRIPT; fi
74+
- if [[ "$NODE_SCRIPT" ]]; then node -e $NODE_SCRIPT; fi
75+
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" && "$DEPLOY_SCRIPT" ]]; then node -e $DEPLOY_SCRIPT; fi

scripts/git-builds.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ Promise.resolve()
9595
.then(() => execute('git', './ngtools-webpack-builds', 'add', '-A'))
9696
.then(() => getCommitMessage('./angular-cli'))
9797
.then((message) => execute('git', './ngtools-webpack-builds', 'commit', '-am', message.substr(1)))
98+
// Update the credentials using the GITHUB TOKEN.
99+
.then(() => execute('git', './ngtools-webpack-builds', 'config', 'credential.helper',
100+
'store --file=.git/credentials'))
101+
.then(() => fs.appendFileSync('./ngtools-webpack-builds/.git/credentials',
102+
`https://${process.env['GITHUB_TOKEN_ANGULAR']}:@github.com`))
98103
.then(() => execute('git', './ngtools-webpack-builds', 'push'))
99104
//---------------------------- cli-builds ----------------------------------//
100105
.then(() => printMessage('Copying cli-builds dist....'))
@@ -107,6 +112,11 @@ Promise.resolve()
107112
.then(() => execute('git', './cli-builds', 'add', '-A'))
108113
.then(() => getCommitMessage('./angular-cli'))
109114
.then((message) => execute('git', './cli-builds', 'commit', '-am', message.substr(1)))
115+
// Update the credentials using the GITHUB TOKEN.
116+
.then(() => execute('git', './cli-builds', 'config', 'credential.helper',
117+
'store --file=.git/credentials'))
118+
.then(() => fs.appendFileSync('./cli-builds/.git/credentials',
119+
`https://${process.env['GITHUB_TOKEN_ANGULAR']}:@github.com`))
110120
.then(() => execute('git', './cli-builds', 'push'))
111121
//---------------------------- done ----------------------------------------//
112122
.then(() => console.log('Done...'))

0 commit comments

Comments
 (0)