Skip to content

Commit

Permalink
ci(docker-build): add gleam layer
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed Mar 23, 2024
1 parent d43f633 commit 1245c82
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 4 deletions.
70 changes: 70 additions & 0 deletions .github/docker/layer-19.00-exercism-gleam.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions .github/workflows/gleam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1245c82

Please sign in to comment.