-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
66 lines (63 loc) · 1.89 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
pipeline {
environment {
NPM_TOKEN = credentials("npm")
CRED = credentials("airship_www")
}
agent {
node {
label 'docker'
}
}
stages {
stage('Building') {
when {
anyOf {
branch 'master';
}
}
steps {
sh "docker build --pull=true -t geographica/airship_www ."
}
}
stage("Deploy") {
when {
anyOf {
branch 'master';
}
}
steps {
sh "docker run -i --rm -v \$(pwd)/dist:/usr/src/app/dist geographica/airship_www ng build --output-path dist/dist"
sh "docker run -i --rm -v \$(pwd)/dist:/usr/src/app/dist geographica/airship_www npm run doc"
sh "cp deploy_demo/s3_website.yml s3_website.yml"
sh "docker run --rm -i -v \$(pwd):/usr/src/app -e \"S3_WEBSITE_ID=${CRED_USR}\" -e \"S3_WEBSITE_SECRET=${CRED_PSW}\" geographica/s3_website cfg apply"
sh "docker run --rm -i -v \$(pwd):/usr/src/app -e \"S3_WEBSITE_ID=${CRED_USR}\" -e \"S3_WEBSITE_SECRET=${CRED_PSW}\" geographica/s3_website push"
sh "rm s3_website.yml"
}
post {
failure {
echo "Pipeline is done"
// notify users when the Pipeline fails
mail to: '[email protected]',
subject: "Failed Airship: ${currentBuild.fullDisplayName}",
body: "Something is wrong"
}
}
}
/*stage("publish") {
when {
anyOf {
branch 'master';
}
}
steps {
sh "docker run -i --rm -v \$(pwd)/airship:/usr/src/app/airship geographica/airship_www npm run build-airship"
sh "docker run --rm -i -v \$(pwd)/airship:/usr/src/app -v \$(pwd)/deploy_npm/.npmrc:/root/.npmrc -e \"NPM_TOKEN=${NPM_TOKEN}\" geographica/airship_www npm publish --access=public"
}
post {
failure {
echo "Pipeline is done"
}
}
}*/
}
}