forked from BalaMuragan92/example-voting-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
64 lines (64 loc) · 2.05 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
pipeline{
agent any
stages{
stage('Checkout SCM'){
steps{
git url: 'https://github.com/Karthikg99/example-voting-app.git'
}
}
stage('SonarQube analysis') {
steps {
script {
// requires SonarQube Scanner 2.8+
scannerHome = tool 'Vote-setup'
}
withSonarQubeEnv('Vote-setup') {
sh "${scannerHome}/bin/sonar-scanner \
-D sonar.login=admin \
-D sonar.password=gk99 \
-D sonar.projectKey=Vote-setup"
}
}
}
stage('Build Vote-app docker image and push'){
steps{
sh "docker build -t karthikg99/python-voter-app ./vote"
sh "docker login --username=karthikg99 --password=Krookedk@99"
sh "docker push karthikg99/python-voter-app"
}
}
stage('Build Node-Result docker image and push'){
steps{
sh "docker build -t karthikg99/node-result-app ./result"
sh "docker push karthikg99/node-result-app"
}
}
stage('Build Java-Worker docker image and push'){
steps{
sh "docker build -t karthikg99/java-worker-app ./worker"
sh "docker push karthikg99/java-worker-app"
}
}
stage('Ansible Docker installation'){
steps{
sh "ansible-playbook -i hosts azure_docker.yml"
sh "sleep 45"
}
}
stage('Ansible Minikube installation'){
steps{
sh "ansible-playbook -i hosts minikube.yml"
}
}
stage('Ansible Kubernetes Cluster deployment'){
steps{
sh "ansible-playbook -i hosts ansible-minikube.yml"
}
}
stage('Ansible Docker-compose Deployment'){
steps{
sh "ansible-playbook -i hosts ansible-docker-compose.yml"
}
}
}
}