forked from CleverCloud/clever-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
94 lines (93 loc) · 2.24 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
pipeline {
agent { label 'cc-ci-agent' }
environment {
GIT_TAG_NAME = gitTagName()
S3_KEY_ID = credentials('CELLAR_CC_TOOLS_ACCESS_KEY_ID')
S3_SECRET_KEY = credentials('CELLAR_CC_TOOLS_SECRET_ACCESS_KEY')
BINTRAY_API_KEY = credentials('BINTRAY_CC_TOOLS_API_KEY')
NPM_TOKEN = credentials('NPM_TOKEN')
}
stages {
stage('build') {
steps {
sh 'npm ci'
sh 'node scripts/job-build.js'
}
}
stage('package') {
steps {
sh 'node scripts/job-package.js'
}
}
stage('publish') {
when {
not {
environment name: 'GIT_TAG_NAME', value: ''
}
beforeAgent true
}
parallel {
stage('cellar') {
steps {
sh 'node scripts/job-publish-cellar.js'
}
}
stage('bintray') {
steps {
sh 'node scripts/job-publish-bintray.js'
}
}
stage('arch') {
steps {
script {
sshagent (credentials: ['CI_CLEVER_CLOUD_SSH_KEY']) {
sh 'node ./scripts/job-publish-arch.js'
}
}
}
}
stage('brew') {
steps {
script {
sshagent (credentials: ['CI_CLEVER_CLOUD_SSH_KEY']) {
sh 'node ./scripts/job-publish-brew.js'
}
}
}
}
stage('exherbo') {
steps {
script {
sshagent (credentials: ['CI_CLEVER_CLOUD_SSH_KEY']) {
sh 'node ./scripts/job-publish-exherbo.js'
}
}
}
}
stage('npm') {
steps {
sh 'node ./scripts/job-publish-npm.js'
}
}
stage('dockerhub') {
steps {
script {
sshagent (credentials: ['CI_CLEVER_CLOUD_SSH_KEY']) {
sh 'node ./scripts/job-publish-dockerhub.js'
}
}
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'releases/**/*', fingerprint: true
}
}
}
@NonCPS
String gitTagName() {
return sh(script: 'git describe --tags --exact-match $(git rev-parse HEAD) || true', returnStdout: true)?.trim()
}