forked from yuannaiyou/cosmos-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
51 lines (45 loc) · 1.08 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
pipeline {
agent {
label 'crew-brokkr'
}
tools {
nodejs '16.13.0'
}
environment {
NPM_TOKEN = credentials('auth0npm-npm-token')
}
options {
timeout(time: 10, unit: 'MINUTES')
}
parameters {
string(name: 'SlackTarget', defaultValue: '#design-system-int', description: 'Target Slack Channel for notifications')
}
stages {
stage('SharedLibs') { // Required. Stage to load the Auth0 shared library for Jenkinsfile
steps {
library identifier: 'auth0-jenkins-pipelines-library@master', retriever: modernSCM(
[$class: 'GitSCMSource',
remote: 'git@github.com:auth0/auth0-jenkins-pipelines-library.git',
credentialsId: 'auth0extensions-ssh-key'])
}
}
stage('Build') {
steps {
sh 'yarn install'
sh 'yarn build'
}
}
stage('Publish') {
steps {
sh "echo //registry.npmjs.org/:_authToken=${env.NPM_TOKEN} > .npmrc"
sh "npm run scripts deploy"
}
}
}
post {
always {
notifySlack(params.SlackTarget);
deleteDir()
}
}
}