├── Dockerfile └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jenkins 2 | USER root 3 | 4 | # Update repos 5 | RUN apt-key update && apt-get update && apt-get -y --force-yes upgrade 6 | 7 | # Install android AAPT dependencies 8 | RUN apt-get -y --force-yes install make lib32stdc++6 lib32z1 g++ 9 | 10 | # Debian config for Infer 11 | RUN apt-get update && \ 12 | apt-get install -y --no-install-recommends \ 13 | build-essential \ 14 | curl \ 15 | git \ 16 | groff \ 17 | libgmp-dev \ 18 | libmpc-dev \ 19 | libmpfr-dev \ 20 | m4 \ 21 | ocaml \ 22 | python-software-properties \ 23 | rsync \ 24 | software-properties-common \ 25 | unzip \ 26 | zlib1g-dev 27 | 28 | # Install OPAM for Infer 29 | RUN curl -sL \ 30 | https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux \ 31 | -o /usr/local/bin/opam && \ 32 | chmod 755 /usr/local/bin/opam 33 | RUN opam init -y --comp=4.01.0 && \ 34 | opam install -y extlib.1.5.4 atdgen.1.6.0 javalib.2.3.1 sawja.1.5.1 35 | 36 | # Download Infer 37 | RUN INFER_VERSION=$(curl -s https://api.github.com/repos/facebook/infer/releases \ 38 | | grep -e '^[ ]\+"tag_name"' \ 39 | | head -1 \ 40 | | cut -d '"' -f 4); \ 41 | cd /opt && \ 42 | curl -sL \ 43 | https://github.com/facebook/infer/releases/download/${INFER_VERSION}/infer-linux64-${INFER_VERSION}.tar.xz | \ 44 | tar xJ && \ 45 | rm -f /infer && \ 46 | ln -s ${PWD}/infer-linux64-$INFER_VERSION /infer 47 | 48 | # Build Infer 49 | RUN cd /infer && ./build-infer.sh java 50 | 51 | # Final docker user is going to be jenkins 52 | USER jenkins 53 | 54 | # Setup Infer environment variable 55 | ENV PATH /infer/infer/bin/:$PATH -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jenkins-Android-Infer 2 | A Docker image for Jenkins with support for generating Android builds and run Infer 3 | 4 | Blog post on this: 5 | https://medium.com/@Rapchik/static-analysis-build-server-for-android-with-jenkins-using-docker-bda888d4b34e#.bqc6m6a8j 6 | --------------------------------------------------------------------------------