From debfc1f81be70249cb09d274df317f101a949722 Mon Sep 17 00:00:00 2001 From: radek5 <34370575+radek5@users.noreply.github.com> Date: Mon, 18 May 2020 14:12:09 +0100 Subject: [PATCH] Delete Jenkinsfile --- Jenkinsfile | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index fc93cb178..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,41 +0,0 @@ -pipeline { - agent any - environment{ - DOCKER_TAG = getDockerTag() - NEXUS_URL = "172.31.34.232:8080" - IMAGE_URL_WITH_TAG = "${NEXUS_URL}/node-app:${DOCKER_TAG}" - } - stages{ - stage('Build Docker Image'){ - steps{ - sh "docker build . -t ${IMAGE_URL_WITH_TAG}" - } - } - stage('Nexus Push'){ - steps{ - withCredentials([string(credentialsId: 'nexus-pwd', variable: 'nexusPwd')]) { - sh "docker login -u admin -p ${nexusPwd} ${NEXUS_URL}" - sh "docker push ${IMAGE_URL_WITH_TAG}" - } - } - } - stage('Docker Deploy Dev'){ - steps{ - sshagent(['tomcat-dev']) { - withCredentials([string(credentialsId: 'nexus-pwd', variable: 'nexusPwd')]) { - sh "ssh ec2-user@172.31.0.38 docker login -u admin -p ${nexusPwd} ${NEXUS_URL}" - } - // Remove existing container, if container name does not exists still proceed with the build - sh script: "ssh ec2-user@172.31.0.38 docker rm -f nodeapp", returnStatus: true - - sh "ssh ec2-user@172.31.0.38 docker run -d -p 8080:8080 --name nodeapp ${IMAGE_URL_WITH_TAG}" - } - } - } - } -} - -def getDockerTag(){ - def tag = sh script: 'git rev-parse HEAD', returnStdout: true - return tag -}