jenkins conf 39/50739/1
authorRHE <rebirthmonkey@gmail.com>
Wed, 17 Jan 2018 13:35:01 +0000 (14:35 +0100)
committerRHE <rebirthmonkey@gmail.com>
Wed, 17 Jan 2018 13:35:01 +0000 (14:35 +0100)
Change-Id: Ide859a78b8b4f05008106d9aca8f84eaeb0f538b
Signed-off-by: RHE <rebirthmonkey@gmail.com>
Jenkinsfile [new file with mode: 0644]
tools/moon_jenkins/Dockerfile
tools/moon_jenkins/Jenkinsfile [deleted file]
tools/moon_jenkins/docker-compose.yml
tools/moon_jenkins/plugins.txt
tools/moon_jenkins/setenv.groovy [deleted file]

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644 (file)
index 0000000..42756ec
--- /dev/null
@@ -0,0 +1,23 @@
+properties([
+    pipelineTriggers([cron('H * * * *')])
+])
+node {
+    checkout scm
+    def packages = ["python_moonutilities","python_moondb","python_moonclient"]
+    def subtests = [:]
+    for (x in packages) {
+        def pkg = x
+        subtests[pkg] = {
+            withDockerContainer('wukongsun/moon_python_unit_test') {
+            stage("Install prerequisites for package ${pkg}") {
+                sh("pip install pytest requests_mock requests --upgrade")
+                    sh("cd ${pkg} && pip install -r tests/unit_python/requirements.txt && pip install .")
+                }
+                stage("Unit test for package ${pkg}") {
+                    sh "cd ${pkg}/tests/unit_python && pytest ."
+                }
+            }
+        }
+    }
+    parallel subtests
+}
\ No newline at end of file
index 573d4ac..058f388 100644 (file)
@@ -3,7 +3,6 @@ FROM jenkinsci/blueocean
 ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
 
 COPY security.groovy /usr/share/jenkins/ref/init.groovy.d/security.groovy
-COPY setenv.groovy /usr/share/jenkins/ref/init.groovy.d/setenv.groovy
 
 COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
 RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
\ No newline at end of file
diff --git a/tools/moon_jenkins/Jenkinsfile b/tools/moon_jenkins/Jenkinsfile
deleted file mode 100644 (file)
index 7e0e07c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-pipeline {
-  agent {
-    docker {
-      image 'wukongsun/moon_python_unit_test'
-      args '-e moon_home=${moon_home}'
-    }
-  }
-  stages {
-    stage('Python Unit Test') {
-      steps {
-        script {
-          sh("cd ${moon_home}/tests/python_unit")
-          sh("bash run_tests")
-        }
-      }
-    }
-    stage('Functional Test') {
-      script {
-          sh("cd ${moon_home}/tests/functional")
-          sh("bash run_tests")
-      }
-    }
-  }
-}
\ No newline at end of file
index 2329f7b..eb9354c 100644 (file)
@@ -1,12 +1,10 @@
 version: '3.1'
 
 services:
-
   jenkins:
     build:
       context: .
-      args:
-    image: blueocean:v0.3
+    image: blueocean:v0.4
     ports:
       - 8080:8080
       - 50000:50000
@@ -19,4 +17,4 @@ services:
     user: root
 
 volumes:
-  jenkins-data:
+  jenkins-data:
\ No newline at end of file
index 2463d02..65bae87 100644 (file)
@@ -97,4 +97,4 @@ ssh-slaves
 pam-auth
 ldap
 email-ext
-locale
+locale
\ No newline at end of file
diff --git a/tools/moon_jenkins/setenv.groovy b/tools/moon_jenkins/setenv.groovy
deleted file mode 100644 (file)
index ab2dc13..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!groovy
-
-import jenkins.*
-import jenkins.model.*
-import hudson.*
-import hudson.model.*
-
-instance = Jenkins.getInstance()
-globalNodeProperties = instance.getGlobalNodeProperties()
-
-envVarsNodePropertyList = globalNodeProperties.getAll(hudson.slaves.EnvironmentVariablesNodeProperty.class)
-
-newEnvVarsNodeProperty = null
-envVars = null
-
-if (envVarsNodePropertyList == null || envVarsNodePropertyList.size() == 0) {
-    newEnvVarsNodeProperty = new hudson.slaves.EnvironmentVariablesNodeProperty();
-    globalNodeProperties.add(newEnvVarsNodeProperty)
-    envVars = newEnvVarsNodeProperty.getEnvVars()
-} else {
-    envVars = envVarsNodePropertyList.get(0).getEnvVars()
-}
-
-http_proxy = System.getenv()['http_proxy']
-https_proxy = System.getenv()['https_proxy']
-
-if (http_proxy) {
-  envVars.put("http_proxy", System.getenv()['http_proxy'])
-}
-if (https_proxy) {
-  envVars.put("https_proxy", System.getenv()['https_proxy'])
-}
-
-instance.save()