--- /dev/null
+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
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
+++ /dev/null
-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
version: '3.1'
services:
-
jenkins:
build:
context: .
- args:
- image: blueocean:v0.3
+ image: blueocean:v0.4
ports:
- 8080:8080
- 50000:50000
user: root
volumes:
- jenkins-data:
+ jenkins-data:
\ No newline at end of file
pam-auth
ldap
email-ext
-locale
+locale
\ No newline at end of file
+++ /dev/null
-#!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()