Skip to content

Commit

Permalink
Merge pull request #83 from faberNovel/release/v1.2.0
Browse files Browse the repository at this point in the history
Prepare release v1.2.0
  • Loading branch information
vincentbrison authored Jul 30, 2020
2 parents 8ed3aef + ea60a8c commit b82188c
Show file tree
Hide file tree
Showing 24 changed files with 2,997 additions and 101 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/cd_prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ jobs:
matrix:
android_api: [28, 29]
android_ndk: ["--android-ndk", ""]
gcloud: ["--gcloud", ""]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build test deploy describe image
env:
RELEASE_NAME: ${{ needs.job_compute_release_name.outputs.release_name }}
run: ./ci_cd.sh --build --test --desc --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }}
run: ./ci_cd.sh --build --test --desc --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }} ${{ matrix.gcloud }}

- name: Upload image description
uses: actions/upload-artifact@v2-preview
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cd_publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
matrix:
android_api: [28, 29]
android_ndk: ["--android-ndk",""]
gcloud: ["--gcloud", ""]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -36,4 +37,4 @@ jobs:
env:
RELEASE_NAME: ${{ needs.job_compute_release_name.outputs.release_name }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: ./ci_cd.sh --build --test --deploy --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }}
run: ./ci_cd.sh --build --test --deploy --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }} ${{ matrix.gcloud }}
5 changes: 3 additions & 2 deletions .github/workflows/cd_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
strategy:
matrix:
android_api: [28, 29]
android_ndk: ["--android_ndk",""]
android_ndk: ["--android-ndk",""]
gcloud: ["--gcloud", ""]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -21,4 +22,4 @@ jobs:
env:
GIT_REF: ${{ github.ref }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: ./ci_cd.sh --build --test --deploy --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }}
run: ./ci_cd.sh --build --test --deploy --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }} ${{ matrix.gcloud }}
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:
strategy:
matrix:
android_api: [28, 29]
android_ndk: ["--android_ndk",""]
android_ndk: ["--android-ndk",""]
gcloud: ["--gcloud", ""]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build and test
run: ./ci_cd.sh --build --test --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }}
run: ./ci_cd.sh --build --test --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }} {{ matrix.gcloud }}
19 changes: 1 addition & 18 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,4 @@ jobs:
uses: ./
id: docker-android-action
with:
exec: sh tests/run_tests.sh --android-api 29 --android-ndk --android-build-tools 29.0.3
build_and_test_multiline:
runs-on: ubuntu-18.04
container:
image: docker://docker:stable-git
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test action
uses: ./
id: docker-android-action
with:
exec: |
echo "Running Android 29 NDK Tests";
sh tests/run_tests.sh --android-api 29 --android-ndk --android-build-tools 29.0.3;
echo "Running Android 29 Tests";
sh tests/run_tests.sh --android-api 29 --android-build-tools 29.0.3;
exec: sh action/test_action.sh
6 changes: 3 additions & 3 deletions .github/workflows/daily_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
options: --name=runner
strategy:
matrix:
android_api: [29]
android_ndk: [""]
android_api: [28,29]
android_ndk: ["--android-ndk"]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -22,4 +22,4 @@ jobs:
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
run: ./ci_cd.sh --build --test --large-test --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }}
run: ./ci_cd.sh --build --test --large-test --android-api ${{ matrix.android_api }} ${{ matrix.android_ndk }} --gcloud
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## [v1.2.0](https://github.com/faberNovel/docker-android/tree/v1.2.0) (2020-07-30)

