More Related Content Similar to CI/CD for android (20) CI/CD for android13. brew install jenkins
Updating Homebrew…
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
terragrunt
==> Downloading http://mirrors.jenkins.io/war/2.112/jenkins.war
==> Downloading from http://ftp-chi.osuosl.org/pub/jenkins/war/2.112/jenkins.war
####################################################### 100.0%
==> jar xvf jenkins.war
==> Caveats
Note: When using launchctl the port will be 8080.
To have launchd start jenkins now and restart at login:
brew services start jenkins
Or, if you don’t want/need a background service you can just run:
jenkins
brew install jenkins
Updating Homebrew…
brew install jenkins
Let’s install Jenkins
14. Start Jenkins
brew services start jenkins
==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)
brew services start jenkins
22. First, Some Terminology
Job/Project: Any tasks that you configure Jenkins to run
Build: Result of one run of a job
Build Trigger: How the build is started
Build Step : An action performed by the build, such as run a command
Post Build Action: What to do when build completes
Workspace: Temporary working directory used for building a job
Plugin: Extend the functionality of Jenkins (core or 3rd party plugins)
Pipeline: Define an entire job with a script
24. Plugins
• Build Monitor View
• Simple Theme
• Slack Notification
• Slack Upload
• JIRA Trigger
• Google Play Android Publisher
• Android APK Size Watcher
• Blue Ocean And Pipeline
•••
25. Pipeline
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
environment
dockerfile
parameters
options
triggers
when
...
Alternatives
28. GITLAB CI/CD
Gitlab Gitlab CI Runner
Git Push
Pull App image
from Gitlab Registry
Application Build & Test
ON Docker Container
30. Pipeline
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
Editor's Notes test test test