-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
60 lines (57 loc) · 1.92 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
void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/ait-aecid/attackmate"],
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 '-u root -v $PWD:/docs'
reuseNode true
}
}
when {
expression {
BRANCH_NAME == "main" || BRANCH_NAME == "development"
}
}
steps {
script {
docsimage = true
}
dir("docs") {
sh "id"
sh "ls -la /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/attackmate"
}
}
}
post {
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
failure {
setBuildStatus("Build failed", "FAILURE");
}
}
}