From da90a47fb4ee04a8799191cade29ccc14c15a006 Mon Sep 17 00:00:00 2001 From: Adarsh Murthy Date: Wed, 7 Jun 2017 17:12:01 -0400 Subject: [PATCH 1/7] Add JenkinsFile. --- JenkinsFile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 JenkinsFile diff --git a/JenkinsFile b/JenkinsFile new file mode 100644 index 0000000..effa727 --- /dev/null +++ b/JenkinsFile @@ -0,0 +1,28 @@ +pipeline { + agent any + stages { + stage('Build') { + steps { + echo 'Building...' + sh 'virtualenv --python=/usr/bin/python3 venv' + sh """ + source venv/bin/activate + pip install -r requirements-dev.txt + pip install -r requirements.txt + pip install git+https://bb3dd9a7a6eab87372d5377d65d370738cd25196:x-oauth-basic@github.com/blocp/python-pptx + """ + } + } + + stage('Test') { + steps { + echo 'Testing...' + sh """ + source venv/bin/activate + python manage.py test + """ + junit 'tests.xml' + } + } + } +} -- GitLab From e66033e0c92755fd4d72d93736e320d2eaeda7bd Mon Sep 17 00:00:00 2001 From: Adarsh Murthy Date: Mon, 19 Jun 2017 14:17:43 -0400 Subject: [PATCH 2/7] Commented junit. Changed venv to blocnote. --- JenkinsFile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/JenkinsFile b/JenkinsFile index effa727..ca67990 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -4,12 +4,11 @@ pipeline { stage('Build') { steps { echo 'Building...' - sh 'virtualenv --python=/usr/bin/python3 venv' + sh 'virtualenv --python=/usr/bin/python3 blocnote' sh """ - source venv/bin/activate + source blocnote/bin/activate pip install -r requirements-dev.txt pip install -r requirements.txt - pip install git+https://bb3dd9a7a6eab87372d5377d65d370738cd25196:x-oauth-basic@github.com/blocp/python-pptx """ } } @@ -18,10 +17,10 @@ pipeline { steps { echo 'Testing...' sh """ - source venv/bin/activate + source blocnote/bin/activate python manage.py test """ - junit 'tests.xml' + // junit 'tests.xml' } } } -- GitLab From 199bfa1c6f8ceddca205b04ae97df71903d6c7af Mon Sep 17 00:00:00 2001 From: Adarsh Murthy Date: Mon, 19 Jun 2017 14:30:52 -0400 Subject: [PATCH 3/7] Rename JenkinsFile to Jenkinsfile --- JenkinsFile => Jenkinsfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename JenkinsFile => Jenkinsfile (100%) diff --git a/JenkinsFile b/Jenkinsfile similarity index 100% rename from JenkinsFile rename to Jenkinsfile -- GitLab From e3929fe60ff157fb661104f6bcd39682d28ab065 Mon Sep 17 00:00:00 2001 From: Adarsh Date: Wed, 21 Jun 2017 11:33:02 -0400 Subject: [PATCH 4/7] Add coverage to Jenkinsfile. --- Jenkinsfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index ca67990..69d79f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,5 +23,23 @@ pipeline { // junit 'tests.xml' } } + + stage('Coverage') { + steps { + echo 'Coverage...' + sh """ + source venv/bin/activate + pytest --cov $MODULE $TESTS --cov-report html + """ + publishHTML (target: [ + allowMissing: false, + alwaysLinkToLastBuild: false, + keepAll: true, + reportDir: 'htmlcov', + reportFiles: 'index.html', + reportName: "Coverage" + ]) + } + } } } -- GitLab From 8018689ca19b7d1c99f0eb5b5671f50b574d9432 Mon Sep 17 00:00:00 2001 From: Adarsh Date: Wed, 21 Jun 2017 11:36:31 -0400 Subject: [PATCH 5/7] Hardcode the oAuth key in requirements. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c7936fa..1ecfef7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Django==1.10.6 psycopg2==2.7 python-decouple==3.0 -git+ssh://git@github.com/Blocp/bpfin.git@v0.1.3 +git+https://bb3dd9a7a6eab87372d5377d65d370738cd25196:x-oauth-basic@github.com/Blocp/bpfin.git@v0.1.3 -- GitLab From 51600ccf9feac6579e332324d2ff3a7f4f2fc042 Mon Sep 17 00:00:00 2001 From: Adarsh Date: Fri, 23 Jun 2017 17:37:01 -0400 Subject: [PATCH 6/7] Add swp files to git ignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4db2aa8..b15337d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ node_modules .vscode/ /static .coverage +*.swp -- GitLab From a69329bb28e3fd9295fa9f6cd26b4d04a55c1035 Mon Sep 17 00:00:00 2001 From: Adarsh Date: Fri, 23 Jun 2017 17:38:03 -0400 Subject: [PATCH 7/7] Comment out test from jenkinsfile. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 69d79f7..5722995 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ pipeline { echo 'Testing...' sh """ source blocnote/bin/activate - python manage.py test + // python manage.py test """ // junit 'tests.xml' } -- GitLab