forked from auth0/auth0-spa-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (57 loc) · 1.25 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
pipeline {
agent {
label 'crew-brucke'
}
tools {
nodejs '14.16.1'
}
options {
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage('SharedLibs') {
steps {
library identifier: 'auth0-jenkins-pipelines-library@master', retriever: modernSCM(
[$class: 'GitSCMSource',
remote: '[email protected]:auth0/auth0-jenkins-pipelines-library.git',
credentialsId: 'auth0extensions-ssh-key'])
}
}
stage('Build') {
steps {
sshagent(['auth0extensions-ssh-key']) {
sh 'npm ci'
sh 'npm run build'
}
}
}
stage('Test') {
steps {
script {
try {
sh 'npm run test'
githubNotify context: 'jenkinsfile/auth0/tests', description: 'Tests passed', status: 'SUCCESS'
} catch (error) {
githubNotify context: 'jenkinsfile/auth0/tests', description: 'Tests failed', status: 'FAILURE'
throw error
}
}
}
}
stage('Publish to CDN') {
when {
branch 'master'
}
steps {
sshagent(['auth0extensions-ssh-key']) {
sh 'npm run publish:cdn'
}
}
}
}
post {
cleanup {
deleteDir()
}
}
}