Created
January 5, 2012 09:01
-
-
Save hayajo/1564340 to your computer and use it in GitHub Desktop.
diff dann/perl-jenkins-template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- config.xml.org 2012-01-05 17:44:46.000000000 +0900 | |
+++ config.xml 2012-01-05 17:57:12.000000000 +0900 | |
@@ -51,12 +51,33 @@ | |
#=============================================== | |
# Configuration | |
#=============================================== | |
-export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:${PATH}" | |
+export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:${PATH}" | |
export LOG_DIR=$WORKSPACE/logs | |
export PERL5LIB="$WORKSPACE/lib:$WORKSPACE/t/lib:$WORKSPACE/t/*/lib:${PERL5LIB}" | |
export PERL_TEST_HARNET_DUMP_TAP=$LOG_DIR | |
export TEST_VERBOSE=1 | |
+source $HOME/perl5/perlbrew/etc/bashrc | |
+test -e $WORKSPACE/.jenkins && source $WORKSPACE/.jenkins | |
+ | |
+#=============================================== | |
+# perlbrew | |
+#=============================================== | |
+if [ "$PERLBREW_LIB" = "" ] | |
+then | |
+ PERLBREW_LIB=${JOB_NAME} | |
+fi | |
+ | |
+! perlbrew lib list | grep ${PERLBREW_PERL}@${PERLBREW_LIB} | |
+if [ $? -eq 0 ] | |
+then | |
+ perlbrew lib create ${PERLBREW_PERL}@${PERLBREW_LIB} | |
+fi | |
+ | |
+perlbrew use ${PERLBREW_PERL}@${PERLBREW_LIB} | |
+ | |
+cpanm --installdeps . | |
+ | |
#=============================================== | |
# Main | |
#=============================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
あらかじめjenkinsユーザーでperlbrew環境を用意して、perlをインストールしておくこと。
.jenkinsで下記の変数を設定することで使用するperlのバージョンやライブラリセットを切り替えることが可能。
使用するperlバージョンを指定
あらかじめJenkins環境にperlbrewでインストールしていないとエラーとなるので注意
使用するライブラリセット名を指定
未設定の場合はJenkinsのJOB_NAMEが適用される