summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-07-07 12:05:19 -0600
committermo khan <mo.khan@gmail.com>2020-07-07 12:05:19 -0600
commitc97becc2767afe4a86eb4cca3691e346c3c6ba94 (patch)
treebb3814cabb6cbe319c5a6469a173e1b5562b3b63
parent31adddadee3b56d94356d178cc436fdc5dd7455c (diff)
Add collapsible sections to get timing info for each section
-rw-r--r--config/install.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/config/install.sh b/config/install.sh
index ed107c9..2868c94 100644
--- a/config/install.sh
+++ b/config/install.sh
@@ -3,7 +3,7 @@ set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
-echo ["$(date "+%H:%M:%S")"] "==> Installing packages…"
+echo -e "section_start:$(date +%s):install_packages\r\e[0K==> Installing packages…"
apt-get clean
apt-get update -q
apt-get install -y --no-install-recommends \
@@ -73,18 +73,20 @@ apt-get install -y --no-install-recommends \
zlib1g \
zlib1g-dev \
zstd
+echo -e "section_end:$(date +%s):install_packages\r\e[0K"
+echo -e "section_start:$(date +%s):install_dotnet\r\e[0K==> Installing dotnet/mono…"
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg
wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/debian/10/prod.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list
-echo ["$(date "+%H:%M:%S")"] "==> Installing dotnet/mono…"
apt-get update -q
apt-get install -y --no-install-recommends dotnet-sdk-3.1 mono-complete &
curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe &
+echo -e "section_end:$(date +%s):install_dotnet\r\e[0K"
-echo ["$(date "+%H:%M:%S")"] "==> Installing asdf…"
+echo -e "section_start:$(date +%s):install_asdf\r\e[0K==> Installing asdf…"
mkdir -p "$ASDF_DATA_DIR"
git clone https://github.com/asdf-vm/asdf.git "$ASDF_DATA_DIR"
cd "$ASDF_DATA_DIR"
@@ -107,8 +109,9 @@ for version in $(asdf list python); do
pip download -d "$HOME/.config/virtualenv/app-data" pip-licenses pip setuptools wheel
done
wait
+echo -e "section_end:$(date +%s):install_asdf\r\e[0K"
-echo ["$(date "+%H:%M:%S")"] "==> Beginning cleanup…"
+echo -e "section_start:$(date +%s):cleanup\r\e[0K==> Beginning cleanup…"
rm -fr /tmp
mkdir -p /tmp
chmod 777 /tmp
@@ -165,8 +168,9 @@ rm -fr "$ASDF_DATA_DIR/docs" \
/var/lib/apt/lists/* \
/var/lib/systemd/* \
/var/log/*
+echo -e "section_end:$(date +%s):cleanup\r\e[0K"
-echo ["$(date "+%H:%M:%S")"] "==> Starting compression…"
+echo -e "section_start:$(date +%s):compress_files\r\e[0K==> Starting compression…"
zstd_command="/usr/bin/zstd -19 -T0"
cd /opt
tar --use-compress-program "$zstd_command" -cf /opt/asdf.tar.zst asdf &
@@ -190,4 +194,4 @@ rm -fr \
/usr/lib/mono \
/usr/lib/rustlib \
/usr/share/dotnet
-echo ["$(date "+%H:%M:%S")"] "==> Done"
+echo -e "section_end:$(date +%s):compress_files\r\e[0K"