Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev): update environment for website development #18657

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ copypasta'd
copypasted
copytruncate
corechecks
corepack
could've
counteraaaaaaaaaaa
cpf
Expand Down Expand Up @@ -740,6 +741,7 @@ noauth
nocapture
nochild
nodebuginfo
nodistro
nofield
nofree
nomac
Expand Down
63 changes: 52 additions & 11 deletions scripts/environment/bootstrap-ubuntu-20.04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export ACCEPT_EULA=Y

echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries

apt update --yes
apt-get update --yes

apt install --yes \
apt-get install --yes \
software-properties-common \
apt-utils \
apt-transport-https

apt upgrade --yes
apt-get upgrade --yes

# Deps
apt install --yes --no-install-recommends \
apt-get install --yes --no-install-recommends \
awscli \
build-essential \
ca-certificates \
Expand All @@ -40,8 +40,6 @@ apt install --yes --no-install-recommends \
libssl-dev \
llvm \
locales \
nodejs \
npm \
pkg-config \
python3-pip \
rename \
Expand All @@ -50,8 +48,7 @@ apt install --yes --no-install-recommends \
shellcheck \
sudo \
unzip \
wget \
yarn
wget

# Cue
TEMP=$(mktemp -d)
Expand All @@ -62,6 +59,7 @@ tar \
-xvf "${TEMP}/cue_v0.5.0_linux_amd64.tar.gz" \
-C "${TEMP}"
cp "${TEMP}/cue" /usr/bin/cue
rm -rf "$TEMP"

# Grease
# Grease is used for the `make release-github` task.
Expand All @@ -73,6 +71,7 @@ tar \
-xvf "${TEMP}/grease-1.0.1-linux-amd64.tar.gz" \
-C "${TEMP}"
cp "${TEMP}/grease/bin/grease" /usr/bin/grease
rm -rf "$TEMP"

# Locales
locale-gen en_US.UTF-8
Expand Down Expand Up @@ -102,8 +101,8 @@ if ! [ -x "$(command -v docker)" ]; then
xenial \
stable"
# Install those new things
apt update --yes
apt install --yes docker-ce docker-ce-cli containerd.io
apt-get update --yes
apt-get install --yes docker-ce docker-ce-cli containerd.io

# ubuntu user doesn't exist in scripts/environment/Dockerfile which runs this
usermod --append --groups docker ubuntu || true
Expand All @@ -117,8 +116,49 @@ fi

bash scripts/environment/install-protoc.sh

# Node.js, npm and yarn.
# Note: the current LTS for the Node.js toolchain is 18.x
if ! [ -x "$(command -v node)" ]; then
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | apt-key add -
add-apt-repository \
"deb [arch=$(dpkg --print-architecture)] https://deb.nodesource.com/node_18.x \
nodistro \
main"
# Install those new things
apt-get update --yes
apt-get install --yes nodejs

# enable corepack (enables the yarn and pnpm package managers)
# ref: https://nodejs.org/docs/latest-v18.x/api/corepack.html
corepack enable
fi

# Hugo (static site generator).
# Hugo is used to build the website content.
# Note: the installed version should match the version specified in 'netlify.toml'
TEMP=$(mktemp -d)
curl \
-L https://github.com/gohugoio/hugo/releases/download/v0.84.0/hugo_extended_0.84.0_Linux-64bit.tar.gz \
-o "${TEMP}/hugo_extended_0.84.0_Linux-64bit.tar.gz"
tar \
-xvf "${TEMP}/hugo_extended_0.84.0_Linux-64bit.tar.gz" \
-C "${TEMP}"
cp "${TEMP}/hugo" /usr/bin/hugo
rm -rf "$TEMP"

# htmltest (HTML checker for the website content)
TEMP=$(mktemp -d)
curl \
-L https://github.com/wjdp/htmltest/releases/download/v0.17.0/htmltest_0.17.0_linux_amd64.tar.gz \
-o "${TEMP}/htmltest_0.17.0_linux_amd64.tar.gz"
tar \
-xvf "${TEMP}/htmltest_0.17.0_linux_amd64.tar.gz" \
-C "${TEMP}"
cp "${TEMP}/htmltest" /usr/bin/htmltest
rm -rf "$TEMP"

# Apt cleanup
apt clean
apt-get clean

# Set up the default "deny all warnings" build flags
CARGO_OVERRIDE_DIR="${HOME}/.cargo"
Expand Down Expand Up @@ -146,6 +186,7 @@ if [ -z "${DISABLE_MOLD:-""}" ] ; then
-C "${TEMP}"
cp "${TEMP}/${MOLD_TARGET}/bin/mold" /usr/bin/mold
cp "${TEMP}/${MOLD_TARGET}/lib/mold/mold-wrapper.so" /usr/bin/mold-wrapper.so
rm -rf "$TEMP"

# Create our rustc wrapper script that we'll use to actually invoke `rustc` such that `mold` will wrap it and intercept
# anything linking calls to use `mold` instead of `ld`, etc.
Expand Down