Skip to content

Commit

Permalink
chore: Embed yq in repo to avoid network hiccups. (#2560)
Browse files Browse the repository at this point in the history
As Title.
  • Loading branch information
charlielye authored Sep 27, 2023
1 parent a26198e commit 84f207f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Binary file added build-system/bin/yq_linux_amd64.gz
Binary file not shown.
Binary file added build-system/bin/yq_linux_arm64.gz
Binary file not shown.
11 changes: 5 additions & 6 deletions build-system/scripts/setup_env
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,18 @@ echo export BRANCH=$BRANCH >> $BASH_ENV
if [ -n "$COMMIT_HASH" ]; then
# Our alpine build image has yq installed, ubuntu build instances download from github.
if [ ! -f /etc/alpine-release ]; then
mkdir -p $BUILD_SYSTEM_PATH/bin
echo export PATH=$BUILD_SYSTEM_PATH/bin:\$PATH >> $BASH_ENV
YQ_PATH=$BUILD_SYSTEM_PATH/bin/yq
BIN_PATH=$BUILD_SYSTEM_PATH/bin
echo export PATH=$BIN_PATH:\$PATH >> $BASH_ENV
ARCH=$(uname -m)
if [ "$ARCH" == "x86_64" ]; then
curl -Ls https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 > $YQ_PATH
gunzip -c $BIN_PATH/yq_linux_amd64 > $BIN_PATH/yq
elif [ "$ARCH" == "aarch64" ]; then
curl -Ls https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_arm64 > $YQ_PATH
gunzip -c $BIN_PATH/yq_linux_arm64 > $BIN_PATH/yq
else
echo "Unknown arch: $ARCH"
exit 1
fi
chmod +x $YQ_PATH
chmod +x $BIN_PATH/yq
fi

# Install and ensure correct permissions on build instance key.
Expand Down

0 comments on commit 84f207f

Please sign in to comment.