Self-contained Jenkins for Docker
- Go to the project directory.
- Build docker image with Jenkins.
docker build -t myjenkins .
- Run docker container with mounting jenkins_home volume on docker host local storage.
docker run -d --name jenkins-master -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home myjenkins
Connect to running Jenkins container.
docker exec -i -t jenkins-master /bin/bash
Remove jenkins_home volume on docker host local storage.
docker volume rm jenkins_home
For correct use the android sdk tools for multithreading builds android projects, you must declare
ANDROID_HOME
in the project workspace directory.
For setup Android SDK to your current workspace
env.ANDROID_HOME="${pwd()}/android-sdk" (/android-sdk is automatically created in the workspace)
sh "android-sdk-producer android-sdk_r24.4.1-linux.tgz"
For updating Android SDK packages inside your workspace
sh "android-update-sdk --components=platform-tools,tools,build-tools-24.0.2 --accept-licenses=android-sdk-license-.+"
Example Jenkinsfile for Android projects