Jenkins CI ä¸ã§ Gradle ãå©ç¨ããæãç°¡åãªæ¹æ³
Gradle ã«ã大åæ
£ãã¦ãããããããã å®éã«ããã¸ã§ã¯ãã§ä½¿ããããã«æºåããªãã¨...
ã¾ã㯠Jenkins CI 㧠Gradle ãå©ç¨ã§ããããã«æºåãããããªã
ä»æã®ããã¸ã§ã¯ãã§ã¯ Jenkins CI ãããå½ããåã§ãããã
ã¨è¨ããã¨ã§ãä»å㯠Jenkins CI 㧠Gradle ããæãç°¡å㪠(ã¨æããã) æ¹æ³ã§ãã
å®ã¯ Jenkins CI 㧠Gradle ãå©ç¨ããããã« å¿
è¦ãªæºåãªãã¦ä½ãããã¾ããã
ãããJenkins CI ä¸ã§ç°å¢æ§æãå¤æ´ããå¿ è¦ãããã®ã§ããã° ããããåèã« Gradle ãã¡ã¤ã«ãè¨å®ãã¾ãããã
ä»å㯠GitHub ããããã¸ã§ã¯ãããã§ãã¯ã¢ã¦ã (clone) ãã¦ãã«ããã¾ãã®ã§ã
ããããã Jenkins CI ã«ã¯ Git ãå©ç¨ããããã®ç°å¢ãæ´ã£ã¦ãããã¨ãåæã¨ãã¦ãã¾ãã
æ¢ã«ç¨¼åä¸ã® Jenkins CI ãªã ãã¡ãã Git ã®ç°å¢ã¯æ´ã£ã¦ãã¾ããã...
ã§ã¯ãæ©éããã¸ã§ã¯ããçæãã¦ãã«ããã¦ã¿ããã¨ã«...
ã¸ã§ãã®ä½æ
ã¡ãã¥ã¼ãã ãæ°è¦ã¸ã§ãä½æããã¯ãªãã¯ãã¦ã¸ã§ããä½æãã¾ãã
ã¸ã§ãåã«ä»»æã®å称 (ä»å㯠gradle-jenkins-sample ã¨ãã¾ãã)ãå
¥åãããããªã¼ã¹ã¿ã¤ã«ã»ããã¸ã§ã¯ãã®ãã«ãã
ãé¸æã㦠[OK] ãã¿ã³ãã¯ãªãã¯ãã¾ãã
Git ã®è¨å®
ã½ã¼ã¹ã³ã¼ã管çã·ã¹ãã ãã Git ãé¸æãã¦
- ãURL of Repositoryã ã« "https://github.com/bluepapa32/gradle-environment-sample.git"
- ãBranch Specifierã ã« "20110317"
ãã«ã ã®è¨å®
ãã«ãã® ããã«ãæé ã®è¿½å ããã ã·ã§ã«ã®å®è¡ (Windows ã§ããã° Windowsãããã³ãã³ãã®å®è¡) ãé¸æãã¾ãã 追å ããã ã·ã§ã«ã¹ã¯ãªãã (Windows ã§ããã° ã³ãã³ã) å ¥åæ¬ã«
./gradlew -qã¨å ¥åãã¦ä¿åãã¾ãã
ããã©ã«ãã¿ã¹ã¯ä»¥å¤ãå®è¡ããå ´åã¯
./gradlew -q clean something buildã®ããã«ã¿ã¹ã¯ãæå®ãã¦ãè¯ãã®ã§ããã gradle/ci.gradle ãã¡ã¤ã«ãä½æãã¦
defaultTasks 'clean', 'something', 'build'ã®ããã«è¨å®ããæ¹ã
./gradlew -q -Penv=ciã¨è¨ã£ãæãã§ç°¡åã«å®è¡ã§ããã®ã§ã¨ã£ã¦ã便å©ã§ãã
ãã¡ãããGradle ãã¡ã¤ã«ã«å¤æ´ãå ¥ã£ã¦ã Jenkins CI ã®è¨å®ã¯ä½ãå¤ããå¿ è¦ã¯ããã¾ããã
詳細㯠ãGradle で環境ごとにあれもこれも変更するããåç §ãã¦ãã ããã
ãã«ã å®è¡
ã¡ãã¥ã¼ã®ããã«ãå®è¡ããã¯ãªãã¯ãã¦ãã«ããã¦ã¿ã¾ãããã
ãããªæã㧠ååãã«ãæã« Gradle ããã¦ã³ãã¼ãããã¤ã³ã¹ãã¼ã«ããã¾ãã
ã¦ã¼ã¶ã¼anonymousãå®è¡ Checkout:workspace / /Users/bluepapa32/.jenkins/jobs/gradle-jenkins-sample/workspace - hudson.remoting.LocalChannel@33c4bcda Using strategy: Default Last Built Revision: Revision 5ec102ee2d1e76149e05568b59cc9c850711f4c5 (origin/20110317) Checkout:workspace / /Users/bluepapa32/.jenkins/jobs/gradle-jenkins-sample/workspace - hudson.remoting.LocalChannel@33c4bcda Fetching changes from the remote Git repository Fetching upstream changes from https://github.com/bluepapa32/gradle-environment-sample.git Commencing build of Revision 5ec102ee2d1e76149e05568b59cc9c850711f4c5 (origin/20110317) Checking out Revision 5ec102ee2d1e76149e05568b59cc9c850711f4c5 (origin/20110317) [workspace] $ /bin/sh -xe /var/folders/VZ/VZFIYL65EiiQlDqyahjaok+++TI/-Tmp-/hudson5894203962530008057.sh + ./gradlew -q -Penv=ci /Users/bluepapa32/.jenkins/jobs/gradle-jenkins-sample/workspace Downloading http://gradle.artifactoryonline.com/gradle/distributions/gradle-1.0-milestone-1-bin.zip ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ Unzipping /Users/bluepapa32/.gradle/wrapper/dists/gradle-1.0-milestone-1-bin.zip to /Users/bluepapa32/.gradle/wrapper/dists server.url = http://app/setting database.driverClassName = org.hsqldb.jdbcDriver database.url = jdbc:hsqldb:mem:ciDb database.username = bluepapa32 database.password = Finished: SUCCESS
ãããèå³ã®ããæ¹ã¯
https://github.com/bluepapa32/gradle-environment-sample/tree/20110317ã«ãµã³ãã«ãããã¾ãã®ã§è©¦ãã¦ã¿ã¾ãããã