Skip to content

Commit

Permalink
ci(docker-build): log layer script output
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed Aug 30, 2023
1 parent 311c497 commit 55010ec
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 92 deletions.
18 changes: 11 additions & 7 deletions .github/docker/layer-00.00-base-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
# shellcheck disable=SC1091
. /.github/docker/include

layer_begin "$@"
main() {
layer_begin "$@"

PACKAGES="apt-utils bash coreutils curl jq moreutils sudo tmux util-linux vim-nox"
PACKAGES="apt-utils bash coreutils curl jq moreutils sudo tmux util-linux vim-nox"

echo apt install -y "${PACKAGES}"
# shellcheck disable=SC2086
apt install -y ${PACKAGES} || exit
printf "\n"
echo apt install -y "${PACKAGES}"
# shellcheck disable=SC2086
apt install -y ${PACKAGES} || exit
printf "\n"

layer_end "$@"
layer_end "$@"
}

main "${@}" 2>&1 | tee /root/layer-00.00-base-dependencies.log
18 changes: 12 additions & 6 deletions .github/docker/layer-00.10-base-daggerio.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/bin/sh
#!/bin/bash

set -o pipefail

# this path from for the container
# shellcheck disable=SC1091
. /.github/docker/include

layer_begin "$@"
main() {
layer_begin "$@"

echo curl -sSfL https://releases.dagger.io/dagger/install.sh \| sh
curl -sSfL https://releases.dagger.io/dagger/install.sh | sh || exit
printf "\n"

echo curl -sSfL https://releases.dagger.io/dagger/install.sh \| sh
curl -sSfL https://releases.dagger.io/dagger/install.sh | sh || exit
printf "\n"
layer_end "$@"
}

layer_end "$@"
main "${@}" |& tee /root/layer-00.10-base-daggerio.log
22 changes: 14 additions & 8 deletions .github/docker/layer-02.20-exercism-nodejs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -o pipefail

# this path from for the container
# shellcheck disable=SC1091
. /.github/docker/include
Expand All @@ -18,14 +20,18 @@ MODULES=(
yarn
)

apt update
main() {
apt update

echo apt install -y "${PACKAGES[@]}"
apt install -y "${PACKAGES[@]}" || exit
printf "\n"

echo apt install -y "${PACKAGES[@]}"
apt install -y "${PACKAGES[@]}" || exit
printf "\n"
echo npm install --global "${MODULES[@]}"
npm install --global "${MODULES[@]}" || exit
printf "\n"

echo npm install --global "${MODULES[@]}"
npm install --global "${MODULES[@]}" || exit
printf "\n"
layer_end "$@"
}

layer_end "$@"
main "${@}" |& tee /root/layer-02.20-exercism-nodejs.log
28 changes: 17 additions & 11 deletions .github/docker/layer-10.00-exercism-gcc_clang_llvm.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -o pipefail

# https://apt.llvm.org/

# this path from for the container
Expand Down Expand Up @@ -47,11 +49,12 @@ PACKAGES=(
python3-clang-16
)

# wget -q https://apt.llvm.org/llvm.sh
# chmod -v +x llvm.sh
# ./llvm.sh 16 all
main() {
# wget -q https://apt.llvm.org/llvm.sh
# chmod -v +x llvm.sh
# ./llvm.sh 16 all

tee -a /etc/apt/sources.list <<EOF
tee -a /etc/apt/sources.list <<EOF
# deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye main
# deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye main
# deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-14 main
Expand All @@ -64,13 +67,16 @@ deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-16 main
#deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main
EOF

#wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
curl -sS https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
#wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
curl -sS https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc

apt update

apt update
echo apt install -y "${PACKAGES[@]}"
apt install -y "${PACKAGES[@]}" || exit
printf "\n"

echo apt install -y "${PACKAGES[@]}"
apt install -y "${PACKAGES[@]}" || exit
printf "\n"
layer_end "$@"
}

layer_end "$@"
main "${@}" |& tee /root/layer-10.00-exercism-gcc_clang_llvm.log
126 changes: 66 additions & 60 deletions .github/docker/layer-15.00-exercism-rust.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -o pipefail

