-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
42 lines (38 loc) · 1.12 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
pipeline {
agent any
environment {
HOME = "${env.WORKSPACE}"
DOCKER_REGISTRY = 'docker.chameleoncloud.org'
DOCKER_REGISTRY_CREDS = credentials('kolla-docker-registry-creds')
}
stages {
stage('docker-setup') {
steps {
sh 'docker login --username=$DOCKER_REGISTRY_CREDS_USR --password=$DOCKER_REGISTRY_CREDS_PSW $DOCKER_REGISTRY'
}
}
stage('build-and-publish') {
steps {
sh 'make build'
sh 'make publish'
}
}
}
post {
always {
sh 'docker logout $DOCKER_REGISTRY'
}
success {
slackSend(
channel: "#notifications",
message: "*Build* of *hammers* (${env.GIT_COMMIT.substring(0, 8)}) completed successfuly. <${env.RUN_DISPLAY_URL}|View build log>",
color: "good"
)
// Trigger deploy to development environments
build job: 'ansible-playbook', wait: false, parameters: [
string(name: 'PLAYBOOK_NAME', value: 'hammers'),
string(name: 'JENKINS_AGENT_LABEL', value: 'ansible-uc-dev')
]
}
}
}