-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathJenkinsfile1
39 lines (32 loc) · 1.21 KB
/
Jenkinsfile1
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
pipeline {
agent any
tools {
maven 'maven-3.8.6'
}
stages {
stage('Checkout git') {
steps {
git 'https://github.com/praveensirvi1212/banking-finance-project.git'
}
}
stage ('Build & JUnit Test') {
steps {
sh 'mvn clean package'
}
}
stage ('Docker Build') {
steps {
withCredentials([usernamePassword(credentialsId: 'docker-cred', passwordVariable: 'password', usernameVariable: 'username')]) {
sh 'docker build -t praveensirvi/banking-finance:v1 .'
sh "docker login -u ${username} -p ${password} "
sh 'docker push praveensirvi/banking-finance:v1'
}
}
}
stage ('Configure test server and application deployment') {
steps {
ansiblePlaybook become: true, credentialsId: 'ssh-key', disableHostKeyChecking: true, installation: 'ansible', inventory: '/etc/ansible/hosts', playbook: 'configure-test-server.yml'
}
}
}
}