forked from webex/react-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.jssdk
57 lines (51 loc) · 1.64 KB
/
Jenkinsfile.jssdk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!groovy
ansiColor('xterm') {
timestamps {
timeout(60) {
node('NODE_JS_BUILDER') {
stage('checkout') {
checkout scm
sh 'git config user.email [email protected]'
sh 'git config user.name Jenkins'
sshagent(['6c8a75fb-5e5f-4803-9b6d-1933a3111a34']) {
// return the exit code because we don't care about failures
sh script: 'git remote add upstream [email protected]:webex/react-ciscospark.git', returnStatus: true
sh 'git fetch upstream'
}
sh 'git checkout upstream/master'
sh 'git reset --hard && git clean -f'
}
stage('Install/Upgrade') {
withCredentials([
string(credentialsId: 'NPM_TOKEN', variable: 'NPM_TOKEN')
]) {
sh '''#!/bin/bash -ex
source ~/.nvm/nvm.sh
nvm install v8.9.1
nvm use v8.9.1
npm install
npm run upgradespark
'''
}
}
stage('Pushing') {
echo "Creating Branch"
def version
sh '''#!/bin/bash -ex
source ~/.nvm/nvm.sh
nvm use v8.9.1
version=$(node ./scripts/utils/jssdkversion.js)
echo $version > .version
git add package.json
git commit -m "chore: update @ciscospark packages to ${version}"
'''
version = readFile '.version'
sshagent(['6c8a75fb-5e5f-4803-9b6d-1933a3111a34']) {
sh "git push upstream HEAD:refs/heads/js-sdk/${version}"
}
archiveArtifacts artifacts: 'package.json'
}
}
}
}
}