Created
January 25, 2017 14:56
-
-
Save proffalken/6ce3d12cc620ce0d879f205759757491 to your computer and use it in GitHub Desktop.
Jenkins Blue Ocean Python Development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jenkinsci/blueocean:latest | |
USER root | |
RUN apk add --no-cache --update \ | |
python \ | |
python-dev \ | |
py-pip \ | |
build-base \ | |
&& pip install virtualenv \ | |
&& rm -rf /var/cache/apk/* | |
USER jenkins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
stage('Prepare'){ | |
step([$class: 'WsCleanup']) | |
} | |
stage('Checkout') { // for display purposes | |
// Get some code from a GitHub repository | |
git 'https://bitbucket.org/proffalken/test_blog.git' | |
} | |
stage('Build Deps') { | |
// Run the pip install build | |
sh "virtualenv venv && ${env.WORKSPACE}/venv/bin/pip install -r requirements.txt" | |
} | |
stage('Run Tests') { | |
/* Call nose2. */ | |
sh "${env.WORKSPACE}/venv/bin/nose2 --plugin nose2.plugins.junitxml --junit-xml" | |
/* Archive the test results */ | |
step([$class: 'JUnitResultArchiver', testResults: '**/nose2-junit.xml']) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build a docker container from the Dockerfile, then add the pipeline script into the job config for a new job once the docker container is running.
This should clone the repo, install the dependencies and run the tests