-
Notifications
You must be signed in to change notification settings - Fork 364
/
Jenkinsfile
61 lines (56 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
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
@Library('k8sAgents') agentLibrary
@Library('auth0') _
pipeline {
agent {
kubernetes {
yaml defaultAgent()
}
}
tools {
nodejs '14.16.1'
}
options {
timeout(time: 10, unit: 'MINUTES')
}
stages {
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 {
anyOf {
branch 'beta'
branch 'main'
}
}
steps {
sshagent(['auth0extensions-ssh-key']) {
sh 'npm run publish:cdn'
}
}
}
}
post {
cleanup {
deleteDir()
}
}
}