Skip to content

Commit

Permalink
Merge pull request #24 from menny/yaml-lint
Browse files Browse the repository at this point in the history
Adding `yamllint`
  • Loading branch information
menny authored Nov 30, 2024
2 parents 01124c4 + 8abb5ba commit d2f1146
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .github/docker_build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ fi

IMAGE_SIZE_RAW=$(docker inspect -f "{{ .Size }}" menny/${IMAGE_NAME}:${IMAGE_VERSION})
IMAGE_SIZE=$(echo $IMAGE_SIZE_RAW | numfmt --to=si)
SIZE_MESSAGE="Image size for \`menny/${IMAGE_NAME}:${IMAGE_VERSION}\` is ${IMAGE_SIZE} (or $IMAGE_SIZE_RAW bytes).${SQUASH_MSG}"
PREVIOUS_SIZE="$(docker manifest inspect menny/${IMAGE_NAME}:latest | jq -r '.config.size + ([.layers[].size] | add)')"
SIZE_MESSAGE="Image size for \`menny/${IMAGE_NAME}:${IMAGE_VERSION}\` is ${IMAGE_SIZE} (or $IMAGE_SIZE_RAW bytes).${SQUASH_MSG} Previous (compressed) size was ${PREVIOUS_SIZE}."

echo "${SIZE_MESSAGE}"

if [[ -n "$GITHUB_COMMENT_URL" ]]; then
Expand Down
19 changes: 19 additions & 0 deletions .github/docker_push_image.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

PREVIOUS_SIZE="$(docker manifest inspect menny/${IMAGE_NAME}:latest | jq -r '.config.size + ([.layers[].size] | add)')"

docker image tag menny/${IMAGE_NAME}:${IMAGE_VERSION} menny/${IMAGE_NAME}:latest
docker image tag menny/${IMAGE_NAME}:${IMAGE_VERSION} ghcr.io/menny/${IMAGE_NAME}:${IMAGE_VERSION}
docker image tag menny/${IMAGE_NAME}:${IMAGE_VERSION} ghcr.io/menny/${IMAGE_NAME}:latest
Expand All @@ -9,3 +11,20 @@ docker push menny/${IMAGE_NAME}:${IMAGE_VERSION}
docker push menny/${IMAGE_NAME}:latest
docker push ghcr.io/menny/${IMAGE_NAME}:${IMAGE_VERSION}
docker push ghcr.io/menny/${IMAGE_NAME}:latest

# removing to ensure we're pull the right size
docker rmi menny/${IMAGE_NAME}:latest
CURRENT_SIZE="$(docker manifest inspect menny/${IMAGE_NAME}:latest | jq -r '.config.size + ([.layers[].size] | add)')"

SIZES_MSG="Pushed image 'menny/${IMAGE_NAME}:${IMAGE_VERSION}'. Previous size was ${PREVIOUS_SIZE} and current is ${CURRENT_SIZE}."

echo "$SIZES_MSG"

if [[ -n "$GITHUB_COMMENT_URL" ]]; then
JSON_DATA=$(jq --null-input --arg body "${SIZE_MESSAGE}" '{ "body": $body }')
curl -s -X POST \
$GITHUB_COMMENT_URL \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN" \
--data "${JSON_DATA}" > /dev/null
fi
2 changes: 1 addition & 1 deletion .github/workflows/post_merge_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main
env:
TERM: dumb
IMAGE_VERSION: 1.21.0
IMAGE_VERSION: 1.21.1
NDK_VERSION: 27.2.12479018
BASELISK_VERSION: v1.24.0
jobs:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pre_merge_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/[email protected]
- name: lint
uses: luke142367/[email protected]
with:
target: Dockerfile android_base/Dockerfile android_bazel/Dockerfile android_ndk/Dockerfile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Base Android image
env:
SQUASH_IMAGE: SQUASH
run: IMAGE_NAME="android_base" DOCKER_FILE_PATH="android_base/." ./.github/docker_build_image.sh
- name: Android image with some tools
run: IMAGE_NAME="android" DOCKER_FILE_PATH="." ./.github/docker_build_image.sh
- name: Android and NDK image
run: IMAGE_NAME="android_ndk" NDK_VERSION="23.0.7599858" DOCKER_FILE_PATH="android_ndk/." ./.github/docker_build_image.sh
29 changes: 14 additions & 15 deletions android_base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,38 @@ LABEL version="${IMAGE_VERSION}"
LABEL maintainer="[email protected]"

# disable interactive functions
ENV DEBIAN_FRONTEND noninteractive
ENV TERM dumb
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=dumb

# Install Deps and build-essential
RUN apt-get update \
&& apt-get install -y --allow-remove-essential --allow-change-held-packages \
&& apt-get install -y --allow-remove-essential --allow-change-held-packages --no-install-recommends \
locales software-properties-common ca-certificates build-essential zlib1g-dev \
pkg-config file \
python3 python3-pip python3-lxml python3-yaml libxml2-utils \
wget curl nano rsync sudo zip psmisc rsyslog jq unzip \
python3 python3-pip python3-lxml python3-yaml libxml2-utils yamllint \
wget curl nano rsync zip psmisc rsyslog jq unzip \
imagemagick \
java-common \
&& apt-get clean
# this is required for the latest git (ubuntu's official git is quite old)
RUN add-apt-repository ppa:git-core/ppa -y \
&& apt-get install -y --allow-remove-essential --allow-change-held-packages git \
&& apt-get clean
&& add-apt-repository ppa:git-core/ppa -y \
&& apt-get install git -y --allow-remove-essential --allow-change-held-packages --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN touch /var/log/kern.log ; chown syslog:adm /var/log/kern.log

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

RUN mkdir -p /opt
WORKDIR /opt
COPY tools /opt/tools
RUN chmod +x /opt/tools/start_emulator.sh

# Setup environment
ENV ANDROID_HOME /opt/android-sdk-linux
ENV PATH ${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools
ENV ANDROID_HOME=/opt/android-sdk-linux
ENV PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools

# Setup Java
RUN curl https://corretto.aws/downloads/resources/17.0.10.8.1/java-17-amazon-corretto-jdk_17.0.10.8-1_amd64.deb -o jdk-corretto.deb \
Expand Down
2 changes: 1 addition & 1 deletion android_studio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN sdkmanager "sources;android-26"
# support for X-server
RUN sed 's/main$/main universe/' -i /etc/apt/sources.list && \
apt-get update -qq && \
apt-get install -qq -y --fix-missing sudo software-properties-common git libxext-dev libxrender-dev libxslt1.1 \
apt-get install -qq -y --fix-missing software-properties-common git libxext-dev libxrender-dev libxslt1.1 \
libxtst-dev libgtk2.0-0 libcanberra-gtk-module unzip wget && \
apt-get clean -qq -y && \
apt-get autoclean -qq -y && \
Expand Down

0 comments on commit d2f1146

Please sign in to comment.