From 6927bd3bbd9f27d797a628feae196c34459fa2a5 Mon Sep 17 00:00:00 2001 From: Michael Dombrowski Date: Fri, 12 Apr 2024 09:59:46 -0400 Subject: [PATCH] ci: add ci and use latest version always --- .github/workflows/ci.yml | 16 ++++++++++++++++ Dockerfile | 2 +- greengrass-entrypoint.sh | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..597e9bf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,16 @@ +name: CI +on: + push: + branches: [ main ] + pull_request: + branches: '*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: wagoid/commitlint-github-action@v6 + - name: Build image + run: docker build -t "aws-iot-greengrass:latest" ./ + - name: Run image + run: docker run --init -e STARTUP=false aws-iot-greengrass:latest diff --git a/Dockerfile b/Dockerfile index bc50394..fb70b0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM amazonlinux:2023 # Replace the args to lock to a specific version -ARG GREENGRASS_RELEASE_VERSION=2.12.4 +ARG GREENGRASS_RELEASE_VERSION=latest ARG GREENGRASS_ZIP_FILE=greengrass-${GREENGRASS_RELEASE_VERSION}.zip ARG GREENGRASS_RELEASE_URI=https://d2s8p88vqu9w66.cloudfront.net/releases/${GREENGRASS_ZIP_FILE} diff --git a/greengrass-entrypoint.sh b/greengrass-entrypoint.sh index 2660d63..6529f58 100644 --- a/greengrass-entrypoint.sh +++ b/greengrass-entrypoint.sh @@ -86,6 +86,11 @@ if [ ! -d $GGC_ROOT_PATH/alts/current/distro ]; then echo "Installing Greengrass for the first time..." parse_options java ${OPTIONS} + if [ $? -ne 0 ]; then + exit $? + elif [ ${STARTUP} = "false" ]; then + exit 0 + fi else echo "Reusing existing Greengrass installation..." fi