This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
jenkins [2014/11/26 15:16] truetrue [Remote JBoss] |
jenkins [2014/11/26 15:18] (current) truetrue [Remote JBoss] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Jenkins ====== | ||
+ | Meet [[https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins|Jenkins]] | ||
+ | ====== Install and setup ====== | ||
+ | |||
+ | ====== Add a project ====== | ||
+ | |||
+ | |||
+ | ====== Continuous testing with Jenkins ====== | ||
+ | |||
+ | |||
+ | ====== Continuous Delivery with Jenkins ====== | ||
+ | |||
+ | ===== Local JBoss ===== | ||
+ | |||
+ | |||
+ | Deploying an application to JBOSS 7 straight from jenkins works as follows: | ||
+ | * create a management user making use of the add-user.sh script to be found in the JBOSS bin directory. | ||
+ | * alter pom.xml to include the credentials of this management user like: | ||
+ | <code xml> | ||
+ | <plugin> | ||
+ | <groupId>org.jboss.as.plugins</groupId> | ||
+ | <artifactId>jboss-as-maven-plugin</artifactId> | ||
+ | <version>7.1.1.Final</version> | ||
+ | <configuration> | ||
+ | <username>user</username> | ||
+ | <password>pass</password> | ||
+ | </configuration> | ||
+ | </plugin> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | * change the job configuration such that "Poll SCM" is activated | ||
+ | * add goal jboss-as:deploy to the goals | ||
+ | |||
+ | ==== Remote JBoss ==== | ||
+ | ==== Optimize Python Builds ===== | ||
+ | |||
+ | Python Builds should be started from clean environment. | ||
+ | Problem: Building large packages is slow and error-prone (numpy...) | ||
+ | That's why we pre-package: | ||
+ | |||
+ | On python builds: | ||
+ | |||
+ | .pip/pip.conf | ||
+ | <code> | ||
+ | [global] | ||
+ | download-cache = /homedir/.pip/cache | ||
+ | find-links = /homedir/.pip/packages | ||
+ | |||
+ | [install] | ||
+ | use-wheel = yes | ||
+ | |||
+ | [wheel] | ||
+ | wheel-dir = /homedir/.pip/packages | ||
+ | </code> | ||
+ | Create dirs. | ||
+ | |||
+ | Execute: | ||
+ | <code> | ||
+ | pip install wheel | ||
+ | |||
+ | pip wheel numpy | ||
+ | |||
+ | pip wheel scipy (install dependencies first) | ||
+ | etc. | ||
+ | </code> | ||
+ | Packages will be created an cached. | ||
+ | |||
+ | ==== Python projects ==== | ||
+ | |||
+ | - Head Builder: | ||
+ | * Discard old builds | ||
+ | * Git Repo: SSH-URL with Credentials | ||
+ | * Branches to build: */master | ||
+ | * Clean after checkout | ||
+ | * Poll SCM: z.B. H/5 * * * * | ||
+ | * Abort build if stuck: 60 | ||
+ | * Virtualenv: CPython-2.7 / Nature: Shell<code> | ||
+ | pip install wheel | ||
+ | pip install flake8 flake8-docstrings nose coverage mccabe numpy mock pint pandas scipy | ||
+ | python ./setup.py build | ||
+ | python ./setup.py nosetests --with-coverage --with-xunit | ||
+ | python -m coverage xml --include=<project-namespace>* | ||
+ | flake8 --max-complexity=10 --format=pylint <project-namespace> | tee pylint.out | ||
+ | </code> | ||
+ | * Report violations: pylint: %%**%%/pylint.out | ||
+ | * Publish Junit test result report: nosetests.xml amplification factor: 1 | ||
+ | * Publish Cobertura Coverage Report: coverage.xml | ||
+ | - MergeRequest Builder: | ||
+ | * Discard old builds | ||
+ | * This build is parameterized: | ||
+ | * Text-fields: gitlabSourceBranch, gitlabTargetBranch, gitlabSourceRepoURL, gitlabSourceRepoName, | ||
+ | * Git Repo: | ||
+ | * 1 Repo: SSH-URL with Credentials, Name origin | ||
+ | * 2 Repo: ${gitlabSourceRepoURL}, Credentials, Name ${gitlabSourceRepoName} | ||
+ | * Branches to build: */${gitlabSourceBranch} | ||
+ | * Merge before build: Name origin, Branch: ${gitlabTargetBranch} | ||
+ | * Clean after checkout | ||
+ | * Build when a change is pushed to Gitlab (don't forget to add Link in gitlab) | ||
+ | * Build on Merge Request Events | ||
+ | * Abort build if stuck: 60 | ||
+ | * Virtualenv: CPython-2.7 / Nature: Shell<code> | ||
+ | pip install wheel | ||
+ | pip install flake8 flake8-docstrings nose coverage mccabe numpy mock pint pandas scipy | ||
+ | python ./setup.py build | ||
+ | python ./setup.py nosetests --with-coverage --with-xunit | ||
+ | python -m coverage xml --include=<project-namespace>* | ||
+ | flake8 --max-complexity=10 --format=pylint <project-namespace> | tee pylint.out | ||
+ | </code> | ||
+ | * Report violations: pylint: %%**%%/pylint.out | ||
+ | * Publish Junit test result report: nosetests.xml amplification factor: 1 | ||
+ | * Publish Cobertura Coverage Report: coverage.xml |