forked from vistasunil/devopsIQ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_sel
42 lines (42 loc) · 1.03 KB
/
Jenkinsfile_sel
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 {
node {
label 'slave2'
}
}
stages {
stage('SCM checkout'){
steps {
git "https://github.com/vistasunil/devopsIQ.git"
}
}
stage('Build docker Image'){
steps {
sh "sudo docker build /home/ubuntu/jenkins/workspace/seljob -t vistasunil/devopsdemo"
}
}
stage('Remove existing website'){
steps {
sh "if [ `sudo docker ps -a -q|wc -l` -gt 0 ]; then sudo docker rm -f \$(sudo docker ps -a -q);fi"
}
}
stage('Deploy website'){
steps {
sh "sudo docker run -d -p 82:80 --name mywebsite vistasunil/devopsdemo"
}
}
stage ('SCM checkout Selenium'){
steps {
git "https://github.com/vistasunil/selenium.git"
}
}
stage ('Test Website'){
steps {
sh "mvn clean install"
dir("target") {
sh "java -jar SeleniumTest-0.0.1-SNAPSHOT.jar"
}
}
}
}
}