-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
48 lines (46 loc) · 1.44 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
void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/ODEX-TOS/tos-homepage"],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}
pipeline {
agent {
docker {
image 'jojomi/hugo:latest'
args '-v tos_work:/output'
}
}
stages {
stage('clone') {
steps{
git 'https://github.com/ODEX-TOS/tos-homepage.git'
}
}
stage('Build') {
steps {
sh 'cd src && hugo --destination="/output"'
}
}
stage('copy over pandoc') {
steps {
sh 'mkdir -p /output/docs/'
sh 'cd src && cp -r public/docs/doc/* /output/docs/'
}
}
}
post {
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
unstable {
setBuildStatus("Build is unstable", "UNSTABLE");
}
failure {
setBuildStatus("Build failed", "FAILED");
}
}
}