diff --git a/Dockerfile b/Dockerfile index 6534375..e198b36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,6 @@ RUN apt update RUN apt install git -y RUN rm -rf /var/lib/apt/lists/* RUN rm -rf /usr/local/apache2/htdocs/* -RUN git clone https://github.com/akshu20791/apachewebsite/ /usr/local/apache2/htdocs/ +RUN git clone https://github.com/coshik/apachewebsite/ /usr/local/apache2/htdocs/ EXPOSE 80 CMD ["httpd-foreground"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..91d9c09 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,42 @@ +pipeline { + agent any + stages{ + stage('git cloned'){ + steps{ + git url:'https://github.com/coshik/apachewebsite/', branch: "master" + + } + } + stage('Build docker image'){ + steps{ + script{ + sh 'docker build -t coshik/akshatnewimg6july:v1 .' + sh 'docker images' + } + } + } + stage('Docker login') { + steps { + withCredentials([usernamePassword(credentialsId: 'dockerhub-pwd', passwordVariable: 'PASS', usernameVariable: 'USER')]) { + sh "echo $PASS | docker login -u $USER --password-stdin" + sh 'docker push coshik/akshatnewimg6july:v1' + } + } + } + + stage('Deploy') { + 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 coshik/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.13.249 ${dockerrm}" + sh "ssh -o StrictHostKeyChecking=no ubuntu@172.31.13.249 ${dockerCmd}" + } + } + } + } + } +} diff --git a/index.html b/index.html index 16c6d71..bd6abdb 100644 --- a/index.html +++ b/index.html @@ -454,10 +454,10 @@
Copyright 2019 All Right Reserved By Free html Templates
+Copyright 2025 All Right Reserved By Your Mom