-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
22 lines (17 loc) · 802 Bytes
/
Jenkinsfile
File metadata and controls
22 lines (17 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
node{
stage('code checkout'){
git credentialsId: 'GitHubToken', url: 'https://github.com/ChandanTeekinavar/php-registration-form.git'
}
stage ('containerize'){
sh 'docker build -t chandanteekinavar/php-registration-form:1.0 .'
}
stage('push to dockerhub'){
withCredentials([string(credentialsId: 'DockerHubPassword', variable: 'DockerHubPassword')]) {
sh "docker login -u chandanteekinavar -p ${DockerHubPassword}"
sh 'docker push chandanteekinavar/php-registration-form:1.0'
}
}
stage('deploy'){
ansiblePlaybook become: true, credentialsId: 'demo-key.pem', disableHostKeyChecking: true, installation: 'Ansible', inventory: '/etc/ansible/hosts', playbook: 'playbook.yml', vaultTmpPath: ''
}
}