This repository has been archived by the owner on Jan 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
74 lines (74 loc) · 1.91 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
pipeline {
agent none
environment {
CI = 'false'
RANCHER_TOKEN = credentials('rancher-bearer-token')
JENKINS_PASSWORD = credentials('wnz99-jenkins-user-password')
NPM_TOKEN = credentials('npm-token')
}
stages {
stage('Init') {
agent {
docker {
image 'node:8'
args '-p 3000:3000'
}
}
steps {
sh 'echo //registry.npmjs.org/:_authToken=\\${NPM_TOKEN} > ~/.npmrc'
sh 'yarn install --frozen-lockfile'
}
}
stage('Test') {
agent {
docker {
image 'node:8'
args '-p 3000:3000'
}
}
steps {
sh 'yarn test'
}
}
stage('Build') {
agent {
docker {
image 'node:8'
}
}
steps {
sh './scripts/build-beta-dev-jenkins.sh'
}
}
stage('Deploy') {
agent { label 'master' }
steps {
sh './scripts/deploy-webapp-docker-jenkins.sh'
}
}
stage('Clean Up') {
agent { label 'master' }
steps {
sh 'rm -rf rancher-v2.0.3-rc1/'
}
}
}
// post {
// always {
// echo 'One way or another, I have finished'
// }
// success {
// echo 'I succeeeded!'
// }
// unstable {
// echo 'I am unstable :/'
// }
// failure {
// echo 'I failed :('
// sh 'docker rmi $(docker images | grep "^<none>" | awk '{print $3}')'
// }
// changed {
// echo 'Things were different before...'
// }
// }
}