Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ pipeline {
stages{
stage('git cloned'){
steps{
git url:'https://github.com/akshu20791/php-project/', branch: "master"
git url:'https://github.com/Yathishnagaraj/php-project/', branch: "master"

}
}
stage('Build docker image'){
steps{
script{
sh 'docker build -t akshu20791/akshatnewimg6july:v1 .'
sh 'docker build -t yathishnag/akshatnewimg6july:v1 .'
sh 'docker images'
}
}
Expand All @@ -19,7 +19,7 @@ pipeline {
steps {
withCredentials([usernamePassword(credentialsId: 'dockerhub-pwd', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh "echo $PASS | docker login -u $USER --password-stdin"
sh 'docker push akshu20791/akshatnewimg6july:v1'
sh 'docker push yathishnag/akshatnewimg6july:v1'
}
}
}
Expand All @@ -28,12 +28,12 @@ pipeline {
steps {
script {
def dockerrm = 'sudo docker rm -f My-first-containe2211 || true'
def dockerCmd = 'sudo docker run -itd --name My-first-containe2211 -p 8083:80 akshu20791/akshatnewimg6july:v1'
def dockerCmd = 'sudo docker run -itd --name My-first-containe2211 -p 8083:80 yathishnag/akshatnewimg6july:v1'
sshagent(['sshkeypair']) {
//chnage the private ip in below code
// sh "docker run -itd --name My-first-containe2111 -p 8083:80 akshu20791/2febimg:v1"
sh "ssh -o StrictHostKeyChecking=no ubuntu@172.31.17.188 ${dockerrm}"
sh "ssh -o StrictHostKeyChecking=no ubuntu@172.31.17.188 ${dockerCmd}"
sh "ssh -o StrictHostKeyChecking=no ubuntu@172.31.23.205 ${dockerrm}"
sh "ssh -o StrictHostKeyChecking=no ubuntu@172.31.23.205 ${dockerCmd}"
}
}
}
Expand Down