1.. -*- mode: rst -*-
  2
  3CHART jenkins README
  4====================
  5
  6.. contents::
  7..
  8    1  Server setup
  9      1.1  Security
 10      1.2  Configuration
 11      1.3  Plugins
 12    2  Project setup
 13    3  CHART project Jenkins configuration
 14      3.1  Automated tests
 15      3.2  pylint
 16      3.3  sloccount
 17    4  Files
 18    5  Help
 19    6  Projects
 20
 21Server setup
 22------------
 23
 24Jenkins is installed on Concorde as local user 'jenkins'. The user home directory contains the Jenkins
 25workspace and shell scripts for starting and stopping the server. These scripts are all copied in
 26this directory (dist/jenkins).
 27
 28The Concorde NginX webserver forwards requests to http://concorde/jenkins to http://localhost:5000/jenkins,
 29where the actual server runs.
 30
 31To upgrade the Jenkins server, download the jenkins.war file into /home/jenkins and restart the server.
 32Automated upgrades do not work.
 33
 34The server is started and stopped via a standard call to /etc/init.d/jenkins <start/stop>.
 35
 36Security
 37~~~~~~~~
 38
 39This configuration will allow anyone to view builds, and create an admin user who can
 40change configuration and trigger builds manually:
 41
 42First activate the security system:
 43- Select 'Manage Jenkins'
 44- Select 'Configure'
 45- Tick 'Enable security'
 46- Set Security Realm to 'Jenkins's own user database'
 47- Tick 'Allow users to sign up'
 48- Under 'Authorisation' tick 'Anyone can do anything
 49
 50Next create an admin user:
 51- Select 'Manage Jenkins' then 'Manage Users'
 52- Select 'Create User' and set up an admin user.
 53
 54Finally restrict permissions:
 55- Under 'Authorisation' select 'Logged-in users can do anything'
 56- Untick 'Allow users to sign up'
 57
 58Now anonymous users are read-only, and there is an admin account who can administer the system
 59and create new accounts if needed..
 60
 61Configuration
 62~~~~~~~~~~~~~
 63
 64After installing Jenkins, visit the webpage (http://localhost:5000/jenkins) and select 'Manage Jenkins',
 65'Configure System' and change 'Jenkins URL' to read http://concorde/jenkins.
 66
 67Plugins
 68~~~~~~~
 69
 70The following Jenkins plugins should be installed:
 71
 72 * Mercurial
 73 * Violations
 74 * SLOCCount
 75 * Trac
 76 * SLOCCount
 77 * Warnings
 78 * MultipleSCMs
 79 * Trac
 80 * AnsiColor
 81
 82Project setup
 83-------------
 84
 85The CHART automated tests require some environment variables to be set in jenkins
 86(either through the web interface or in the script files in this directory).
 87
 88CHART_DB
 89  database name from settings.py
 90
 91CHART_STATEFILE_DIR
 92  directory to use for temporary statefiles. (TBD: make nosetests create this in /tmp)
 93
 94CHART project Jenkins configuration
 95----------------------------------
 96
 97Automated tests
 98~~~~~~~~~~~~~~~
 99
100Rewrite this to use `chart check` application.
101
102 * Add a build step to run ``dist/jenkins/test.sh``. It may require environment variables such as CHART_DB
103   to be set.
104 * Tick 'Publish JUnit test result report' and enter 'nosetests.xml' as the filename.
105 * Do not tick 'Publish Cobertura Coverage Report', it doesn't work with subprocess (2010-11-01).
106 * Do not enter coverage.xml as filename.
107
108pylint
109~~~~~~
110
111 * Add a build step: ``dist/jenkins/test.sh``.
112 * Tick **Report violations**
113 * In the **pylint** row enter **pylint.txt** as filename.
114
115sloccount
116~~~~~~~~~
117
118 * Add a build step: 'dist/jenkins/cloc.sh'.
119 * Tick **Publish SLOCCount analysis results**.
120 * Enter **sloccount.sc** as filename.
121
122Files
123-----
124
125config.xml
126  Jenkins configuration file for the CHART project(s).
127
128cloc.py
129  Run Perl cloc (similar to sloccount) over all CHART code and output in the format required by
130  the Jenkins **sloccount** plugin.
131
132pylint.sh
133  Run pylint over all code and store output in a file that the Jenkins **violations** plugin.
134
135tests.sh
136  Run CHART automated test suite.
137
138start.sh
139  Start Jenkins server as a daemon
140
141stop.sh
142  Shut down jenkins daemon
143
144init.d/jenkins
145  Suse service init script
146
147Help
148----
149
150This tutorial is quite useful: http://www.rhonabwy.com/wp/2009/11/04/setting-up-a-python-ci-server-with-hudson
151
152Projects
153--------
154
155 * chart-eps
156   * build
157   * static
158   * functional
159 * chart-msg
160   * build
161   * static
162   * functional
163 * chart
164   * core-build
165   * core-static
166   * core-functional
167 * chart-eps-ope
168   * db
169   * auxdb
170   * web
171   * install
172 * chart-eps-val
173   * db
174   * auxdb
175   * web
176   * install
177 * chart-eps-home
178   * db
179   * auxdb
180   * web
181   * install
182 * chart-msg-ope
183   * db
184   * auxdb
185   * web
186   * install
187 * chart-msg-val
188   * db
189   * auxdb
190   * web
191   * install
192 * chart-msg-home
193   * db
194   * auxdb
195   * web
196   * install