????Jenkins???
????Jenkins?з????????????????????????????
??????????iOS/Android??????????????????????????????????
????· GIT plugin
????· SSH Credentials Plugin
????· Git Changelog Plugin: ??????????commit log
????· build-name-setter?????????Build????
????· description setter plugin???????????Build???????????????????????????QRCode???????
????· Post-Build Script Plug-in????????????????н??????Щ??????
????· Xcode integration: iOS?????????
????· Gradle plugin: Android?????????
??????????????????????Jenkins?????????????????????????????????ɡ?
?????????????Job??
??????Jenkins?У??????????Job????????????????????????????????Job??????????????п????ж???????????п????????????й??????????????????????????Job??
????????Job?????ж????????????????Freestyle project???????ɡ?
????Main page -> New Item -> Freestyle project
???????????????????????????δ??????4?????????????????????????й?????????????????????????Job????????????????á?
????????Git??????
?????????????й????????????????????????????????????????????й???GitHub??в???У????????????Git???????á?
???????Source Code Management??????????£??????GIT plugin??????????????Git??
????????Git?????????????????????????????URL?????Repository URL??????????У?鷽???Credentials??????????Job????????????????Branches to build????
??????????Repository URL??????HTTPS URL??SSH URL???ɡ???????????????Credentials???Repository URL???????????
????· ???Repository URL??HTTPS URL?????????Credentials?????GitHub??????????У?鷽?????????????GitHub?п?????2FA??two-factor authentication??????????????GitHub?д??????Personal access token????????????????Personal access token??????????????
????· ???Repository URL??SSH URL????????????????Jenkins??????????????????SSH?????????????????GitHub??SSH keys?У????????дCredentials??????SSH Username with private key??У?鷽???????GitHub Username??SSH???????????SSH???????????Passphrase??
?????????Git???У??????????????????ο??????????Git???У?頃??
??????????Branches to build??????????????????????????????branchName????tagName??commitId??????з?????????????????磬???????master?????????дrefs/heads/master?????????develop?????????дrefs/heads/develop??
???????????????Git?????????????????????????????????????????Jenkins??????????????????
?????????????????????clone?????y???????
??????Jenkins??????????У?clone??????????????????汾?????????????????????10?????????????Щ????У?????????????????????汾?????????????繃???????????Jenkins?????????10???????????????д??????????????????????????????143????
??????????????????????????????????·???????????????????????汾??????????????????????????Advanced clone behaviours?У?
????· Shallow clone??????????????汾??
????· Timeout (in minutes) for clone and fetch operation?????ú?????????????
???????ù?????????
?????????????ú??????ζ??Jenkins?????????GitHub??????????????????????????
??????Jenkins???????й??????
????????????ù????????????????????????????????λ???Build Triggers???????
???????????????????????????У?
????· ??????й?????Build periodically??
????· ?????????й?????Build when a change is pushed to GitHub??
????· ???????????£????и???????й?????Poll SCM??
????????????????????????????????????????????????????????????????й?????????????????????????????Jenkins Job?????????????????????????????Build Now????????????
??????????????Schedule???????????????£?
????MINUTE HOUR DOM MONTH DOW
????· MINUTE: Minutes within the hour (0-59)
????· HOUR: The hour of the day (0-23)
????· DOM: The day of the month (1-31)
????· MONTH: The month (1-12)
????· DOW: The day of the week (0-7) where 0 and 7 are Sunday.
??????????????????????????????????????operator?????????????£???
????· *??????????Ч???????????????????*?λ??
????· M-N???????Χ??????7-9????7/8/9??????
????· M-N/X??*/X????X???????
????· A??B??C??????????
???????????????????????????????????????????????????????????H????????H?????Jenkins???????????????????????????????????????????趨???????????????????????????????????????Jenkins???????????????????????????????????????
??????????????о?????????
????· H/15 * * * *?????????15??????????????????????С???????:07??:22??:37??:52???????С???????:03??:18??:33??:48??
????· H(0-29)/10 * * * *?????????С??????10??????????????????????С???????:04??:14??:24???????С???????:09??:19??:29??
????· H 23 * * 1-5???????????23:00??23:59??????????
???????ù??????
???????????????ú????Jenkins?????趨??????????й????????????й????????????????????????ù?????????????趨??
??????????????????????????????????????????????????????????????????????磬???????Android???????Gradle plugin??????????Invoke Gradle script????????Gradle???й????????????iOS???????Xcode integration?????????????Xcode????????Xcode???й?????
?????????????????????????UI??????????????????????????????????????????????????????????е????????????????????????????????????????????????????????????????Щ?????????????Щ??????????Щ???????汾??XCode?汾?????????????????????????????
??????????????????????????????????д?????????????????????????е??????????????Execute Shell????С??????????????????????????????????????????????????????п????????
????????????iOS??????????????????????????????????????????á?
????????????Xcode integration??????й?????????????????????Jenkins?е???????飬????д??????????????????????????????й?????????????????????Jenkins?????е??????а???????????飬?????????Shell???????????????????Jenkins????д??????????????????
????????????
????????????????????????ipa/apk????λ??????????С???????????????????а??ipa/apk?????????鷳??????????????????????ü????????????д??????????????????????????????????????????????????????????PP???????????????а????
???????????????????????????????pgyer????fir.im????????ipa/apk???????????????????????????????????????????з?????????????????????????????????????Ч????????????????
?????????????????????????
??????????????????fir.im?????ж????Jenkins??????????????????Post-build?????????????????
???????????Jenkins?????fir.im???????????????????????????HTTP Post????????????
????????????????????????????????????????????н??е??á??????????棬????????????????????????????????????繃????????????????????????
????Jenkins???????????????pgyer/fir.im????????????????????????????н?????URL?????????з????
?????????????
?????????????URL????????????????????????????????Jenkins?????????????б??????
??????????????????????????description setter plugin??????ò???????Post-build Actions??????л???description setter??????????????????????????build????????????????????????????????build????У???????????????????б??С?
????????????????????????????????????б???ò???????????????????????????HTML??img???????<img url='qr_code_url'>д??build????????С?
??????????????·???????????????????????????????????Ч????
???????????Jenkins?????????????????????????Markup Formatter?????????Plain text????????????????????build????????е?HTML??????н??????
????????????????Manage Jenkins -> Configure Global Security????Markup Formatter??????????Safe HTML???ɡ?
???????????ú??????????build????????в???HTML??img????????????
??????????????????????????????????pyger?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????URL??????????????????н??з??????????????£???????ι?????????????????URL??????????????
????????????????????????????????????????????????????????????????浽??????????build??????????????????Jenkins??????ɡ?
???????????????Artifacts??
??????????????????????????????????????????е??????????????????
???????????£???????????????е?????????????.ipa/.app/.plist/.apk????????????????????????????????????????????????????????????????????????
??????????????????????????Post-build Actions???????????Archive the artifacts???????Files to archive?????????????????????????·????
??????????????ι???????Jenkins????Console Output?в????趨??????????????????????????????????????????????????
???????
????????????????????Jenkins??iOS/Android??????????????????????????????????????????????漰???????????????????build.py???????Jenkins????????????????????????????????????????????н???????????
??????????????????伴??????Jenkins?????????????????????????γ??????壬????????Jenkins?У???????????????????????????????????????????????????????????????????????????????????????Ч????