Skip to content

Latest commit

 

History

History
95 lines (82 loc) · 4.16 KB

README.md

File metadata and controls

95 lines (82 loc) · 4.16 KB

OpenNMS Continuous Integration

See also OpenNMS Continuous Integration.

Prerequisites / Recommendations

  1. Install and configure a Maven proxy (Nexus or Artifactory)

    Each CI job that runs will clean out running users maven repository (~/.m2/repository) as part of the cleanup at the start of the job. Also, the jobs are configured to have the maven repository inside the workspace, and those will be removed as part of a 'git clean -fdx' as part of the shell command. Having a local proxy will also help save network traffic, and speed up the builds.

  2. Setup a local git repository clone of OpenNMS.

    Each CI job that runs will have its own checked out copy of the source repository. Having a local copy of the repository will help save netowrk traffic and speed up the builds.

  3. SonarQube

    The OPENNMS-MASTER-CODEREVIEW job will run checkstyle, findbugs, pmd, and SonarQube analysis' against the workspace. If you are going to be running the SonarQube analysis long term, setup a local postgresql/mysql database to store its data in.

Jenkins / Hudson Setup

  1. Install Jenkins from http://jenkins-ci.org/, or Hudson from http://hudson-ci.org/

  2. http://localhost:8080/

  3. Click 'Manage Jenkins'

  4. Click 'Manage Plugins'

  5. Select all plugins with updates, and click 'Install without restart' button.

  6. After all plugins have downloaded, click the checkbox to 'Restart Jenkins when installation is complete and no jobs are running'.

  7. Manage Plugins | Setup Security

    1. Click 'Enable Security'
    2. Under 'Security Realm', check 'Jenkins’s own user database'.
    3. Under 'Authorization', check 'Logged-in users can do anything'.
    4. Click the 'Save' button.
  8. Click on the 'Create an Account' link

    1. If you have an ssh public/private key:
      1. After creating your account, login, and click on your username link in the upper right corner.
      2. Click on 'Configure'
      3. Paste your public key under the 'SSH Public Keys', and click the 'Save' button.
  9. Configure JDK: Manage Jenkins | Configure System

    1. Global Properties
      1. Check 'Environment variables'
        1. key: PATH
        2. value: /sbin:/usr/sbin:/bin:/usr/bin
      2. Check 'Prepare jobs environment', check 'Unset System Environment Variables'
    2. JDK
      1. click 'Add JDK'
        1. Name: Oracle JDK 7
        2. uncheck install automatically
        3. JAVA_HOME: /path/to/oracle7jdk
      2. Setup any other additinal JDKs you wish to compile and/or test with.
  10. Download the jenkins-cli.jar

  11. wget -q http://localhost:8080/jnlpJars/jenkins-cli.jar

  12. Install plugins (script: setup.sh)

  13. CLI="java -jar jenkins-cli.jar -s http://localhost:8080/"

  14. $CLI login

  15. $CLI install-plugin analysis-core

  16. $CLI install-plugin analysis-collector

  17. $CLI install-plugin build-failure-analyzer

  18. $CLI install-plugin checkstyle

  19. $CLI install-plugin envinject

  20. $CLI install-plugin findbugs

  21. $CLI install-plugin pmd

  22. $CLI install-plugin git-client

  23. $CLI install-plugin git

  24. $CLI install-plugin parameterized-trigger

  25. $CLI install-plugin shared-objects

  26. $CLI install-plugin violations

  27. $CLI install-plugin warnings

  28. $CLI restart

  29. Setup Jobs (script: setup_jobs.sh)

  30. $CLI create-job OpenNMS < jobs/OpenNMS.xml

  31. $CLI create-job OPENNMS-MASTER-COMPILE < jobs/OPENNMS-MASTER-COMPILE.xml

  32. $CLI create-job OPENNMS-MASTER-CODEREVIEW < jobs/OPENNMS-MASTER-CODEREVIEW.xml

  33. $CLI create-job OPENNMS-MASTER-TEST < jobs/OPENNMS-MASTER-TEST.xml

  34. $CLI create-job OPENNMS-MASTER-JAVADOC < jobs/OPENNMS-MASTER-JAVADOC.xml

  35. Configure the 'OpenNMS' job

  36. Under Configuration Matrix

    1. Choose the 'JDK' option under the 'Add axis', and enable the JDKs you have added on the system.
  37. If you don't want to run any code review jobs, then edit the OpenNMS job and delete the triggered job.