Ver código fonte

Added a jenkinsfile

Spencer Gardner 7 anos atrás
pai
commit
0cb27ddcb3
1 arquivos alterados com 31 adições e 0 exclusões
  1. 31 0
      jenkinsfile

+ 31 - 0
jenkinsfile

@@ -0,0 +1,31 @@
+// Powered by Infostretch 
+pipeline{
+    agent any
+    triggers {
+        pollSCM('H/15 * * * *')
+    }
+    stages{
+    	stage ('openvpn - Checkout') {
+    	    steps {
+     	        checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '', url: 'https://git.snppla.net/snppla/openvpn.git']]])
+    	    }
+    	}
+    	stage ('openvpn - Build') {
+    	    steps{
+     			// Shell build step
+                sh """ 
+                docker build . -t $DOCKER_REGISTRY/$DOCKER_USER/$JOB_NAME --pull
+                docker login $DOCKER_REGISTRY/$DOCKER_USER/$JOB_NAME -u $DOCKER_USER -p $DOCKER_PASSWORD
+                docker push docker.snppla.net/snppla/openvpn
+                """ 
+    	    }
+    	}
+    }
+    post {
+        failure  {
+            mail to: "${env.ALERT_EMAIL}",
+                 subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
+                 body: "Something is wrong with ${env.BUILD_URL}"
+        }
+    }
+}