diff --git a/Makefile b/Makefile index 7d73feee4a90ada7c500ce89f127279f750cf617..f780e23a3583152e12cd29507484e1c9b19eaaa6 100644 --- a/Makefile +++ b/Makefile @@ -19,16 +19,17 @@ GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD)) #################### BUILD_ARGS := --build-arg VCS_REF=$(GIT_COMMIT) -.PHONY: all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis delete_dangling_images security +.PHONY: all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis mobile delete_dangling_images security -all: php-lint php-unit-test magento2 static-code-analysis +all: php-lint php-unit-test magento2 mobile static-code-analysis # Image Groups #################### php-lint: php-lint_5.6 php-lint_7.0 php-lint_7.1 php-lint_7.2 php-lint_latest php-unit-test: php-unit-test_5.6 php-unit-test_7.0 php-unit-test_7.1 php-unit-test_7.2 php-unit-test_latest magento2: magento2-unit-test magento2-xml-lint -static-code-analysis: static-code-analysis_latest static-code-analysys_php static-code-analysys_python +mobile: android-build-server +static-code-analysis: static-code-analysis_latest static-code-analysys_php static-code-analysys_python static-code-analysys_android # PHP Lint Images #################### @@ -72,6 +73,11 @@ magento2-unit-test: magento2-unit-test/latest/Dockerfile magento2-xml-lint: magento2-unit-test magento2-xml-lint/latest/Dockerfile docker build $(BUILD_ARGS) -t unl-its/magento2-xml-lint:latest magento2-xml-lint/latest +# Mobile Applications +#################### +android-build-server: android-build-server/Dockerfile + docker build $(BUILD_ARGS) -t unl-its/android-build-server:latest android-build-server + # Sonarqube static-code-analysis # ##################### static-code-analysis_latest: static-code-analysis/Dockerfile @@ -80,6 +86,8 @@ static-code-analysys_php: static-code-analysis/Dockerfile docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:php static-code-analysis/ static-code-analysys_python: static-code-analysis/Dockerfile docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:python static-code-analysis/ +static-code-analysys_android: android-build-server static-code-analysis/android/Dockerfile + docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:android static-code-analysis/android/ # Cleanup #################### diff --git a/android-build-server/Dockerfile b/android-build-server/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..148f1056a23d2efb85b549b934feec838d863fa6 --- /dev/null +++ b/android-build-server/Dockerfile @@ -0,0 +1,32 @@ +FROM adoptopenjdk/openjdk8:alpine + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Build Server for Android Projects" \ + org.label-schema.description="Docker image for building Android projects" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version="0.1.0" \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +ENV ANDROID_SDK_VERSION 4333796 +ENV ANDROID_HOME /opt/android-sdk-linux + +ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools + +WORKDIR /opt +RUN apk add --no-cache curl bash unzip libstdc++ su-exec +RUN mkdir -p /opt/android-sdk-linux \ + && curl -q -o android-sdk-tools.zip -L https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip \ + && unzip -q android-sdk-tools.zip -d ${ANDROID_HOME} \ + && rm -f android-sdk-tools.zip \ + && yes | sdkmanager --licenses + +COPY entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + +CMD "/bin/bash" \ No newline at end of file diff --git a/android-build-server/entrypoint.sh b/android-build-server/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..ae5005ecc0cce43e92b0deef7f09b317e36d55e1 --- /dev/null +++ b/android-build-server/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Add local user +# Either use the LOCAL_USER_ID if passed in at runtime or +# fallback + +USER_ID=${LOCAL_USER_ID:-9001} + +su-exec user "$@" diff --git a/static-code-analysis/android/Dockerfile b/static-code-analysis/android/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..9b41a18c8fd95d528a0029ed19668f1bcab1d36d --- /dev/null +++ b/static-code-analysis/android/Dockerfile @@ -0,0 +1,24 @@ +FROM unl-its/android-build-server + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Android Static Code Analyzer" \ + org.label-schema.description="Docker image for static code analysis of Android projects" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version="0.1.0" \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +ENV SONAR_SCANNER_VERSION 3.2.0.1227 +ENV SONAR_HOME /opt/sonar-scanner + +ENV PATH ${PATH}:${SONAR_HOME} + +WORKDIR /opt +RUN mkdir -p /opt/src \ + && curl -q -o sonarscanner.zip -L https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip \ + && unzip -q sonarscanner.zip -d ${SONAR_HOME} \ + && rm sonarscanner.zip \ No newline at end of file