- UIããªããªã¢ãŒãLinuxãã·ã³ã«Jenkinsãã€ã³ã¹ããŒã«ããŸãã
- ãã©ã€ããŒããªããžããªããã¢ããªã±ãŒã·ã§ã³ããã«ãããŸãã
- ååãããããªããã©ã³ãããã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããåé¡ã解決ããŸãã
- .apkãã¡ã€ã«ãã¢ã»ã³ãã«ããåŸãããããFabricã«éä¿¡ãããã¹ã¿ãŒã«ââéç¥ããŸãã
- Fabricã«éä¿¡ããåŸãGoogle Playã§ã¢ããªãå ¬éããŸãã
- ã¢ããªã±ãŒã·ã§ã³ãå ¬éããã¿ã¹ã¯ããã¹ã¿ãŒã«ââãã£ãŠå®è¡ãããã®ãé²ããŸãã
Jenkinsã®ã€ã³ã¹ããŒã«
ããã§ããµãŒããŒã«ã¢ã¯ã»ã¹ã§ããŸããã UIã¯ãããŸããããããã¯ãŸã£ããåé¡ãããŸããã
ã¯ããã«ãjenkinsãµãŒããŒèªäœãã€ã³ã¹ããŒã«ããŸãããã
$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add - $ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' $ sudo apt-get update $ sudo apt-get install jenkins
ãã®ããã±ãŒãžã®ã€ã³ã¹ããŒã«ãè¡ãããšã®è©³çŽ°ã«ã€ããŠã¯ã å ¬åŒããã¥ã¡ã³ããåç §ããŠãã ãã ã
ã€ã³ã¹ããŒã«åŸããã£ã¬ã¯ããª
/var/lib/jenkins
ã¯ãJenkinsèªäœããããžã§ã¯ããªããžããªãããã³Jenkinsãæ©èœããããã«å¿ èŠãªãã®ä»ã®ãã¡ã€ã«ãå«ãŸããŸãã ããã§ããã©ãŠã¶ãŒãä»ããŠJenkinsã«ãã°ã€ã³ããCIãµãŒããŒã®æ§æãéå§ã§ããŸãã
ãã ãããã®åã«ãAndroidã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã«å¿ èŠãªãã¹ãŠãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã
Android SDK + JAVAãã€ã³ã¹ããŒã«ããŸã
以äžã®å ¬åŒWebãµã€ã㧠ãå¿ èŠãªãã£ã¹ããªãã¥ãŒã·ã§ã³ãžã®ãªã³ã¯ãèŠã€ããããšãã§ããŸãã éåžžã¯Android Studioãšäžç·ã«ã€ã³ã¹ããŒã«ãããŸããããã®å Žåã¯å¿ èŠãªããããç®çã®ãªã³ã¯ãéžæããŠã³ãã³ãã©ã€ã³ããŒã«ãèªã¿èŸŒã¿ãŸãã
å·çæç¹ã§ã¯ãLinuxã®çŸåšã®ããŒãžã§ã³ã¯android-sdk_r24.4.1ã§ããã ã€ã³ã¹ããŒã«ããã«ã¯ã次ã®ã³ãã³ããå®è¡ããŸãã
$ wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz $ tar -xvf android-sdk_r24.4.1-linux.tgz
次ã«ããã©ãããã©ãŒã ããŒã«ããã«ãããŒã«ãããã³ãããžã§ã¯ãã§äœ¿çšããã¢ããªã±ãŒã·ã§ã³ããã«ãããçŸåšã®APIãããŠã³ããŒãããå¿ èŠããããŸãã ãããè¡ãã«ã¯ããããžã§ã¯ãã®build.gradleãã¡ã€ã«ãïŒã¢ããªã±ãŒã·ã§ã³ã¢ãžã¥ãŒã«ã¬ãã«ã§ïŒèŠãŸãã ããšãã°ãç§ã®ãããžã§ã¯ãã§ãç§ãã¡ãèå³ãæã£ãŠããéšåã¯æ¬¡ã®ãšããã§ãã
android { .... compileSdkVersion 25 buildToolsVersion '25.0.0' .... }
ããã¯ãã©ã®ããŒãžã§ã³ãããŠã³ããŒãããå¿ èŠãããããæ確ã«ç€ºããŠããŸãã å¿ èŠãªã³ã³ããŒãã³ããããŠã³ããŒãã§ããããã«ãã·ã¹ãã å€æ°ã«æ¬¡ã®ãã©ã¡ãŒã¿ãŒãè¿œå ããŸãã
$ export ANDROID_HOME=~/android-sdk-linux # SDK-Tools $ export PATH=$ANDROID_HOME/tools:$PATH $ export PATH=$ANDROID_HOME/platform-tools:$PATH
ããã«ãã»ãšãã©ã®ã¬ã€ãã§ã¯ã次ã®ã³ãã³ãã䜿çšããŠãã¹ãŠã®ã³ã³ããŒãã³ããåçŽã«ããŠã³ããŒãããããšãææ¡ãããŠããŸãã
$ android update sdk --no-ui --all
ãã ããããŒããã©ã€ãã®ã¹ããŒã¹ãç¡é§ã«ããŠç³ãèš³ãããŸããã®ã§ãå¿ èŠãªãã®ã ããããŠã³ããŒãããŸãã ã³ãã³ããå®è¡ããŠãæ£ç¢ºã«ããŠã³ããŒãããå¿ èŠããããã®ãèŠã€ããŸãã
$ android list sdk --all
çµæã¯æ¬¡ã®ãšããã§ãã
ããã§ãã³ãã³ãã§å¿ èŠãªãã®ã ããã€ã³ã¹ããŒã«ã§ããŸãã
$ android update sdk --no-ui --all --filter 1,2,163,164,168,169,170,171
次ã®ã³ãã³ãã䜿çšããŠJAVAãé 眮ããŸãã
$ sudo apt-get install openjdk-8-jdk
ãããïŒ Jenkinsã®ãã«ããšã¢ããªã±ãŒã·ã§ã³ã®ãã«ãã«å¿ èŠãªãã¹ãŠãæäŸããŸããã ããã§ã¯ããžã§ã³ãã³ã¹ã®ã»ããã¢ããã«ç§»ããŸãããã
ãã©ã€ããŒããªããžããªãžã®ã¢ã¯ã»ã¹ãæ§æãã
gitãªããžããªãå ¬éãããŠããå ŽåããŸãã¯ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãã䜿çšããŠã¢ã¯ã»ã¹ããå Žåã¯ããã®ãããã¯ãã¹ãããããŠæ¬¡ã®ãããã¯ã«çŽæ¥é²ãããšãã§ããŸãã
ããã§ããã¹ãŠãæ£ããè¡ããSSHçµç±ã§ãªããžããªã«ã¢ã¯ã»ã¹ããããšã«ããŸããã ãããè¡ãã«ã¯ãsshããŒãçæããŠ/var/lib/jenkins/.sshãã£ã¬ã¯ããªã«é 眮ããå¿ èŠããããŸãã
jenkinsãã€ã³ã¹ããŒã«ãããšãjenkinsãšããååã®ãŠãŒã¶ãŒãUNIXãã·ã³ã«èªåçã«çæãããŸããã jenkinsãããŒã䜿çšã§ããããã«ãããŒãçæããæãç°¡åãªæ¹æ³ã¯ãjenkinsãŠãŒã¶ãŒã®äžããã§ãã
$ sudo su jenkins -s /bin/bash $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
ãã®åŸã2ã€ã®ãã¡ã€ã«ãçæãããŸãïŒæšæºåã¯id_rsaãid_rsa.pubïŒã id_rsaãã¡ã€ã«ã¯/var/lib/jenkins/.sshãã£ã¬ã¯ããªã«é 眮ããå¿ èŠããããŸãããã®åŸãgithubãªããžããªèšå®ã«ãããã€ããŒïŒid_rsa.pubãã¡ã€ã«ã®ã³ã³ãã³ãïŒãè¿œå ããå¿ èŠããããŸãã
次ã®ããã«ãªããŸãã
次ã«ããªããžããªURLãæ¢ç¥ã®ãªã¹ãã«è¿œå ããŸãã ãããè¡ãã«ã¯ããªããžããªã«é£çµ¡ããŠããªããžããªãã©ã³ãã®ãªã¹ããååŸããŠãã ããã
$ sudo apt-get install git # git $ sudo su jenkins -s /bin/bash $ git ls-remote -h git@github.com:[your_repo_url]
ãããŠãæ¢ç¥ã®ãã¹ãã®ãªã¹ãã«githubãè¿œå ããããšã«åæããŸãã id_rsaãã¡ã€ã«ã«ã¢ã¯ã»ã¹ã§ããªãå Žåã¯ãjenkinsãŠãŒã¶ãŒã®äžããäœæããŸããã§ããããã®å ŽåãjenkinsãŠãŒã¶ãŒã«ãã®ãã¡ã€ã«ãæäœããããã®ã¢ã¯ã»ã¹æš©ãäžããå¿ èŠããããŸãã
$ sudo chmod 700 /var/lib/jenkins/.ssh/id_rsa
ãããã®æé ãå®äºãããšããã©ã€ããŒããªããžããªã«ã¢ã¯ã»ã¹ããŠAndroidã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ã§ããããã«ãªããŸãã
ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããã¿ã¹ã¯ãäœæãã
ããã§ã¯ããžã§ã³ãã³ã¹ã«ç§»ããŸãããã ããã©ã«ãã§ã¯ãããŒã8080ã§äœ¿çšã§ããŸããä»»æã®ãã©ãŠã¶ãŒã§ãã®ããŒãã«åãæ¿ããŸãããã æåã®èµ·ååŸããã¡ã€ã«/ var / lib / jenkins / secrets / initialAdminPasswordã«ãããã¹ã¯ãŒãã䜿çšããŠãã°ã€ã³ã§ããŸãã ãã®åŸãJenkinsããã«ã«å ¥ããŸãã ãŸããANDROID_HOMEãã£ã¬ã¯ããªãžã®ãã¹ãèšå®ããå¿ èŠããããŸãã
Jenkinsã®ç®¡ç->ã·ã¹ãã æ§æïŒ
ãŸããGradleããã³Gitã®ããŒãžã§ã³ã§ããJDKãžã®ãã¹ãæ§æããŸãã ãããè¡ãã«ã¯ãJAVAãä¿åãããŠãããã£ã¬ã¯ããªãæå®ããã¢ã»ã³ããªã«å¿ èŠãªgradleã®ããŒãžã§ã³ãè¿œå ããŸãã
Jenkinsã®ç®¡ç->ã°ããŒãã«ããŒã«èšå®ïŒ
ããã§ãã¢ããªã±ãŒã·ã§ã³ããã«ãããæåã®ã¿ã¹ã¯ãäœæã§ããŸãã ç¡æã®æ§æã§ã¿ã¹ã¯ãäœæããããšãéžæããŸãã [ãœãŒã¹ç®¡ç]ã¿ãã§[git]ãéžæããŸãã 次ã«ãsshçµç±ã§ã¢ã¯ã»ã¹ããããã®URL gitãªããžããªãæå®ããŸãã æåã®ã¿ã¹ã¯ã§ã¯ããã©ã³ããããŠã£ã¶ãŒããåéããŸãã 瀺ãããŠããã®ã¯ããã©ã«ãã§ãã
次ã«ãgradleã¹ã¯ãªãããå®è¡ããŠãã«ãã¹ããããè¿œå ããŸãã åã«è¿œå ããgradleããŒãžã§ã³ãéžæããŸãã ãã¹ãŠã®éèŠãªãã£ãŒã«ãã«ã¯ãããããå¿ èŠãªçç±ã«é¢ããæããããå«ãŸããŠããŸãã ããšãã°ãéæšæºã®ãããžã§ã¯ãæ§é ãããå Žåãã«ãŒãbuild.gradleãããžã§ã¯ããã¡ã€ã«ãããå Žæãšãbuild.gradleãšç°ãªãå Žåã¯ãã¡ã€ã«åãæå®ããå¿ èŠããããŸãã
次ã«ã.apkãã¡ã€ã«ãã¢ãŒã«ã€ãããŠãåŸã§ãã¹ã¿ãŒãŸãã¯ä»ã®äººã«ããŠã³ããŒãã§ããããã«ããŸãã ãããè¡ãã«ã¯ãã¢ã»ã³ããªåŸã®ã¿ã¹ã¯ãè¿œå ããä¿åãããã¡ã€ã«ã®åœ¢åŒãæå®ããŸãã åããŠã¿ã¹ã¯ãäœæãããšããæ£èŠè¡šçŸåœ¢åŒã䜿çšããŠç®çã®ãã¡ã€ã«ãæ€çŽ¢ããããšæ³å®ããŸããããJenkinsã¯Antãã¹ã¹ã¿ã€ã«ã䜿çšããŠãã¡ã€ã«ãæ€çŽ¢ããããšãããããŸããã ããã©ã«ãã§ã¯ããã¹ãŠã®ãã¡ã€ã«ãæ¡åŒµå.apkã§ä¿åããããšãææ¡ãããŠããŸãããã»ãšãã©ã®ãã¡ã€ã«ã¯å¿ èŠãªããããdebug.apkããã³release.apkã§çµãããã¡ã€ã«ã®ã¿ãä¿åããŸãã
build.gradleã¹ã¯ãªããã䜿çšããŠçœ²åä»ãapkããã«ããã
Google Playã§ã¢ããªã±ãŒã·ã§ã³ãå ¬éããã«ã¯ã.apkãã¡ã€ã«ã«ç¹å¥ãªããŒã§çœ²åããå¿ èŠããããŸã ã ãã¡ã€ã«ãžã®ãã¹ãæå®ããŠAndroid Studioã䜿çšããŠçœ²åããå Žåãbuild.gradleã¹ã¯ãªãããããããè¡ãæ¹æ³ãåŠã¶å¿ èŠããããŸãã 次ã«ãæãåçŽãªäŸãšãããæ¹åããæ¹æ³ãæ€èšããŸãã ããŒãããŒãžã§ã³ç®¡çäžã«çœ®ãããã«ãã¹ã¯ãªããããåç §ããã ãã§ååã§ãã ãããå®è£ ããæ¹æ³ã®äŸã次ã«ç€ºããŸãã
android { signingConfigs { release { keyAlias 'KEY_ALIAS' keyPassword 'KEY_PASSWORD' storeFile file('RELATIVE_PATH_TO_KEYSTORE') storePassword 'STORE_PASSWORD' } } ... buildTypes { release { signingConfig signingConfigs.release } } }
ãã®ãœãªã¥ãŒã·ã§ã³ã®æ¬ ç¹ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ãªãªãŒã¹ããŒãžã§ã³ãæ§ç¯ããããã®ãã¹ã¯ãŒãã ãã§ãªãããã©ã€ããŒãããŒãããŒãžã§ã³ç®¡çäžã«ä¿åãããããšã§ãã å°æ¥çã«ããŒãåé€ããŠbuild.gradleã¹ã¯ãªãããä¿®æ£ããå Žåã§ããã³ãããã®å±¥æŽãæãäžããŠèª°ãããã®æ å ±ã埩å ããå¯èœæ§ãããããšã«æ³šæããŠãã ããã ããé©åãªè§£æ±ºçã¯ãããŒãžã§ã³ç®¡çäžã«ãªããããšãã°ãå¿ èŠãªãã¹ãŠã®ãã©ã¡ãŒã¿ãŒãæžã蟌ãŸããã/ããŒã ãã£ã¬ã¯ããªã«ããããããã£ãã¡ã€ã«ãä¿æããããšã§ãã
ããšãã°ããããžã§ã¯ãã§ã¯æ¬¡ã®ã¢ãããŒãã䜿çšããŸãã ããŒãžã§ã³ç®¡çã«èšå®ãã¡ã€ã«ãšçœ²åãã¡ã€ã«ããããŸããã éçºè ã¯èªåãã¡ã®æãæã£ãŠããŸãã ãããã£ãŠãããã«åŸããªã人ãã¢ããªã±ãŒã·ã§ã³ã«çœ²åã§ãããšããåé¡ã解決ããŸãã Jenkinsèªèº«ãã¢ããªã±ãŒã·ã§ã³ã«çœ²åã§ããããã«ãåé¡ã解決ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã«çœ²åãããšãã«ã2ã€ã®å Žæã§ãã¡ã€ã«ã確èªããŸãã æåã¯ãããžã§ã¯ãã®ã«ãŒããã£ã¬ã¯ããªã§ãã 2çªç®ã¯ããã®ãã¡ã€ã«ãä¿åããããšãäºæ³ããããµãŒããŒäžã®ç¹å®ã®å Žæã§ãã 次ã«ããã®ãã¡ã€ã«ãjenkinsãµãŒããŒã«æ·»ä»ããã¢ããªã±ãŒã·ã§ã³ã®çœ²åä»ãããŒãžã§ã³ãåéããæ©äŒãåŸãŸãã ãããã©ã®ããã«å®è£ ãããŠãããã®gradleã¹ã¯ãªããã®äŸã次ã«ç€ºããŸãã
android { ... signingConfigs { if (rootProject.file("release.properties").exists() || new File("/home/ubuntu/release.properties").exists()) { def properties = new Properties() def fileToLoad = rootProject.file("release.properties").exists() ? new FileInputStream(rootProject.file("release.properties")) : new FileInputStream("/home/username/release.properties") properties.load(fileToLoad) release { keyAlias properties.keyAlias keyPassword properties.keyAliasPassword storePassword properties.keyStorePassword storeFile rootProject.file('keystore.jks') } } } ... buildTypes { release { if (signingConfigs.hasProperty("release")) signingConfig signingConfigs.release } } }
Fabricã«ãã¹ããã«ããå ¬éãããã¹ã¿ãŒã«ââèŠåãã
Fabricã¯ãã¢ããªã±ãŒã·ã§ã³ã®ã¯ã©ãã·ã¥ã¬ããŒããäœæããããã®åªããã·ã¹ãã ã§ãã æšæºã®Googleã¢ããªãã£ã¯ã¹ã䜿çšããŠã¯ã©ãã·ã¥ãæ§ç¯ããå Žåããã¡ããªãã¯ãŸãã¯ãã¡ã€ã€ãŒããŒã¹ã調ã¹ãããšã匷ããå§ãããŸãã Fabricã䜿çšããã«ã¯ãjenkinsãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã
ãžã§ã³ãã³ã®èšå®ïŒãžã§ã³ãã³ã®ç®¡çïŒâãã©ã°ã€ã³ã®ç®¡çïŒãã©ã°ã€ã³ã®ç®¡çïŒã¿ã䜿çšå¯èœããã¡ããªãã¯ãšå ¥åããŸãã Fabric Beta Publisherã«èå³ããããŸãã ã€ã³ã¹ããŒã«ããããã¿ã¹ã¯ã®èª¬æã«æ»ã£ãŠå¥ã®ã¿ã¹ã¯ãè¿œå ããŸãã
Fabric_api_keyãšsecret_keyãæå®ãããã¹ã¿ãŒçšã«ã¢ããããŒãããã¢ããªã±ãŒã·ã§ã³ã®.apkãã¡ã€ã«ãžã®çžå¯Ÿãã¹ãæå®ããå¿ èŠããããŸãã ãããã®å€ã¯ãå人ã¢ã«ãŠã³ãã§è¡šç€ºã§ããŸãã èšå®âçµç¹â{Your_app_name}âAPI_KEYãBuild Secretã
ããã«ããã¹ã¿ãŒã«ââéç¥ãéä¿¡ã§ããŸãã é»åã¡ãŒã«ãšãã¹ã¿ãŒã®ã°ã«ãŒãã®äž¡æ¹ãæå®ã§ããŸãã ã°ã«ãŒãã管çããæ¹æ³ã¯ãããªãèªèº«ãæé«ã®ããšãããããèªèããã§ãããã ããšãã°ãdevãproductionã®2ã€ã®ã°ã«ãŒãã䜿çšããããšã奜ã¿ãŸãã ãã¹ãŠã®ãã¹ãã¢ããªã±ãŒã·ã§ã³ãã«ãã¯devãã¹ã¿ãŒã°ã«ãŒãã«éç¥ããGoogle Playã«ã¢ããããŒãããããã«ãã¯ãããã¯ã·ã§ã³ãã¹ã¿ãŒã°ã«ãŒãã«éç¥ããŸãã
ããã«ãã¢ã»ã³ããªãäºãã«äœããã®åœ¢ã§ç°ãªãå Žåããã¹ã¿ãŒåãã®ãã«ãããŒãã§ãã®æ å ±ãæå®ããå¿ èŠããããŸãã ããã¯ãç°å¢å€æ°ãšããã®æ å ±ãå ¥åããã¹ã¯ãªããã䜿çšããŠè¡ããŸãã
ç§ãã¡ã®ãããžã§ã¯ãã¯ã次ã®ã¢ãããŒãã«åŸããŸãã ãªãªãŒã¹æå»ã«ãªããšãdelivery_xxãã©ã³ããmasterãã©ã³ãããäœæãããŸããxxã¯ã¹ããªã³ãçªå·ã§ãã æ®å¿µãªããããžã§ã³ãã³ã¹ã¯ããã©ã«ãã§ãã©ã³ãããã¢ã»ã³ããªãã¢ã»ã³ãã«ããæ¹æ³ãç¥ããŸããããã©ã³ãåã¯å€æŽã§ããŸãã ãããèªåã§æããªããã°ãªããŸããã
ãããè¡ãã«ã¯ãå¥ã®ãã©ã°ã€ã³EnvInjectãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã ãã®åŸãã¿ã¹ã¯ãã¥ãŒã«æ»ããæ°ãããªãã·ã§ã³ãèšå®ããŸã-å®è¡ã®ããã®ç°å¢ãæºåããŸãã ãã®ãã©ã°ã€ã³ã®ãããã§ãgroovyã¹ã¯ãªãããå®è¡ããå¿ èŠãªçµæããã¹ãŠç°å¢å€æ°ã«ä¿åã§ããŸãã
ãã®å Žåããªããžããªãããã©ã³ãã®ãªã¹ããååŸããååãdeliveryã§å§ãŸããã©ã³ããèŠã€ããå¿ èŠããããŸãã ãŸããã¢ããªã±ãŒã·ã§ã³ãã©ã®ãã©ã³ããããã«ãããããããã¹ã¿ãŒãç¥ãããã«ããã¹ã¿ãŒçšã®ãã«ãããŒããã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã ãã®ã¹ã¯ãªããã¯æ¬¡ã®ããã«ãªããŸãã
def gitURL = "git@github.com:[your_repo_url]" def command = "git ls-remote -h $gitURL" def proc = command.execute() proc.waitFor() if (proc.exitValue() != 0) { println "Error ${proc.err.text}" } def branch = proc.in.text.readLines() .collect { it.replaceAll(/[a-z0-9]*\trefs\/heads\//, '')} .find { it.startsWith("delivery")} if (branch == null) { def build = Thread.currentThread().executable build.doStop() return 0 } def map = [BRANCH: branch, FABRIC_RELEASE_NOTES: "$branch"]
ééããªããããã§ç¹å®ã®ã±ãŒã¹ã«å¿ èŠãªããžãã¯ãè¿œå ã§ããŸãã
次ã«ãã¢ã»ã³ããªãå®è¡ããããã©ã³ãã®ååãä¿®æ£ããŸãã
ãããŠãäžã®ã¹ã¯ãªãŒã³ã·ã§ããã«ç€ºãããã«ããã¡ããªãã¯ã®ã¢ããªã±ãŒã·ã§ã³å ¬éãããã¯ãæŽæ°ããŸãã
ããã§ãèšäºã®åé ã§èª¬æããã»ãŒãã¹ãŠã®ãã€ã³ããå®è¡ã§ããGoogle Playã§ã¢ããªã±ãŒã·ã§ã³ã®æçµã¢ã»ã³ããªãå ¬éããæ¹æ³ãåŠç¿ããå¿ èŠããããŸãã
Google Playã«å ¬é
Jenkinsã䜿çšããŠGoogle Playã§ã¢ããªã±ãŒã·ã§ã³ãå ¬éããããã®ãã©ã°ã€ã³ããã§ã«æºåããŠããŸãã å ¥ããŠãã ããïŒ Google Play Android Publisherãã©ã°ã€ã³ ã 次ã«ãGoogle Playã§ã¢ããªã±ãŒã·ã§ã³ãå ¬éããç¹å¥ãªãµãŒãã¹ã¢ã«ãŠã³ããäœæããå¿ èŠããããŸãã ãããè¡ãã«ã¯ã次ã®æé ãå®è¡ããŸãã
- ã¢ã«ãŠã³ãææè ã®äžã§éçºè ã³ã³ãœãŒã«ã«ã¢ã¯ã»ã¹ããŸãã
- èšå®âAPIãžã®ã¢ã¯ã»ã¹ã
- [ãããžã§ã¯ãã®äœæ]ãã¯ãªãã¯ããŸãã
- [ã¢ããªã±ãŒã·ã§ã³ã¢ã«ãŠã³ãã®äœæ]ãã¯ãªãã¯ããŸãã
- ãªã³ã¯ããã©ã£ãŠãã ããã
- ããããããŠã³ãªã¹ãã§[ç·šé]ãã¯ãªãã¯ããã¢ã«ãŠã³ãåãå¿ èŠãªååïŒããšãã°ããJenkinsãïŒã«å€æŽããŸãã
- ããããããŠã³ãªã¹ãã§ããããŒãäœæããéžæããããŒã®çš®é¡ãJSONããéžæããŸãã
- ã¯ãªãã¯ããŠããŒãäœæããŸãã
- ãã¡ã€ã«ã¯èªåçã«ããŠã³ããŒããããåŸã§ã¢ããªã±ãŒã·ã§ã³ãå ¬éããããã«ãã©ã°ã€ã³ã®ããããããŒã³ã³ãœãŒã«ã§èªèšŒã«äœ¿çšãããŸãã
åçã®åããã®ïŒ
次ã«ãäœæãããµãŒãã¹ã¢ã«ãŠã³ãã«å¯ŸããŠéçºè ã³ã³ãœãŒã«ã§é©åãªã¢ã¯ã»ã¹ãçºè¡ããã¢ããªã±ãŒã·ã§ã³ãå ¬éããå¿ èŠããããŸãã ãããè¡ãã«ã¯ã次ã®æé ãå®è¡ããŸãã
- éçºè ã³ã³ãœãŒã«ã«æ»ã
- äœæããã¢ããªã±ãŒã·ã§ã³ã¢ã«ãŠã³ãã«ã€ããŠã¯ããå ±æããã¯ãªãã¯ããŸã
- äœæããã¢ããªã±ãŒã·ã§ã³ã¢ã«ãŠã³ãã«ã€ããŠã¯ããå ±æããã¯ãªãã¯ããŸã
- ã¢ããªã±ãŒã·ã§ã³æ å ±ãå€æŽããã¢ããªã±ãŒã·ã§ã³ã®è£œåçãã¢ã«ãã¡çãããã³ããŒã¿çã管çããæš©éãããããšã確èªããå¿ èŠããããŸã
- è¿œå ãã¯ãªãã¯ããŸã
åçã®åããã®ïŒ
ããã§ãéçºè ã³ã³ãœãŒã«ãçµäºããJenkinsã®æ§æã«é²ãã§ã¢ããªã±ãŒã·ã§ã³ãå ¬éã§ããŸãã
- ãžã§ã³ãã³ã¹ã«è¡ã
- ã¡ãã¥ãŒé ç®ãè³æ Œæ å ±ããéžæããŸã
- å ±æã¢ã¯ã»ã¹ãéžæãããè³æ Œæ å ±ã®è¿œå ããã¯ãªãã¯ããŸã
- ã¢ã¯ã»ã¹ã®ã¿ã€ããéžæããŸãïŒããã©ã€ããŒãããŒããã®GoogleãµãŒãã¹ã¢ã«ãŠã³ãã
- android-publishãªã©ã®ã¢ã¯ã»ã¹åãå ¥åããŸãïŒã¿ã¹ã¯èšå®ã§åŸã§äœ¿çšãããŸãïŒ
- ã¿ã€ããJSONããŒããéžæããŸã
- 以åã«ãJSONããŒããããŠã³ããŒããããã¡ã€ã«ãããŠã³ããŒãããŸã
- [OK]ãã¯ãªãã¯ããŠã¢ã¯ã»ã¹ãäœæããŸã
åçã§ãåãããšïŒ
次ã«ãã¿ã¹ã¯ãã¥ãŒã«ç§»åããã¢ã»ã³ããªåŸã®ã¹ããã-Android APKãGoogle Playã«ã¢ããããŒãããŸãã
åã«è¿œå ãããã®ã¹ãããã®è³æ Œæ å ±ãæå®ããå¿ èŠããããŸãã apkãã¡ã€ã«ãšæ å ±ãžã®ãã¹ã«å ããŠããã®ããŒãžã§ã³ã«è»¢éããå¿ èŠããããŠãŒã¶ãŒã®å²åãæå®ããŸãã ããã¯ãæåã¯100ïŒ ã«ãªãå¯èœæ§ããããŸãã ãŸããã¢ããããŒããã.apkãã¡ã€ã«ã®ããŒãžã§ã³ã瀺ãå¿ èŠããããŸãã jenkinsãä»ããŠã¢ã«ãã¡çãããŒã¿çã補åçãå ¬éã§ããŸãã ãã®åŸãã¿ã¹ã¯ãå®å šã«å®è¡ãããžã§ã³ãã³ã¹ããã¹ãŠã®æ¥åžžçãªäœæ¥ãè¡ã£ãŠãã¢ããªã±ãŒã·ã§ã³ãçµã¿ç«ãŠã眲åãããããå ¬éãããŸã§ãèªåã§ãè¶ã飲ãããšãã§ããŸãã
éèŠãªã¿ã¹ã¯ãä¿è·ãã
ããã§ãã¿ã¹ã¯ãäœæã§ãããã¹ã¿ãŒã«ââã¢ã¯ã»ã¹ã§ããããã«ãªãããã¹ã¿ãŒèªèº«ãå¿ èŠãªãšãã«ã¢ããªã±ãŒã·ã§ã³ã®ã¢ã»ã³ããªãæ§ç¯ã§ããŸãã åœç¶ãQAã誀ã£ãŠã¢ããªã±ãŒã·ã§ã³ãå ¬éããããšã¯æãŸãããããŸããã 次ã®ããã«é²ããããšãææ¡ããŸãã
ã¢ããªã±ãŒã·ã§ã³ã®å ¬éãå¥ã®ã¿ã¹ã¯ã«ç§»åããQAããã¢ã¯ã»ã¹ããŠãã®ã¿ã¹ã¯ãèµ·åããå¿ èŠããããŸãã
- Jenkinsèšå®âã°ããŒãã«ã»ãã¥ãªãã£ã®èšå®ã«ç§»åããŸã
- ãèªå¯ãããããã¯âããããžã§ã¯ãããŒã¹ã®ãããªãã¯ã¹èªå¯æŠç¥ããéžæ
- ããã«ãŠãŒã¶ãŒåãè¿œå ããå©çšå¯èœãªãã¹ãŠã®ã¢ã€ãã ãå ¬éããŸãã ãã®ç¹ã説æããªããšããžã§ã³ãã³ããã®ã¢ã¯ã»ã¹ãæåŠããããšã«ãªããŸãïŒããã§ã解決ããªãå Žåã¯ã ãã¡ãã®è§£æ±ºçãåç §ããŠãã ãã ïŒã
- 次ã«ãQAãŠãŒã¶ãŒåãè¿œå ããå¿ èŠãšæãããæš©éãèšå®ããŸãã 圌ã«ã¿ã¹ã¯ãå®è¡ãããªãããšãéèŠã§ãã ãããã¯ãã¿ã¹ã¯ããã¢ã€ãã ããã«ãã
- ãã®åŸãQAãžã®ã¢ã¯ã»ã¹ãèš±å¯ããã¿ã¹ã¯ã«é²ã¿ãé©åãªã¢ã¯ã»ã¹ãèš±å¯ããŸãã
ããã§ãQAã誀ã£ãŠã¢ããªã±ãŒã·ã§ã³ãGoogle Playã«å ¬éããããšãã§ããªããªããŸãã
ããããããã ãã§ãã ã¢ããªã±ãŒã·ã§ã³ã®èªåã¢ã»ã³ããªãšå ¬éãããã«æ¹åããããšãã§ããŸãããããã¯ãã®ãã¥ãŒããªã¢ã«ã®ç¯å²å€ã§ãã
PS Jenkinsãä»ã®CIãµãŒããŒãšæ¯èŒããã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã«åæ§ã®ã¢ã€ãã ãå®è£ ããæ¹æ³ã確èªããããšãèå³æ·±ãã§ãããã ãŸããã¿ã¹ã¯ãç¡æã®æ§æãšããŠã§ã¯ãªããPipeLineã䜿çšããŠèšèšããããšããããããã®ã§ãããã¥ã¡ã³ãã§æ§æå šäœãèšè¿°ã§ããŸããããã¯ããŒãžã§ã³ç®¡çäžã«çœ®ããããããžã§ã¯ãã§åçã«å€æŽãããŸãã