-
Notifications
You must be signed in to change notification settings - Fork 2
/
jenkinsfile
32 lines (29 loc) · 854 Bytes
/
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
pipeline {
agent any
stages {
stage('Build') {
steps {
sh '''
rm -rf devops
git clone https://github.com/harshavardhanc/devops.git
chmod 755 devops/ansible/install_ansible.sh && ./devops/ansible/install_ansible.sh
export ANSIBLE_HOST_KEY_CHECKING=false && ansible-playbook -i devops/ansible/inventory/hosts devops/ansible/main.yml
'''
}
}
stage('Test') {
steps {
sh '(cd devops/maven && mvn clean install)'
sh '(cp devops/maven/target/maven.war devops/docker/maven.war)'
}
}
stage('Deploy') {
steps {
sh '''
chmod 755 devops/docker/install_docker.sh && ./devops/docker/install_docker.sh
cd devops/docker/ && sudo docker build -t app1 .
'''
}
}
}
}