-
Notifications
You must be signed in to change notification settings - Fork 2
/
n4jsd-publish.jenkinsfile
61 lines (55 loc) · 1.61 KB
/
n4jsd-publish.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 {
dockerfile {
filename 'Dockerfile'
dir '.'
label 'm5xlarge'
}
}
options {
ansiColor('xterm')
buildDiscarder(
logRotator(
numToKeepStr: '15',
artifactDaysToKeepStr: '30',
artifactNumToKeepStr: '15',
daysToKeepStr: '30'))
timeout(time: 2, unit: 'HOURS')
timestamps()
}
triggers {
cron ('H 5 * * *') // Publish every day a 5am GMT (extended nightly should be finished by then)
}
stages {
stage('fs browse') {
steps {
script {
sh """\
pwd
git status
ls -la
"""
}
}
}
stage('publish') {
steps {
// public token: npm-token-npmjs
// internal token: npm-token-n4ide1-nexus
withCredentials([string(credentialsId: 'npm-token-npmjs', variable: 'NPM_TOKEN')]) {
script {
// public registry: http://registry.npmjs.org/
// internal test nexus : http://n4ide1-nexus.service.cd-dev.consul/repository/npm-internal/
sh './publish.sh http://registry.npmjs.org/'
}
}
}
}
}
post {
cleanup {
echo 'cleaning up'
deleteDir()
}
}
}