# https://apt.llvm.org/

# this path from for the container
Expand Down Expand Up @@ -48,73 +50,77 @@ COMPONENTS=(
rustfmt
)

echo Running: apt install -y "${PACKAGES[@]}"
time apt install -y "${PACKAGES[@]}" || exit
printf "\n"
main() {
echo Running: apt install -y "${PACKAGES[@]}"
time apt install -y "${PACKAGES[@]}" || exit
printf "\n"

echo Running: curl https://sh.rustup.rs -sSf \| bash -s -- -y
time curl https://sh.rustup.rs -sSf | bash -s -- -y || exit
printf "\n"
echo Running: curl https://sh.rustup.rs -sSf \| bash -s -- -y
time curl https://sh.rustup.rs -sSf | bash -s -- -y || exit
printf "\n"

# ENV PATH="/root/.cargo/bin:${PATH}"
printf "source %s\n" "${HOME}/.cargo/env" | tee -a "${HOME}/.bashrc"
source "${HOME}/.bashrc"
# ENV PATH="/root/.cargo/bin:${PATH}"
printf "source %s\n" "${HOME}/.cargo/env" | tee -a "${HOME}/.bashrc"
source "${HOME}/.bashrc"

echo Running: rustup default stable
time rustup default stable || exit
printf "\n"
echo Running: rustup default stable
time rustup default stable || exit
printf "\n"

echo Running: rustc --version
rustc --version || exit
printf "\n"
echo Running: rustc --version
rustc --version || exit
printf "\n"

export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"

echo Running: cargo install sccache
time cargo install sccache || exit
printf "\n"
echo Running: cargo install sccache
time cargo install sccache || exit
printf "\n"

export RUSTC_WRAPPER="sccache"
echo RUSTC_WRAPPER="sccache" | tee -a "${HOME}/.bashrc"
printf "\n"
export RUSTC_WRAPPER="sccache"
echo RUSTC_WRAPPER="sccache" | tee -a "${HOME}/.bashrc"
printf "\n"

echo Running: sccache --start-server
time sccache --start-server
printf "\n"

echo Running: sccache --start-server
time sccache --start-server
printf "\n"
for component in "${COMPONENTS[@]}"; do
echo Running: rustup component add "${component}"
time rustup component add "${component}" || exit
printf "\n"
done

echo Running: cargo install "${CRATES[@]}"
time cargo install "${CRATES[@]}" || exit
printf "\n"

for component in "${COMPONENTS[@]}"; do
echo Running: rustup component add "${component}"
time rustup component add "${component}" || exit
printf "Installed Rust components:\n"
echo Running: rustup component list
time rustup component list
printf "\n"
done

echo Running: cargo install "${CRATES[@]}"
time cargo install "${CRATES[@]}" || exit
printf "\n"

printf "Installed Rust components:\n"
echo Running: rustup component list
time rustup component list
printf "\n"

printf "Installed Crates:\n"
echo Running: cargo install --list
time cargo install --list
printf "\n"

printf "Show Rust Configuration:\n"
echo Running: rustup show
time rustup show
printf "\n"

printf "Show Rust sccache Info:\n"
echo Running: sccache --show-stats
sccache --show-stats
printf "\n"

printf "Show Rust Cache Info:\n"
echo Running: cargo cache --info
cargo cache --info
printf "\n"

layer_end "$@"

printf "Installed Crates:\n"
echo Running: cargo install --list
time cargo install --list
printf "\n"

printf "Show Rust Configuration:\n"
echo Running: rustup show
time rustup show
printf "\n"

printf "Show Rust sccache Info:\n"
echo Running: sccache --show-stats
sccache --show-stats
printf "\n"

printf "Show Rust Cache Info:\n"
echo Running: cargo cache --info
cargo cache --info
printf "\n"

layer_end "$@"
}

main "${@}" |& tee /root/layer-15.00-exercism-rust.log

0 comments on commit 55010ec

Please sign in to comment.