aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuan HE <ruan.he@orange.com>2018-01-17 13:36:33 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-17 13:36:33 +0000
commitb0f7daa6f05a1ea2308e82cfc05a1b8d10d4e5dc (patch)
treea927654859b7a43830535825e6887b99a54683ff
parent5d4d84eefac0d8c836125c329220c678d1feb633 (diff)
parente475b83c1f711e77814d68f933ff2d661102806a (diff)
Merge "jenkins conf"
-rw-r--r--Jenkinsfile23
-rw-r--r--tools/moon_jenkins/Dockerfile1
-rw-r--r--tools/moon_jenkins/Jenkinsfile24
-rw-r--r--tools/moon_jenkins/docker-compose.yml6
-rw-r--r--tools/moon_jenkins/plugins.txt2
-rw-r--r--tools/moon_jenkins/setenv.groovy34
6 files changed, 26 insertions, 64 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 00000000..42756ece
--- /dev/null
+++ b/Jenkinsfile
@@ -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
diff --git a/tools/moon_jenkins/Dockerfile b/tools/moon_jenkins/Dockerfile
index 573d4ac8..058f388c 100644
--- a/tools/moon_jenkins/Dockerfile
+++ b/tools/moon_jenkins/Dockerfile
@@ -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
index 7e0e07c0..00000000
--- a/tools/moon_jenkins/Jenkinsfile
+++ /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
diff --git a/tools/moon_jenkins/docker-compose.yml b/tools/moon_jenkins/docker-compose.yml
index 2329f7bd..eb9354ce 100644
--- a/tools/moon_jenkins/docker-compose.yml
+++ b/tools/moon_jenkins/docker-compose.yml
@@ -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
diff --git a/tools/moon_jenkins/plugins.txt b/tools/moon_jenkins/plugins.txt
index 2463d029..65bae872 100644
--- a/tools/moon_jenkins/plugins.txt
+++ b/tools/moon_jenkins/plugins.txt
@@ -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
index ab2dc137..00000000
--- a/tools/moon_jenkins/setenv.groovy
+++ /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()