2. AGENDA
▸ What Jenkins
▸ Why Jenkins
▸ Work flow
▸ Install Jenkins
▸ First Job
▸ Integration with SCM
▸ Set up with Android
▸ Run Test
▸ Build
▸ Deploy to internal/production EVN
▸ Reporting
▸ Notify to slack
▸ What’s next?
▸ Jenkins pipeline
15. JENKINS CREDENTIALS
▸ Credentials -> global -> add credentials
▸ Credentials type
▸ user name & password
▸ ssh
▸ others
▸ ssh
▸ generate ssh key
▸ set user name
▸ set private key path
▸ set passphrase
▸ upload ssh public key to git server
16. INTEGRATION WITH GITHUB WEB HOOK
▸ Jenkins -> 管理理 Jenkins -> 管理理外掛程式
▸ 可⽤用的 -> Github Integration Plugin 勾選安裝
▸ 建置觸發程序 GitHub hook trigger for GITScm polling 勾選
▸ GitHub repo -> setting -> integration services
▸ add service -> Jenkins (Github plugin)
▸ set up jenkins web hook path
https://jenkins_domain_name/github_webhook/
▸ active 勾選
▸ 如何驗證測試
▸ push commit 到指定的 branch
▸ 在 job 選單點選 Github Hook Log
17. SET UP WITH ANDROID
▸ Set up Java
▸ 管理理 Jenkins -> Global Tool Configuration
18. SET UP WITH ANDROID
▸ Set up gradle
▸ 管理理 Jenkins -> Global Tool Configuration
19. SET UP WITH ANDROID
▸ Run gradle script
▸ 建置 -> Invoke Gradle Script
▸ 能⽤用的 task 有哪些 ./gradlew tasks
20. SET UP WITH ANDROID
▸ Set up ANDROID_HOME
▸ 管理理 Jenkins -> 設定系統
▸ 環境變數 ANDROID_HOME
21. RUN TEST
▸ Unit test report
▸ https://jenkins_url/job/job_name/report_path/
index.html
23. DEPLOYMENT
▸ Fabric beta (internal for QA)
▸ jenkins plugins -> Fabric Beta Publisher
▸ beta api key / build secret
▸ APK path
▸ Notify tester
▸ Beta Group
▸ Release
▸ change log
▸ file
▸ parameter
▸ Google play (for production)
24. DEPLOYMENT
▸ Google play (for production)
▸ 需要 google play 的 owner 帳號設定
▸ generate credentials
▸ google play console -> api 存取權 (owner)
▸ download credentials json file
▸ create google console user by json file
client_email
▸ 權限設定為發佈者
25. DEPLOYMENT
▸ Google play (for production)
▸ Install jenkins plugin -> Google Play Android
Publisher Plugin