forked from egovernments/egov-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
41 lines (33 loc) · 1.13 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
def app = "";
def commit_id="";
def module_name = "${env.JOB_NAME}".split("/")[-2];
def service_name = "${env.JOB_BASE_NAME}";
def path = "${module_name}/${service_name}"
def build_wkflo;
def ci_image = "egovio/ci:0.0.1"
def notifier = "";
try {
node("slave"){
checkout scm
sh "git rev-parse --short HEAD > .git/commit-id".trim()
commit_id = readFile('.git/commit-id')
code_builder = load("jenkins/code_builder.groovy")
archiver = load("jenkins/archiver.groovy")
image_builder = load("jenkins/image_builder.groovy")
notifier = load("jenkins/notifier.groovy")
deployer = load("jenkins/deployer.groovy")
code_builder.build(path, ci_image)
archiver.archiveArtifacts(["${path}/target/*.jar", "${path}/target/*.html"])
image_builder.build(module_name, service_name, commit_id)
image_builder.publish(service_name, commit_id)
image_builder.clean(service_name, commit_id)
}
// stage("Deploy to QA") {
// deployer.deploy(service_name, commit_id)
// }
} catch (e) {
node{
notifier.notifyBuild("FAILED")
throw e
}
}