Giter Site home page Giter Site logo

reancool / docker-jenkins-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bertrandmartel/docker-jenkins-android

0.0 0.0 0.0 3.41 MB

:whale: A jenkins docker image for Android development

Home Page: https://hub.docker.com/r/bertrandmartel/docker-jenkins-android

License: MIT License

Shell 100.00%

docker-jenkins-android's Introduction

Jenkins Docker image for Android dev

Build Status

A jenkins docker image with Android SDK/NDK global install and the following pre-installed plugins :

Other packages are also downloaded to build Android applications correctly

Run

docker run -p 8080:8080 -p 50000:50000 \
           -v /home/user/Android/sdk:/opt/android/sdk \
           -v /home/user/Android/ndk:/opt/android/ndk \
           -v your_home/jenkins_home:/var/jenkins_home bertrandmartel/docker-jenkins-android

Environment variables

Variable name description sample value
ANDROID_SDK Android SDK release name r25.2.2
ANDROID_NDK Android NDK release name android-ndk-r12b
ERASE_ANDROID_SDK clear SDK directory before installing a new one 1 or 0
ERASE_ANDROID_NDK clear NDK directory before installing a new one 1 or 0
ANDROID_BUILD_TOOLS_FILTER additionnal build tools versions to install comma separated 23.0.2,23.0.3
SSL_CERT path to certificate (*)
SSL_KEY path to key file (*)
SSL_DEST path for the newly created JKS from the certs above (*)
SSL_NEW_PASS newly created keystore password (*)

(*) required only if using certificates instead of JKS (working with letsencrypt certs)

Example :

docker run -p 8080:8080 -p 50000:50000 \
           -e "ANDROID_BUILD_TOOLS_FILTER=23.0.2,23.0.3" \
           -e "ANDROID_SDK=r25.2.2" \
           -e "ANDROID_NDK=android-ndk-r12b" \
           -v /home/user/Android/sdk:/opt/android/sdk \
           -v /home/user/Android/ndk:/opt/android/ndk \
           -v your_home/jenkins_home:/var/jenkins_home bertrandmartel/docker-jenkins-android

docker-compose

https configuration is enabled by default with keystore.jks in a keys directory :

docker-compose up

docker-cloud

Edit vars-template.sh configuration, then :

source vars-template.sh

envsubst < stackfile-template.yml > stackfile.yml

docker-cloud stack create --name jenkins -f stackfile.yml

docker-cloud start jenkins

Debug

docker exec -it jenkins_image bash

Configure Giltab oauth

  • In your Gitlab domain go to Admin > Application

Create a new application with a chosen name and a redirection URI like this :

  • https://your-jenkins-domain:8083/securityRealm/finishLogin

Then, you will have generated Application ID (client ID) and Secret (Client Secret) :



  • Go to Manage Jenkins > Configure Global Security

Fill up checking Gitlab Authentication Plugin in Access control :


Now, Jenkins user will be authenticated via Gitlab

Configure Giltab push trigger

In Manage Jenkins > Configure System :

Gitlab URL is : https://<your host>:<your port>


Enter a Gitlab API Token that you got from Gitlab in Profile Settings > Access Tokens :


In your job configuration, Set GitLab connection and Git repository config as :

  • Repository URL : git@server/repo.git
  • Name : origin
  • RefSpec : +refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
  • Branch specifier : origin/${gitlabSourceBranch}


In Build Trigger, set Build when a changed is pushed to Gitlab :


In your gitlab repository go to Webhooks :

Then, set the webhook URL as : https://<jenkins-host>:<port>/project/<your job> :


Configure Giltab Logo

In Manage Jenkins > Configure System :

Endpoint URL is : https://<your-gitlab-host>:<port>/api/v3


Configure Slack notifications


In your job configuration, add a Slack Notification Post Build Action :


External Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.