-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
47 lines (41 loc) · 1.37 KB
/
Jenkinsfile
File metadata and controls
47 lines (41 loc) · 1.37 KB
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
pipeline {
agent any
tools {
nodejs 'Node 10.13.0'
}
environment {
NPM_TOKEN = credentials('acamica-npm-token')
REGISTRY = credentials('acamica-registry-password')
CI = '1' // semantic release need this environment
}
stages {
stage('Install dependencies') {
steps {
sh "echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc"
sh 'npm whoami'
sh 'npm doctor'
sh 'npm ci'
sh 'rm .npmrc'
}
}
stage('Build NPM Package') {
steps {
sh "echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc"
script { try {
sh './npm-push.sh'
} catch (err) {
echo "el paquete no se pudo publicar, verificar si ya existe"
} }
sh 'rm .npmrc'
}
}
}
post {
success {
slackSend channel: env.SLACK_SUCC_CHANNEL, color: 'good', message: "Build finished successfully : ${env.JOB_NAME} - ${env.BUILD_NUMBER} (<${env.JOB_URL}|Open>)"
}
failure {
slackSend channel: env.SLACK_ERR_CHANNEL, color: '#FF0000', message: "Build failed: ${env.JOB_NAME} - ${env.BUILD_NUMBER} (<${env.JOB_URL}|Open>)"
}
}
}