User Tools

Site Tools


jenkins

Jenkins

Meet 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:
  <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>
  • 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

[global]
download-cache = /homedir/.pip/cache
find-links = /homedir/.pip/packages

[install]
use-wheel = yes

[wheel]
wheel-dir = /homedir/.pip/packages

Create dirs.

Execute:

pip install wheel

pip wheel numpy

pip wheel scipy (install dependencies first)
etc.

Packages will be created an cached.

Python projects

  1. 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
      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
    • Report violations: pylint: **/pylint.out
    • Publish Junit test result report: nosetests.xml amplification factor: 1
    • Publish Cobertura Coverage Report: coverage.xml
  2. 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
      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
    • Report violations: pylint: **/pylint.out
    • Publish Junit test result report: nosetests.xml amplification factor: 1
    • Publish Cobertura Coverage Report: coverage.xml
jenkins.txt · Last modified: 2014/11/26 15:18 by truetrue