forked from galasa-dev-archives/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.offline
58 lines (54 loc) · 1.74 KB
/
Jenkinsfile.offline
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
pipeline {
// Initially run on any agent
agent {
label 'docker-amd64'
}
options { timestamps () }
environment {
//Set some defaults
def workspace = pwd()
}
stages {
// for debugging purposes
stage('report') {
steps {
echo "Branch/Tag : ${env.GIT_BRANCH}"
echo "Commit Hash : ${env.GIT_COMMIT}"
echo "Workspace directory : ${workspace}"
}
}
stage('Pull Docker Images') {
steps {
withFolderProperties {
sh "docker pull ${env.DOCKER_REPO}/galasa-docs-generic:${env.DOCKER_VERSION}"
sh "docker pull ${env.DOCKER_REPO}/galasa-offline-maven-generic:${env.DOCKER_VERSION}"
sh "docker pull ${env.DOCKER_REPO}/galasa-p2-amd64:${env.DOCKER_VERSION}"
}
}
}
stage('Build Docker Image') {
steps {
withFolderProperties {
dir('docker/offline') {
sh "docker build --build-arg dockerVersion=${env.DOCKER_VERSION} --build-arg dockerRepository=${env.DOCKER_REPO} -t ${env.DOCKER_REPO}/galasa-offline:${env.DOCKER_VERSION} ."
}
}
}
}
stage('Push Docker Image') {
steps {
withFolderProperties {
dir('docker/offline') {
sh "docker push ${env.DOCKER_REPO}/galasa-offline:${env.DOCKER_VERSION}"
}
}
}
}
}
// post {
// // triggered when red sign
// failure {
// slackSend (channel: '#project-galasa-devs', color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
// }
// }
}