-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
58 lines (55 loc) · 1.84 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
void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/ait-aecid/attackbed"],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}
def docsimage = false
pipeline {
agent any
stages {
stage("Build Documentation") {
agent {
dockerfile {
dir 'docs'
args '-v $PWD:/docs'
reuseNode true
}
}
when {
expression {
BRANCH_NAME == "main" || BRANCH_NAME == "development"
}
}
steps {
script {
docsimage = true
}
dir("docs") {
sh "make html"
}
}
}
stage("Deploy Docs") {
when {
expression {
BRANCH_NAME == "main" || BRANCH_NAME == "development"
}
}
steps {
sh "scripts/deploydocs.sh ${env.BRANCH_NAME} docs/build/html /var/www/aeciddocs/attackbed"
}
}
}
post {
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
failure {
setBuildStatus("Build failed", "FAILURE");
}
}
}