[Full Changelog](https://github.com/faberNovel/docker-android/compare/v1.1.1...v1.2.0)

**Implemented enhancements:**

- Improve Action testing [\#79](https://github.com/faberNovel/docker-android/issues/79)
- Add variants without gcloud / python [\#68](https://github.com/faberNovel/docker-android/issues/68)

**Fixed bugs:**

- Cannot install new ruby version with rbenv [\#80](https://github.com/faberNovel/docker-android/issues/80)
- Snapshot images with Android NDK are not uploaded [\#74](https://github.com/faberNovel/docker-android/issues/74)
- Set RBENV\_ROOT [\#81](https://github.com/faberNovel/docker-android/pull/81) ([sjcqs](https://github.com/sjcqs))

**Closed issues:**

- Install libcurl4-openssl-dev [\#76](https://github.com/faberNovel/docker-android/issues/76)
- Add ssh support [\#72](https://github.com/faberNovel/docker-android/issues/72)
- Add default Fastlane install [\#49](https://github.com/faberNovel/docker-android/issues/49)

**Merged pull requests:**

- Feature/improve action testing [\#82](https://github.com/faberNovel/docker-android/pull/82) ([vincentbrison](https://github.com/vincentbrison))
- Install libcurl [\#77](https://github.com/faberNovel/docker-android/pull/77) ([sjcqs](https://github.com/sjcqs))
- Fix workflows Android NDK parameter [\#75](https://github.com/faberNovel/docker-android/pull/75) ([sjcqs](https://github.com/sjcqs))
- Feature/ssh [\#73](https://github.com/faberNovel/docker-android/pull/73) ([vincentbrison](https://github.com/vincentbrison))
- Fix gcloud path [\#71](https://github.com/faberNovel/docker-android/pull/71) ([vincentbrison](https://github.com/vincentbrison))
- Make Gcloud installation optional [\#69](https://github.com/faberNovel/docker-android/pull/69) ([sjcqs](https://github.com/sjcqs))

## [v1.1.1](https://github.com/faberNovel/docker-android/tree/v1.1.1) (2020-05-15)

[Full Changelog](https://github.com/faberNovel/docker-android/compare/v1.1.0...v1.1.1)
Expand All @@ -12,6 +42,7 @@

**Merged pull requests:**

- Prepare release v1.1.1 [\#67](https://github.com/faberNovel/docker-android/pull/67) ([github-actions[bot]](https://github.com/apps/github-actions))
- Cleanup desc script formatting [\#65](https://github.com/faberNovel/docker-android/pull/65) ([sjcqs](https://github.com/sjcqs))
- Update script usage documentation [\#64](https://github.com/faberNovel/docker-android/pull/64) ([vincentbrison](https://github.com/vincentbrison))

Expand Down
46 changes: 29 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,24 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
libssl-dev \
libreadline-dev \
unzip \
# needed by google cloud sdk
gcc \
python3 \
python3-dev \
python3-setuptools \
python3-pip
ssh \
# Fastlane plugins dependencies
# - fastlane-plugin-badge (curb)
libcurl4 libcurl4-openssl-dev

## Clean dependencies
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*

## Install rbenv
ENV RBENV_HOME "/root/.rbenv"
RUN git clone https://github.com/rbenv/rbenv.git $RBENV_HOME
ENV PATH "$PATH:$RBENV_HOME/bin"
ENV PATH "$PATH:$RBENV_HOME/shims"
ENV RBENV_ROOT "/root/.rbenv"
RUN git clone https://github.com/rbenv/rbenv.git $RBENV_ROOT
ENV PATH "$PATH:$RBENV_ROOT/bin"
ENV PATH "$PATH:$RBENV_ROOT/shims"

# Install ruby-build (rbenv plugin)
RUN mkdir -p "$RBENV_HOME"/plugins
RUN git clone https://github.com/rbenv/ruby-build.git "$RBENV_HOME"/plugins/ruby-build
RUN mkdir -p "$RBENV_ROOT"/plugins
RUN git clone https://github.com/rbenv/ruby-build.git "$RBENV_ROOT"/plugins/ruby-build

# Install default ruby env
RUN echo “install: --no-document” > ~/.gemrc
Expand All @@ -47,17 +45,31 @@ RUN rbenv global 2.7.0
RUN gem install bundler:2.1.4

# Install Google Cloud CLI
ARG gcloud=false
ARG gcloud_url=https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
ARG gcloud_home=/usr/local/gcloud
ARG gcloud_install_script=${gcloud_home}/google-cloud-sdk/install.sh
ARG gcloud_bin=${gcloud_home}/google-cloud-sdk/bin
RUN mkdir -p ${gcloud_home} && \
ENV PATH=${gcloud_bin}:${PATH}
RUN if [ "$gcloud" = true ] ; \
then \
echo "Installing GCloud SDK"; \
apt-get update && apt-get install --no-install-recommends -y \
gcc \
python3 \
python3-dev \
python3-setuptools \
python3-pip && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p ${gcloud_home} && \
wget --quiet --output-document=/tmp/gcloud-sdk.tar.gz ${gcloud_url} && \
tar -C ${gcloud_home} -xvf /tmp/gcloud-sdk.tar.gz && \
${gcloud_install_script}
ENV PATH=${gcloud_bin}:${PATH}
RUN pip3 uninstall crcmod
RUN pip3 install --no-cache-dir -U crcmod
${gcloud_install_script} && \
pip3 uninstall crcmod && \
pip3 install --no-cache-dir -U crcmod; \
else \
echo "Skipping GCloud SDK installation"; \
fi

## Install Android SDK
ARG sdk_version=commandlinetools-linux-6200805_latest.zip
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ The image is providing standard tools to build and test Android application:
| [Circle CI](https://circleci.com/docs/2.0/executor-types/#using-docker) | 🚧 |
| [Travis CI](https://travis-ci.com/) | 🚧 |

## Fastlane first-class support
Images are built to have first class support for Fastlane.
If you are using a Fastlane plugin which requires a native library:
- Install it using `apt-get update && apt-get -y install <lib>` in your
CI workflow.
- Comment https://github.com/faberNovel/docker-android/issues/78 so that we can
keep track of missing native libraries and add them to the next image version.

## 🐙 GitHub Workflow Sample
Github workflows can run inside Docker images using `container` attribute after `runs-on`:
```yml
Expand Down Expand Up @@ -102,17 +110,18 @@ docker-android images are hosted on [DockerHub](https://hub.docker.com/repositor
## 🔤 Naming
We provide stable and snapshot variants for latest Android API levels, including or not native SDK.
We use the following tagging policy:
`API-NDK-VERSION`
`API-NDK-GCLOUD-VERSION`
* `API` the Android API to use, like `api-28`, `api-29`
* `NDK` is the presence or not of the [Android NDK](https://developer.android.com/ndk) in the image
* `GCLOUD` is the presence or not of the [Google Cloud SDK](https://cloud.google.com/sdk) in the image. (the gcloud sdk is needed for Firebase Test Lab for example).
* `VERSION` is the image version. Check [Versions](https://github.com/faberNovel/docker-android/tree/master#versions)

## 🔢 Versions
* `snapshot` versions are build on each push on `develop` branch
* Release versions `v*` on each [GitHub Release](https://github.com/faberNovel/docker-android/releases)

## 📝 Image description
Image description (software and their versions) is provided as asset with each [GitHub Release](https://github.com/faberNovel/docker-android/releases).
Image description (software and their versions) is provided as [md files](https://github.com/faberNovel/docker-android/tree/master/images_description).

## ✏️ Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Expand All @@ -124,6 +133,7 @@ All scripts must be POSIX compliants.
usage: ./ci_cd.sh [--android-api 29] [--build] [--test]
--android-api <androidVersion> Use specific Android version from `sdkmanager --list`
--android-ndk Install Android NDK
--gcloud Install Google Cloud SDK
--ndk-version <version> Install a specific Android NDK version from `sdkmanager --list`
--build Build image
--test Test image
Expand Down
14 changes: 14 additions & 0 deletions action/test_action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# Exit immediately if a command returns a non-zero status.
set -e

# Assert we are running in docker
if [ ! -f /.dockerenv ]; then
exit 1
fi

# Check basic tools
java -version
rbenv -v
adb version
18 changes: 14 additions & 4 deletions ci_cd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ usage () {
echo " --android-api <androidVersion> Use specific Android version from \`sdkmanager --list\`"
echo " --android-ndk Install Android NDK"
echo " --ndk-version <version> Install a specific Android NDK version from \`sdkmanager --list\`"
echo " --gcloud Install the latest GCloud SDK version"
echo " --build Build image"
echo " --test Test image"
echo " --large-test Run large tests on the image (Firebase Test Lab for example)"
Expand All @@ -23,6 +24,7 @@ usage () {

# Parameters parsing
android_ndk=false
gcloud=false
large_test=false

while true; do
Expand All @@ -32,6 +34,7 @@ while true; do
--test ) test=true; shift ;;
--android-ndk ) android_ndk=true; shift ;;
--large-test ) large_test=true; shift ;;
--gcloud ) gcloud=true; shift ;;
--ndk-version ) ndk_version="$2"; shift 2 ;;
--deploy ) deploy=true; shift ;;
--desc ) desc=true; shift ;;
Expand Down Expand Up @@ -59,12 +62,15 @@ if [ $large_test = true ]; then
fi

# Compute image tag
org_name=fabernovel
simple_image_name=api-$android_api
org_name="fabernovel"
simple_image_name="api-$android_api"
if [ "$gcloud" = true ]; then
simple_image_name="$simple_image_name-gcloud"
fi
if [ "$android_ndk" = true ]; then
simple_image_name="$simple_image_name-ndk"
fi
branch=${GIT_REF##refs/heads/}
branch="${GIT_REF##refs/heads/}"
if [ "$branch" = "develop" ]; then
simple_image_name="$simple_image_name-snapshot"
fi
Expand All @@ -86,6 +92,7 @@ if [ "$build" = true ]; then
docker build \
--build-arg android_api=android-$android_api \
--build-arg android_ndk="$android_ndk" \
--build-arg gcloud="$gcloud" \
$ndk_version_build_arg \
--tag $full_image_name .
set +x
Expand All @@ -103,10 +110,13 @@ fi
if [ "$test" = true ]; then
tasks=$((tasks+1))
echo "Testing image $full_image_name"
test_options="--android-api $android_api --android-build-tools $android_build_tools"
test_options="--check-base-tools --android-api $android_api --android-build-tools $android_build_tools"
if [ "$android_ndk" = true ]; then
test_options="$test_options --android-ndk"
fi
if [ "$gcloud" = true ]; then
test_options="$test_options --gcloud"
fi
if [ "$large_test" = true ]; then
echo "Large test: $FIREBASE_PROJECT_ID"
tasks=$((tasks+1))
Expand Down
Loading

0 comments on commit b82188c

Please sign in to comment.