root / README.ci @ 5bde09a4
History | View | Annotate | Download (2.8 kB)
1 |
Continuous integration with Jenkins |
---|---|
2 |
----------------------------------- |
3 |
|
4 |
The following instructions will setup Jenkins to run synnefo tests with |
5 |
the SQLite database. To run the tests on MySQL and/or Postgres, step 4 |
6 |
must be replicated. Also, the correct configuration file must be copied |
7 |
(line 5 of the build script). |
8 |
|
9 |
1. Install and start Jenkins. On Debian: |
10 |
|
11 |
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - |
12 |
echo "deb http://pkg.jenkins-ci.org/debian binary/" >>/etc/apt/sources.list |
13 |
sudo apt-get update |
14 |
sudo apt-get install jenkins |
15 |
|
16 |
2. After Jenkins starts, go to |
17 |
|
18 |
http://$HOST:8080/pluginManager/ |
19 |
|
20 |
and install the following plug-ins at |
21 |
|
22 |
-Jenkins Cobertura Plugin |
23 |
-Jenkins Email Extension Plugin |
24 |
-Jenkins GIT plugin |
25 |
-Jenkins SLOCCount Plug-in |
26 |
-Hudson/Jenkins Violations plugin |
27 |
|
28 |
3. Make sure that all system-level dependencies specified in README.develop |
29 |
are correctly installed |
30 |
|
31 |
4. Create a new "free-style software" job and set the following values: |
32 |
|
33 |
-Project name: synnefo |
34 |
-Source Code Management: Git |
35 |
-URL of repository: Jenkins Git does not support HTTPS for checking out |
36 |
directly from the repository. The temporary solution |
37 |
is to checkout with a cron script in a directory and |
38 |
set the checkout path in this field |
39 |
-Branches to build: master and perhaps others |
40 |
-Git->Advanced->Local subdirectory for repo (optional): synnefo |
41 |
-Git->Advanced->Prune remote branches before build: check |
42 |
-Repository browser: redmineweb, |
43 |
URL: https://code.grnet.gr/projects/synnefo/repository/ |
44 |
-Build Triggers->Poll SCM: check |
45 |
Schedule: # every ten minutes |
46 |
10 * * * * |
47 |
|
48 |
-Build -> Add build step-> Execute shell |
49 |
|
50 |
Command: |
51 |
|
52 |
#!/bin/bash -ex |
53 |
cd synnefo |
54 |
/usr/bin/sloccount --duplicates --wide --details api util ui logic auth > reports/sloccount.sc |
55 |
cp conf/ci/manage.py . |
56 |
if [ ! -e requirements.pip ]; then cp conf/ci/pip-1.2.conf requirements.pip; fi |
57 |
cp conf/ci/settings.py.sqlite settings.py |
58 |
python manage.py update_ve |
59 |
python manage.py hudson api db logic |
60 |
|
61 |
-Post-build Actions->Publish JUnit test result report: check |
62 |
Test report XMLs: synnefo/reports/TEST-*.xml |
63 |
|
64 |
-Post-build Actions->Publish Cobertura Coverage Report: check |
65 |
Cobertura xml report pattern: synnefo/reports/coverage.xml |
66 |
|
67 |
-Post-build Actions->Report Violations: check |
68 |
pylint[XML filename pattern]: synnefo/reports/pylint.report |
69 |
|
70 |
-Post-build Actions->Publish SLOCCount analysis results |
71 |
SLOCCount reports: synnefo/reports/sloccount.sc |
72 |
(also, remember to install sloccount at /usr/bin) |
73 |
|
74 |
|
75 |
--------------- |
76 |
See also: |
77 |
|
78 |
http://sites.google.com/site/kmmbvnr/home/django-hudson-tutorial |