顯示具有 jenkins 標籤的文章。 顯示所有文章
顯示具有 jenkins 標籤的文章。 顯示所有文章

2014年5月31日 星期六

Jenkins 預設語言

Jenkins 預設的語言是根據使用者瀏覽器決定,若要強制指定,則可:
  1. 使用 Jenkins 的 Locale 外掛
  2. 指定全系統的語系 /etc/default/locale


Default Jenkins behavior - use browser locale
https://wiki.jenkins-ci.org/display/JENKINS/How+to+view+Jenkins+in+your+language


How to enforce particular locale - use Locale Plugin
http://wiki.hudson-ci.org/display/HUDSON/Locale+Plugin




References :
Jenkins users - forcing english locale

2014年5月18日 星期日

Install Jenkins Log-Term Support Release on Debian

# wget -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | apt-key add -
# vi /etc/apt/sources.list

deb http://pkg.jenkins-ci.org/debian-stable binary/
# apt-get update
# apt-get install jenkins

# netstat -antlp | grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      3973/java

http://127.0.0.1:8080/





References :
Debian Repository for Jenkins

2013年4月24日 星期三

Jenkins phpmd

# pear channel-discover pear.phpmd.org
# pear channel-discover pear.pdepend.org
# pear install --alldeps phpmd/PHP_PMD

phpmd . html codesize,unusedcode,naming,design --reportfile build/phpmd.html || :



2013年4月23日 星期二

Several checkstyle reports in jenkins

build/checkstyle-*.xml




Reference :
continuous integration - Several checkstyle reports in jenkins - Stack Overflow

Jenkins JSHint

執行 Shell
/usr/local/bin/jshint --checkstyle-reporter html/_js/ --config /root/node_modules/jshint/jshint.json >> build/checkstyle-jshint.xml || exit 0



Publish Checkstyle analysis results
Checkstyle results build/checkstyle-*.xml


Report Violations
checkstyle 10 999 999 build/checkstyle-*.xml




Reference :
Jenkins & JSHint – Integrating with Checkstyles and Violations « Brian Wigginton

Jenkins and PHP





Reference :
Template for Jenkins Jobs for PHP Projects
Using PHP static analysis tools with Jenkins | Mark Story
Continuous Integration In PHP w/Jenkins | Agile Zone
Integrating PHP Projects with Jenkins: Safari Books Online

jenkins ignore exit code

Build step 'Execute shell' marked build as failure



Usually you can ignote command exit code by
|| :




Reference :
Jenkins users - using execute shell

Using PHP static analysis tools with Jenkins | Mark Story

2012年12月25日 星期二

Jenkins 安裝

$ apt-get install openjdk-6-jre
$ mkdir -p /home/jenkins
$ cd /home/jenkins
$ wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
$ java -jar jenkins.war

啟動參數
Starting and Accessing Jenkins - Jenkins - Jenkins Wiki

Dashboard
http://localhost:8080/

管理外掛程式
http://localhost:8080/pluginManager/





新增一個 Job

git ssh 位址
ssh://git@remote.repository:22/home/git/my_project.git

 
使用 git 取得 source code 時,要將運行 Jenkins 的使用者的 ssh public key 放入 repository  機器的登入用戶 (~/.ssh/authorized_keys)
$ cd ~/.ssh
$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub  # public key

2012年7月30日 星期一

Jenkins PyFlakes

http://127.0.0.1:8080/pluginManager/
安裝Warnings Plug-in


http://127.0.0.1:8080/configure 

設定系統 -> Compiler Warnings -> 新增 Parser
要填入的資訊可以參考下面鏈接

http://127.0.0.1:8080/job/test_project/configure

進入專案 -> 設定 -> Add post-build action (最下面) -> Scan for compiler warnings

Build -> Add build step -> Execute shell
echo "pyflakes ...."
for f in `find . -name "*.py"`; do
pyflakes $f >> pyflakes.log
done || :

Scan for compiler warnings -> Scan workspace files

2012年7月19日 星期四

Jenkins Python Scripts


Execute shell 
echo "clonedigger ...."                                                                             
clonedigger --cpd-output -o clonedigger.xml .
 
Execute shell
echo "pep8 ...."
#pep8 --filename=*.py  . > pep8.txt
find . -name "*.py" -exec pep8 {} \; >> pep8.txt
Execute shell
echo "pylint ...."
for f in `find . -name "*.py"`; do
pylint --output-format=parseable --reports=y $f >> pylint.log
done || : 

Execute shell
sloccount --duplicates --wide --details *.py | fgrep -v .svn > sloccount.sc || :
Execute shell
echo "pyflakes ...."
for f in `find . -name "*.py"`; do
pyflakes $f >> pyflakes.log
done || :




Reference :
How to use Jenkins for python development

2012年4月5日 星期四

jenkins


Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/hello/workspace
Checkout:workspace / /var/lib/jenkins/jobs/hello/workspace - hudson.remoting.LocalChannel@c7aaef
Using strategy: Default
Checkout:workspace / /var/lib/jenkins/jobs/hello/workspace - hudson.remoting.LocalChannel@c7aaef
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone user@the_remote_host:hello.git
hudson.plugins.git.GitException: Could not clone user@the_remote_host:hello.git
 設定 ssh 免密碼驗證, 並在命令列下以 jenkins 帳號測試
 git clone user@the_remote_host:hello.git
 (另外, 也可以設定 ssh 自動接受憑證)



Caused by: hudson.plugins.git.GitException: Error performing command: git tag -a -f -m Jenkins Build #4 jenkins-hello-4
Command "git tag -a -f -m Jenkins Build #4 jenkins-hello-4" returned status code 128: 
*** Your name cannot be determined from your system services (gecos).

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.

$ git config --global user.email "jenkins@localhost"
$ git config --global user.name "jenkins"