-
Notifications
You must be signed in to change notification settings - Fork 299
Expand file tree
/
Copy pathJenkinsfile
More file actions
30 lines (25 loc) · 726 Bytes
/
Jenkinsfile
File metadata and controls
30 lines (25 loc) · 726 Bytes
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
node {
stage('Checkout Source Code') {
checkout scm
}
stage('Create Docker Image') {
docker.build("docker_image:${env.BUILD_NUMBER}")
}
stage ('Run Application') {
try {
// Stop existing Container
sh 'docker rm docker_container -f'
// Start database container here
sh "docker run -d --name docker_container docker_image:${env.BUILD_NUMBER}"
}
catch (error) {
} finally {
// Stop and remove database container here
}
}
stage ('Notifications') {
mail body: "Project Execution Completed with status : " + currentBuild.result ,
subject: 'Project Execution Notification',
to: 'abc@abc.com'
}
}