Select it with the mouse and hit Enter
| на поддержку перевода |
|
|
ЯМ:41001223475816
Статья написана для Hudson, но для Jenkins все идентично, только вместо hudson пишем jenkins :) Еще на инглише, т.к. писал для внутреннего вики. Со временем переведу, хотя уже пол года в черновиках лежит.
$ wget -O - http://hudson-ci.org/debian/hudson-ci.org.key | sudo apt-key add -
$ sudo echo "deb http://hudson-ci.org/debian binary/" >> /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install hudson
Also you should install OpenJDK if it is not installed yet:
sudo apt-get install openjdk-6-jre-headless
So after this:
Now you can visit UI in 127.0.0.1:8080 to check it is working. Visit Manage Hudson>Manage Plugins>Available and install Git Plugin, Cobertura Plugin. Restart Hudson:
$ sudo /etc/init.d/hudson restart
Visit Manage Hudson>Configure System. At the bottom you can see E-mail Notification. For python SMTP server(python -m smtpd -n -c DebuggingServer localhost:1025) I have this:

For Gmail something like this:

Click "Test configuration by sending e-mail to System Admin Address" for testing.
Install IRC Plugin. Now you can see "IRC Notification" section in Hudson settings. Example of settings: 
I changed Nickname because default was not available, don't know why. Now restart Hudson and it should join IRC channel. In project settings enable " IRC Notification" and set channel you add in Hubson settings("#universalsubtitles"). If you have problem check logs. You can find them on Settings page.
All is described HERE
To allow some other user edit project settings visit Manage Hudson->Configure System->Access Control->Project-based Matrix Authorization Strategy. Then in project settings chose Enable project-based security and add new user.
"Delete yourself from the $HUDSON_HOME/users directory.
This lets you recreate yourself as a user. Once you've recreated yourself as a user, you're an administrator since you already exist in the Hudson $HUDSON_HOME/config.xml file as an administrator. "
$HUDSON_HOME for me is /var/lib/hudson/. Maybe you need stop Hudson at first: sudo /etc/init.d/hudson stop To start again: sudo /etc/init.d/hudson start
Took here.
Create new job, select Source Code Management - Git, add link to repo somethin like: git://github.com/8planes/mirosubs.git. Click Save at the bottom and Build Now. This should be all, but I got error:
FATAL: Could not apply tag hudson-Install-1
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident <hudson@alerion-K50IN.(none)> not allowed
So go to the workspace folder, at the top of console output you can find something like this: Checkout:workspace / /var/lib/hudson/jobs/Install/workspace - hudson.remoting.LocalChannel@1b7516d
$ cd /var/lib/hudson/jobs/Install/workspace
$ git config user.email "some@email.com"
$ git config user.name "hudson"
I fount this recipe here.
Now build job again. After finish you can see workspace through the Hudson UI.
Create script for building virtual environment and for testing. All this is described HERE.
What problems I have got:
cd $WORKSPACE
virtualenv -q env
. ./env/bin/activate
pip install -q -E ./env -r requirements.txt
pip install -q -E ./env -r requirements-test.txt
python manage.py test auth --settings=test_settings --with-coverage --cover-package=videos --with-xunit --with-xcoverage
We test just auth application. You can use example from article above.
This is requirements for testing tools, which can generate coverage and test result reports in Hudson-friendly format.
coverage==3.2b3
nose
git+git://github.com/cmheisel/nose-xcover.git#egg=nosexcover
django-nose
pylint
After first success building we can add reports for displaying in Hudson. We can do it before, but really can see something only if Hudson have at list one completed building. So in Job's settings we should set this settings: 