forked from galasa-dev-archives/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.docs
76 lines (71 loc) · 1.95 KB
/
Jenkinsfile.docs
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
pipeline {
// Initially run on any agent
agent {
label 'docker-amd64'
}
options { timestamps () }
environment {
//Set some defaults
def workspace = pwd()
}
stages {
// for debugging purposes
stage('report') {
steps {
echo "Branch/Tag : ${env.GIT_BRANCH}"
echo "Commit Hash : ${env.GIT_COMMIT}"
echo "Workspace directory : ${workspace}"
}
}
stage('Clone Docs') {
steps {
dir('galasa.dev') {
deleteDir()
}
sh 'mkdir galasa.dev'
dir('galasa.dev') {
git(url: 'https://github.com/galasa-dev/galasa.dev.git', branch: "master")
}
}
}
stage('Build Docs') {
steps {
dir('galasa.dev') {
sh "npm install"
dir('public') {
deleteDir()
}
sh "npm run build"
}
}
}
stage('Build Docker Image') {
steps {
withFolderProperties {
dir('docker/docs') {
dir('public') {
deleteDir()
}
sh "cp -R ../../galasa.dev/public ."
sh "docker build -t ${env.DOCKER_REPO}/galasa-docs-generic:${env.DOCKER_VERSION} ."
}
}
}
}
stage('Push Docker Image') {
steps {
withFolderProperties {
dir('docker/docs') {
sh "docker push ${env.DOCKER_REPO}/galasa-docs-generic:${env.DOCKER_VERSION}"
}
}
}
}
}
// post {
// // triggered when red sign
// failure {
// slackSend (channel: '#project-galasa-devs', color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
// }
// }
}