From 1245c82c587031b75d55f9cbb05ae6c7ca3fd6d5 Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Fri, 22 Mar 2024 18:19:56 -0700 Subject: [PATCH] ci(docker-build): add gleam layer --- .github/docker/layer-19.00-exercism-gleam.sh | 70 ++++++++++++++++++++ .github/workflows/gleam.yml | 4 -- Dockerfile | 2 + 3 files changed, 72 insertions(+), 4 deletions(-) create mode 100755 .github/docker/layer-19.00-exercism-gleam.sh diff --git a/.github/docker/layer-19.00-exercism-gleam.sh b/.github/docker/layer-19.00-exercism-gleam.sh new file mode 100755 index 00000000..1951bd90 --- /dev/null +++ b/.github/docker/layer-19.00-exercism-gleam.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# .github/docker/layer-19.00-exercism-gleam.sh +# + +set -o pipefail + +# this path from for the container +# shellcheck disable=SC1091 +. /.github/docker/include + +# shellcheck disable=SC1091 +source /.github/citools/includes/wrapper-library || exit + +main() { + declare -i retval=0 + + layer_begin "${0}" "$@" + + export ERLANG_ROOT="/usr/local/erlang" + export REBAR3_ROOT="/usr/local/rebar3" + + echo Running: /.github/citools/gleam/gleam-setup-install + time /.github/citools/gleam/gleam-setup-install || track_errors + printf "\n" + + echo Running: /.github/citools/gleam/gleam-setup-config + time /.github/citools/gleam/gleam-setup-config || track_errors + printf "\n" + + echo Running: mkdir -pv /etc/skel/.cache + mkdir -pv /etc/skel/.cache || track_errors + printf "\n" + + echo Running: ln -sv "${REBAR3_ROOT}" "/etc/skel/.cache/rebar3" + ln -sv "${REBAR3_ROOT}" "/etc/skel/.cache/rebar3" || track_errors + printf "\n" + + echo Checking installation: + ls -lh /usr/local/ "${ERLANG_ROOT}" "${REBAR3_ROOT}" "${HOME}"/.config /etc/skel/.config + printf "\n" + + echo Adding source /etc/profile.d/gleam.sh to ~/.bashrc and /etc/skel/.bashrc + echo '. /etc/profile.d/gleam.sh' | tee -a "${HOME}/.bashrc" | tee -a "${HOME}/.profile" | tee -a /etc/skel/.bashrc || track_errors + printf "\n" + + echo Running: source /etc/profile.d/gleam.sh + # shellcheck disable=SC1091 + source /etc/profile.d/gleam.sh || track_errors + printf "\n" + + echo Running: chgrp -R adm "${ERLANG_ROOT}" "${REBAR3_ROOT}" + time chgrp -R adm "${ERLANG_ROOT}" "${REBAR3_ROOT}" || track_errors + printf "\n" + + echo Running: setfacl -RPdm g:adm:w "${ERLANG_ROOT}" "${REBAR3_ROOT}" + time setfacl -RPdm g:adm:w "${ERLANG_ROOT}" "${REBAR3_ROOT}" || track_errors + printf "\n" + + echo Running: rm -rf "${HOME}/git_remote/*" + time rm -rf "${HOME}/git_remote/*" + printf "\n" + + layer_end "${0}" "$@" + + echo Running: return "${retval}" + return "${retval}" +} + +time main "${@}" |& tee "${HOME}"/layer-19.00-exercism-gleam.log diff --git a/.github/workflows/gleam.yml b/.github/workflows/gleam.yml index 146a5894..28c813f5 100644 --- a/.github/workflows/gleam.yml +++ b/.github/workflows/gleam.yml @@ -192,10 +192,6 @@ jobs: - name: Checkout Repo [${{ matrix.exercise }}] id: checkout-repo uses: actions/checkout@v3 - - name: Install Gleam Tools [${{ matrix.exercise }}] - id: install-gleam-tools - run: |- - ./.github/citools/common/run_wrapper_script "./${{ matrix.exercise }}" ../../.github/citools/gleam/gleam-setup-install - name: Config Gleam Tools [${{ matrix.exercise }}] id: config-gleam-tools run: |- diff --git a/Dockerfile b/Dockerfile index 42c2bd1a..e59323e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,8 @@ RUN bash .github/docker/layer-17.00-exercism-ruby.sh ci-generic-debian && : 2023 RUN bash .github/docker/layer-18.00-exercism-python.sh ci-generic-debian && : 20240322-000 +RUN bash .github/docker/layer-19.00-exercism-gleam.sh ci-generic-debian && : 20240322-000 + RUN bash .github/docker/layer-25.00-tools-vscode.sh ci-generic-debian && : 20240102-000 RUN bash .github/docker/layer-35.00-tools-tailscale.sh ci-generic-debian && : 20240111-000