From 474e5eee246f620ce9bac5bb8ed3d067aad59eab Mon Sep 17 00:00:00 2001 From: Frank Greguska Date: Tue, 27 Mar 2018 16:05:05 -0700 Subject: [PATCH 1/7] trying jenkins build. --- jenkins/Jenkinsfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 jenkins/Jenkinsfile diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile new file mode 100644 index 0000000..17210df --- /dev/null +++ b/jenkins/Jenkinsfile @@ -0,0 +1,37 @@ +#!groovy + + +pipeline{ + agent { + docker { + image 'continuumio/miniconda3:latest' + } + } + + parameters { + string(defaultValue: false, description: 'Branch of the incubator-sdap-nexusproto project to build against. Leave blank to use version from pip specified in requirements (this does not currently work).', name: 'buildNexusprotoBranch') + } + + stages{ + stage("Install nexusproto From Source"){ + when{ + expression { false != params.buildNexusprotoBranch } + } + steps{ + git branch: "${params.buildNexusprotoBranch}", credentialsId: 'fgreg-github', url: 'https://github.com/apache/incubator-sdap-nexusproto' + sh './gradlew clean build pythonInstall' + } + } + stage("Build"){ + steps{ + git branch: "${env.BRANCH_NAME}", credentialsId: 'fgreg-github', url: 'https://github.com/apache/incubator-sdap-ningesterpy' + sh 'python setup.py sdist' + } + } + } + post { + always { + archiveArtifacts artifacts: 'dist/*.tar.gz', fingerprint: true, onlyIfSuccessful: true + } + } +} \ No newline at end of file From 0fa3c205da510c464a6fb48cad4be95fce8b267c Mon Sep 17 00:00:00 2001 From: Frank Greguska Date: Tue, 27 Mar 2018 16:10:42 -0700 Subject: [PATCH 2/7] different default. --- jenkins/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 17210df..60901da 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -9,13 +9,13 @@ pipeline{ } parameters { - string(defaultValue: false, description: 'Branch of the incubator-sdap-nexusproto project to build against. Leave blank to use version from pip specified in requirements (this does not currently work).', name: 'buildNexusprotoBranch') + string(defaultValue: '', description: 'Branch of the incubator-sdap-nexusproto project to build against. Leave blank to use version from pip specified in requirements (this does not currently work).', name: 'buildNexusprotoBranch') } stages{ stage("Install nexusproto From Source"){ when{ - expression { false != params.buildNexusprotoBranch } + expression { return params.buildNexusprotoBranch ==~ /SDAP-\d+/ } } steps{ git branch: "${params.buildNexusprotoBranch}", credentialsId: 'fgreg-github', url: 'https://github.com/apache/incubator-sdap-nexusproto' From 966b7fb737ca913a8c69c80d3e2fc9b53c08cfe4 Mon Sep 17 00:00:00 2001 From: Frank Greguska Date: Tue, 27 Mar 2018 16:15:39 -0700 Subject: [PATCH 3/7] different default. --- jenkins/Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 60901da..ddb7bef 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -5,6 +5,7 @@ pipeline{ agent { docker { image 'continuumio/miniconda3:latest' + args '-v $HOME/.conda:/.conda/pkgs' } } From 74813eac59388d3b92983335070871b0bf37f41b Mon Sep 17 00:00:00 2001 From: Frank Greguska Date: Tue, 27 Mar 2018 16:37:02 -0700 Subject: [PATCH 4/7] trying different docker images --- jenkins/Jenkinsfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index ddb7bef..7fc5806 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -14,17 +14,26 @@ pipeline{ } stages{ - stage("Install nexusproto From Source"){ + stage("Build nexusproto From Source"){ + agent { + docker { + image 'maven:3-jdk-8' + args '-v $HOME/.m2:/root/.m2' + } + } when{ expression { return params.buildNexusprotoBranch ==~ /SDAP-\d+/ } } steps{ git branch: "${params.buildNexusprotoBranch}", credentialsId: 'fgreg-github', url: 'https://github.com/apache/incubator-sdap-nexusproto' - sh './gradlew clean build pythonInstall' + sh './gradlew clean build tarPython' + stash includes: 'distribution/*.tar.gz', name: 'nexusproto' } } stage("Build"){ steps{ + unstash 'nexusproto' + sh pip install `find distribution -name nexusproto*.tar.gz` git branch: "${env.BRANCH_NAME}", credentialsId: 'fgreg-github', url: 'https://github.com/apache/incubator-sdap-ningesterpy' sh 'python setup.py sdist' } From 62e9af3a2ad3799d92592a093d453a0ac2f180ff Mon Sep 17 00:00:00 2001 From: Frank Greguska Date: Tue, 27 Mar 2018 16:44:06 -0700 Subject: [PATCH 5/7] fixed syntax. --- jenkins/Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 7fc5806..1446d64 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -33,7 +33,8 @@ pipeline{ stage("Build"){ steps{ unstash 'nexusproto' - sh pip install `find distribution -name nexusproto*.tar.gz` + def nexusprotoTarFile = sh returnStdout: true, script: 'find distribution -name nexusproto*.tar.gz' + sh "pip install ${nexusprotoTarFile}" git branch: "${env.BRANCH_NAME}", credentialsId: 'fgreg-github', url: 'https://github.com/apache/incubator-sdap-ningesterpy' sh 'python setup.py sdist' } From ae5dcba6e93ceacbbe51a787589bac81961d4232 Mon Sep 17 00:00:00 2001 From: Frank Greguska Date: Tue, 27 Mar 2018 16:46:33 -0700 Subject: [PATCH 6/7] don't need the find stuff. --- jenkins/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 1446d64..a12f27a 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -33,8 +33,7 @@ pipeline{ stage("Build"){ steps{ unstash 'nexusproto' - def nexusprotoTarFile = sh returnStdout: true, script: 'find distribution -name nexusproto*.tar.gz' - sh "pip install ${nexusprotoTarFile}" + sh "pip install distribution/*.tar.gz" git branch: "${env.BRANCH_NAME}", credentialsId: 'fgreg-github', url: 'https://github.com/apache/incubator-sdap-ningesterpy' sh 'python setup.py sdist' } From 87cb885acaba4976a6f2d7c0b74dc008fb9d1d89 Mon Sep 17 00:00:00 2001 From: Frank Greguska Date: Tue, 27 Mar 2018 16:49:25 -0700 Subject: [PATCH 7/7] moving miniconda image to the build stage. --- jenkins/Jenkinsfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index a12f27a..09cc76f 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -2,12 +2,7 @@ pipeline{ - agent { - docker { - image 'continuumio/miniconda3:latest' - args '-v $HOME/.conda:/.conda/pkgs' - } - } + agent any parameters { string(defaultValue: '', description: 'Branch of the incubator-sdap-nexusproto project to build against. Leave blank to use version from pip specified in requirements (this does not currently work).', name: 'buildNexusprotoBranch') @@ -31,6 +26,12 @@ pipeline{ } } stage("Build"){ + agent { + docker { + image 'continuumio/miniconda3:latest' + args '-v $HOME/.conda:/.conda/pkgs' + } + } steps{ unstash 'nexusproto' sh "pip install distribution/*.tar.gz"