forked from theia-ide/yangster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
33 lines (29 loc) · 1.07 KB
/
Jenkinsfile
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
// Tell Jenkins how to build projects from this repository
node {
try {
properties([
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '15']]
])
stage 'Checkout'
checkout scm
stage 'Build the YANGSTER app'
sh 'yarn config set workspaces-experimental true'
sh 'ls -la'
sh 'yarn'
if(env.BRANCH_NAME == 'master') {
stage 'Publish build results'
withCredentials([string(credentialsId: 'NPM_AUTH_TOKEN', variable: 'NPM_AUTH_TOKEN')]) {
sh "echo //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN > ~/.npmrc"
sh 'yarn publish:next'
}
}
if (currentBuild.result == 'UNSTABLE') {
slackSend color: 'warning', message: "Build Unstable - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
// } else {
// slackSend color: 'good', message: "Build Succeeded - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
} catch (e) {
slackSend color: 'danger', message: "Build Failed - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
throw e
}
}