# Don't use only apt-get install jenkins that old version
$ wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
$ sudo vim /etc/apt/sources.list
# add the following entry
# deb http://pkg.jenkins-ci.org/debian binary/
$ sudo apt-get update
$ sudo apt-get install jenkins
brew update
brew install jenkins
Original From Setting up an Apache Proxy for port 80 -> 8080 but it use old version of apache2
$ sudo apt-get install apache2
$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
$ sudo a2dissite 000-default.conf
Create “jenfins.conf” in /etc/apache2/sites-available
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName ci.company.com
ServerAlias ci
ProxyRequests Off
<Proxy *>
Order deny,Alloww
Allow from all
</Proxy>
ProxyPreserveHost on
ProxyPass / http://Proxylocalhost:8080/
</VirtualHost>
$ sudo a2ensite jenkins
$ sudo service apache2 restart
Jenkins > Configure System > Home directory
Advanced...
Buttons.workspace
.< jenkins home directory > /jobs/< your jobs > / < workspace >
http://yourjenkinsserver/job/<project name>/config.xml
http://yourjenkinsserver/reload
If you use linux you have to install curl. That was installed osx.
$ sudo apt-get install curl
You can trigger jenkins with this url
http://yourjenkinsserver/git/notifyCommit?url=<URL of the Git repository>
You can trigger jenkins after git push by
# git don't have post-push hook
$ git push && curl http://yourjenkinsserver/git/notifyCommit?url=$(git remote -v | grep -m 1 -oh "git@.*git")
You can use git alias to make short cmd by edit .git/config in your git repository
[alias]
trig-jenkins = !curl http://yourjenkinsservergit/notifyCommit?url=$(git remote -v | grep -m 1 -oh "git@.*git")
push-wt = !git push && git trig-jenkins
call your alias by
$ git trig-jenkins
$ git push-wt
In command add your run script
# example
export LANG=en_US.UTF-8
python setup.py develop
nosetests --with-coverage --cover-erase --cover-package=core,bin --cover-html --with-xunit
(Optional) Publish Test Result Report
5.1 Use nosetests to generate xml result in xunit format
$ nosetests --with-xunit # nosetests.xml is default name of xml
5.2 Add post-build action > Publish JUnit test result report
5.3 Add “nosetests.xml” in Test report XMLs
(Optional) Publish coverage.py HTML reports
6.1 Use nosetests to run coverage.py
$ nosetests --with-coveage --cover-html
6.2 Add post-build action > Publish coverage.py HTML reports
(Options) Publish your product
7.1 Add post-build action > Archive the artifacts
7.2 Add your file name
# launchd start jenkins at login:
$ ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents
# start jenkins
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
# stop jenkins:
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
$ sudo service jenkins restart
$ sudo su - jenkins
$ ssh-keygen -t rsa -C "your_email@example.com"
$ cat ~/.ssh/id_rsa.pub
# wokr in any shell
$ script1.sh & # run in background (sub-shell)
$ script2.sh # run in foreground (shell)
# add jenkins to docker group
$ sudo gpasswd -a jenkins docker # or sudo adduser jenkins docker
$ sudo service docker.io restart
$ sudo service jenkins restart