This repository was archived by the owner on Jul 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdev.Jenkinsfile
More file actions
51 lines (48 loc) · 1.63 KB
/
dev.Jenkinsfile
File metadata and controls
51 lines (48 loc) · 1.63 KB
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
pipeline {
agent any
stages('Deploy') {
stage('Deliver') {
environment {
DATA = '/var/opex/dev-backup'
DB_BACKUP_USER = 'opex_backup'
DB_BACKUP_PASS = credentials("db-backup-secret-dev")
COMPOSE_PROJECT_NAME = 'dev-backup'
DEFAULT_NETWORK_NAME = 'dev-opex'
}
steps {
sh 'docker-compose up -d --build --remove-orphans'
sh 'docker image prune -f'
sh 'docker network prune -f'
}
}
}
post {
always {
echo 'One way or another, I have finished'
}
success {
echo ':)'
setBuildStatus(":)", "SUCCESS")
}
unstable {
echo ':/'
setBuildStatus(":/", "UNSTABLE")
}
failure {
echo ':('
setBuildStatus(":(", "FAILURE")
}
changed {
echo 'Things were different before...'
}
}
}
void setBuildStatus(String message, String state) {
step([
$class : "GitHubCommitStatusSetter",
reposSource : [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/opexdev/OPEX-Backup"],
contextSource : [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
errorHandlers : [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [$class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]]]
])
}