Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Begin updating script-library to support arm64 #924

Merged
merged 32 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
94c259c
First pass at removing apt-key, supporting archs
Chuxel May 3, 2021
0bd96d8
Yarn fix
Chuxel May 3, 2021
4ad78d1
Merge branch 'main' of https://github.com/microsoft/vscode-dev-contai…
Chuxel Jun 19, 2021
16ba2ce
Support single script regression test
Chuxel Jun 19, 2021
ad9c872
Refinements
Chuxel Jun 19, 2021
4baa5b8
Fixes
Chuxel Jun 19, 2021
41ce3c3
Support using PPA for git-from-src
Chuxel Jun 19, 2021
03ba887
Use pip for docker-compose if not x86_64
Chuxel Jun 21, 2021
d42d2f6
Tweak architecture detect
Chuxel Jun 21, 2021
23b35ff
Set privs on temp folder
Chuxel Jun 21, 2021
d28cf49
Use a more reliable gpg server
Chuxel Jun 21, 2021
bde7e1f
Test script fix
Chuxel Jun 21, 2021
6d458d3
Improve security of git-lfs install
Chuxel Jun 21, 2021
09b1b9f
Fix typo
Chuxel Jun 21, 2021
7b63592
Support multi-arch testing
Chuxel Jun 24, 2021
1731b6f
Fixes
Chuxel Jun 25, 2021
bc07414
Test fixes
Chuxel Jun 25, 2021
35e0cb4
Test fix
Chuxel Jun 25, 2021
87538db
Set execute bit
Chuxel Jun 25, 2021
a6b0860
Fix terraform for arm64, add checksum/signing check
Chuxel Jun 26, 2021
4c7fc28
Use multiple keyservers
Chuxel Jun 26, 2021
b973c5d
Update comments
Chuxel Jun 28, 2021
dcdd287
Merge branch 'main' of https://github.com/microsoft/vscode-dev-contai…
Chuxel Jun 28, 2021
5ca95a4
Tweak ruby test
Chuxel Jun 28, 2021
7fa5397
Fix PR feedback, doc errors
Chuxel Jun 29, 2021
6330120
Use key ID for terraform sig
Chuxel Jun 29, 2021
04722e4
Test fix
Chuxel Jun 29, 2021
d29145c
Fix git editor test
Chuxel Jun 29, 2021
165a48f
Use --no-cache-dir
Chuxel Jun 29, 2021
9417fc3
Work around tilix not being available for arm64 on Debian buster
Chuxel Jun 29, 2021
202f7ee
Merge branch 'main' of https://github.com/microsoft/vscode-dev-contai…
Chuxel Jun 29, 2021
d5e5a52
Fix docker-compose install
Chuxel Jun 30, 2021
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
11 changes: 6 additions & 5 deletions script-library/azcli-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ fi
export DEBIAN_FRONTEND=noninteractive

# Install curl, apt-transport-https, lsb-release, or gpg if missing
if ! dpkg -s apt-transport-https curl ca-certificates lsb-release > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then
if ! dpkg -s apt-transport-https curl ca-certificates lsb-release gnupg2 > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
apt-get update
fi
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
fi

# Install the Azure CLI
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list
curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT)
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
. /etc/os-release
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
apt-get update
apt-get install -y azure-cli
echo "Done!"
6 changes: 3 additions & 3 deletions script-library/desktop-lite-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ apt-get-update-if-needed

# On older Ubuntu, Tilix is in a PPA. On Debian Strech, its in backports
if [[ -z $(apt-cache --names-only search ^tilix$) ]]; then
apt-get install -y --no-install-recommends lsb-release
if [ "$(lsb_release -is)" = "Ubuntu" ]; then
. /etc/os-release
if [ "${ID}" = "ubuntu" ]; then
apt-get install -y --no-install-recommends apt-transport-https software-properties-common
add-apt-repository -y ppa:webupd8team/terminix
Chuxel marked this conversation as resolved.
Show resolved Hide resolved
else
echo "deb http://deb.debian.org/debian $(lsb_release -cs)-backports main" > /etc/apt/sources.list.d/$(lsb_release -cs)-backports.list
echo "deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main" > /etc/apt/sources.list.d/${VERSION_CODENAME}-backports.list
fi
apt-get update
fi
Expand Down
41 changes: 28 additions & 13 deletions script-library/docker-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,53 @@ apt-get-update-if-needed()
# Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive

# Install apt-transport-https, curl, lsb-release, gpg if missing
if ! dpkg -s apt-transport-https curl ca-certificates lsb-release > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then
# Install apt-transport-https, curl, gpg if missing
if ! dpkg -s apt-transport-https curl ca-certificates > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then
apt-get-update-if-needed
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates gnupg2
fi

# Install Docker / Moby CLI if not already installed
if type docker > /dev/null 2>&1; then
echo "Docker / Moby CLI already installed."
else
# Source /etc/os-release to get OS info
. /etc/os-release
if [ "${USE_MOBY}" = "true" ]; then
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
curl -s https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-${DISTRO}-${CODENAME}-prod ${CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
apt-get update
apt-get -y install --no-install-recommends moby-cli moby-buildx
else
curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT)
echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get -y install --no-install-recommends docker-ce-cli
fi
fi

# Install Docker Compose if not already installed
# Install Docker Compose if not already installed and is on a supported architecture
if type docker-compose > /dev/null 2>&1; then
echo "Docker Compose already installed."
else
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
TARGET_COMPOSE_ARCH="$(uname -m)"
if [ "${TARGET_COMPOSE_ARCH}" = "amd64" ]; then
TARGET_COMPOSE_ARCH="x86_64"
fi
if [ "${TARGET_COMPOSE_ARCH}" != "x86_64" ]; then
# Use pip to get a version that runns on this architecture
if ! dpkg -s python3-pip libffi-dev > /dev/null 2>&1; then
apt-get-update-if-needed
apt-get -y install --no-install-recommends python3-pip libffi-dev
fi
pip3 install docker-compose
else
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-${TARGET_COMPOSE_ARCH}" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
fi

# If init file already exists, exit
Expand Down
35 changes: 25 additions & 10 deletions script-library/docker-in-docker-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,45 @@ fi
if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then
echo "Docker / Moby CLI and Engine already installed."
else
# Source /etc/os-release to get OS info
. /etc/os-release
if [ "${USE_MOBY}" = "true" ]; then
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
curl -s https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-${DISTRO}-${CODENAME}-prod ${CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
apt-get update
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
else
curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT)
echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/${ID} ${CODNAME} stable" > /etc/apt/sources.list.d/docker.list
Chuxel marked this conversation as resolved.
Show resolved Hide resolved
apt-get update
apt-get -y install --no-install-recommends docker-ce-cli docker-ce
fi
fi

echo "Finished installing docker / moby"

# Install Docker Compose if not already installed
# Install Docker Compose if not already installed and is on a supported architecture
if type docker-compose > /dev/null 2>&1; then
echo "Docker Compose already installed."
else
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
TARGET_COMPOSE_ARCH="$(uname -m)"
if [ "${TARGET_COMPOSE_ARCH}" = "amd64" ]; then
TARGET_COMPOSE_ARCH="x86_64"
fi
if [ "${TARGET_COMPOSE_ARCH}" != "x86_64" ]; then
# Use pip to get a version that runns on this architecture
if ! dpkg -s python3-pip libffi-dev > /dev/null 2>&1; then
apt-get-update-if-needed
apt-get -y install --no-install-recommends python3-pip libffi-dev
fi
pip3 install docker-compose
Chuxel marked this conversation as resolved.
Show resolved Hide resolved
else
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-${TARGET_COMPOSE_ARCH}" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
fi

# If init file already exists, exit
Expand Down
Empty file modified script-library/fish-debian.sh
100644 → 100755
Empty file.
33 changes: 28 additions & 5 deletions script-library/git-from-src-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Syntax: ./git-from-src-debian.sh [version]

GIT_VERSION=${1:-"latest"}
USE_PPA_IF_AVAILABLE=${2:-"true"}

set -e

Expand All @@ -18,13 +19,30 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi

if [ "${GIT_VERSION}" = "latest" ] || [ "${GIT_VERSION}" = "lts" ] || [ "${GIT_VERSION}" = "current" ]; then
RECENT_TAGS=$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/git/git/tags")
GIT_VERSION=$(echo ${RECENT_TAGS} | grep -oE 'name":\s*"v[0-9]+\.[0-9]+\.[0-9]+"' | head -n 1 | sed 's/^name":\s*"v\(.*\)"$/\1/')
fi

export DEBIAN_FRONTEND=noninteractive

# Source /etc/os-release to get OS info
Chuxel marked this conversation as resolved.
Show resolved Hide resolved
. /etc/os-release
# If ubuntu, PPAs allowed, and latest - install from there
if ([ "${GIT_VERSION}" = "latest" ] || [ "${GIT_VERSION}" = "lts" ] || [ "${GIT_VERSION}" = "current" ]) && [ "${ID}" = "ubuntu" ] && [ "${USE_PPA_IF_AVAILABLE}" = "true" ]; then
echo "Using PPA to install latest git..."
if ! dpkg -s apt-transport-https curl ca-certificates gnupg2 > /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
apt-get update
fi
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates gnupg2
fi
export GNUPGHOME="/tmp/git-core/gnupg"
mkdir -p "${GNUPGHOME}"
chmod 700 ${GNUPGHOME}
gpg -q --no-default-keyring --keyring /usr/share/keyrings/gitcoreppa-archive-keyring.gpg --keyserver keyserver.ubuntu.com --receive-keys E1DD270288B4E6030699E45FA1715D88E1DF1F24
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-core-ppa.list
apt-get update
apt-get -y install --no-install-recommends git
rm -rf "/tmp/gh/gnupg"
exit 0
fi

# Install required packages to build if missing
if ! dpkg -s build-essential curl ca-certificates tar gettext libssl-dev zlib1g-dev libexpat1-dev> /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
Expand All @@ -33,6 +51,11 @@ if ! dpkg -s build-essential curl ca-certificates tar gettext libssl-dev zlib1g-
apt-get -y install --no-install-recommends build-essential curl ca-certificates tar gettext libssl-dev zlib1g-dev libcurl?-openssl-dev libexpat1-dev
fi

if [ "${GIT_VERSION}" = "latest" ] || [ "${GIT_VERSION}" = "lts" ] || [ "${GIT_VERSION}" = "current" ]; then
RECENT_TAGS=$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/git/git/tags")
GIT_VERSION=$(echo ${RECENT_TAGS} | grep -oE 'name":\s*"v[0-9]+\.[0-9]+\.[0-9]+"' | head -n 1 | sed 's/^name":\s*"v\(.*\)"$/\1/')
fi

echo "Downloading source for ${GIT_VERSION}..."
curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz | tar -xzC /tmp 2>&1
echo "Building..."
Expand Down
28 changes: 21 additions & 7 deletions script-library/git-lfs-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,34 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi

export DEBIAN_FRONTEND=noninteractive

# Install git and curl if missing
if ! dpkg -s git curl ca-certificates > /dev/null 2>&1; then
# Function to run apt-get if needed
apt-get-update-if-needed()
{
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update
else
echo "Skipping apt-get update."
fi
apt-get -y install --no-install-recommends git curl ca-certificates
}

export DEBIAN_FRONTEND=noninteractive

# Install git, curl, gpg, and debian-archive-keyring if missing
. /etc/os-release
if ! dpkg -s git curl ca-certificates gnupg2 apt-transport-https > /dev/null 2>&1; then
apt-get-update-if-needed
apt-get -y install --no-install-recommends git curl ca-certificates gnupg2 apt-transport-https
fi
if [ "${ID}" = "debian" ] &&! dpkg -s debian-archive-keyring > /dev/null 2>&1; then
apt-get-update-if-needed
apt-get -y debian-archive-keyring
fi

# Install Git LFS
echo "Downloading Git LFS..."
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
echo "Installing Git LFS..."
curl -sSL https://packagecloud.io/github/git-lfs/gpgkey | gpg --dearmor > /usr/share/keyrings/gitlfs-archive-keyring.gpg
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitlfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/${ID} ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitlfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-lfs.list
apt-get install -yq git-lfs
git lfs install
echo "Done!"
30 changes: 18 additions & 12 deletions script-library/github-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,31 @@ fi

export DEBIAN_FRONTEND=noninteractive

# Install curl, apt-transport-https or gpg if missing
if ! dpkg -s curl ca-certificates > /dev/null 2>&1; then
# Install curl, apt-transport-https, curl, gpg, or dirmngr if missing
if ! dpkg -s curl ca-certificates apt-transport-https dirmngr gnupg2 > /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
apt-get update
fi
apt-get -y install --no-install-recommends curl ca-certificates
apt-get -y install --no-install-recommends curl ca-certificates apt-transport-https dirmngr gnupg2
fi

# Get latest release number if latest is specified
if [ "${CLI_VERSION}" = "latest" ] || [ "${CLI_VERSION}" = "current" ] || [ "${CLI_VERSION}" = "lts" ]; then
LATEST_RELEASE=$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/cli/cli/releases?per_page=1&page=1")
CLI_VERSION=$(echo ${LATEST_RELEASE} | grep -oE 'tag_name":\s*"v[^"]+' | sed -n '/tag_name":\s*"v/s///p')
if [ "${CLI_VERSION}" != "latest" ] && [ "${CLI_VERSION}" != "lts" ] && [ "${CLI_VERSION}" != "stable" ]; then
VERSION_SUFFIX="=${CLI_VERSION}"
else
VERSION_SUFFIX=""
fi

# Install the GitHub CLI
echo "Downloading github CLI..."
curl -OsSL https://github.com/cli/cli/releases/download/v${CLI_VERSION}/gh_${CLI_VERSION}_linux_amd64.deb
echo "Installing github CLI..."
apt-get -y install ./gh_${CLI_VERSION}_linux_amd64.deb
echo "Removing github CLI deb file after installation..."
rm -rf ./gh_${CLI_VERSION}_linux_amd64.deb
# Use different home to ensure nothing pollutes user directories
export GNUPGHOME="/tmp/gh/gnupg"
mkdir -p "${GNUPGHOME}"
chmod 700 ${GNUPGHOME}
# Import key safely (new method rather than deprecated apt-key approach) and install
. /etc/os-release
gpg -q --no-default-keyring --keyring /usr/share/keyrings/githubcli-archive-keyring.gpg --keyserver keyserver.ubuntu.com --receive-keys C99B11DEB97541F0
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/github-cli.list
apt-get update
apt-get -y install "gh${VERSION_SUFFIX}"
rm -rf "/tmp/gh/gnupg"
echo "Done!"
11 changes: 10 additions & 1 deletion script-library/go-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,20 @@ if [ "${TARGET_GO_VERSION}" = "latest" ] || [ "${TARGET_GO_VERSION}" = "current
TARGET_GO_VERSION=$(curl -sSL "https://golang.org/VERSION?m=text" | sed -n '/^go/s///p' )
fi

ARCHITECTURE="$(uname -m)"
case $ARCHITECTURE in
x86_64) ARCHITECTURE="amd64";;
aarch64 | armv8*) ARCHITECTURE="arm64";;
aarch32 | armv7* | armvhf*) ARCHITECTURE="armv6l";;
i?86) ARCHITECTURE="386";;
*) echo "(!) Architecture unsupported"; exit 1 ;;
Chuxel marked this conversation as resolved.
Show resolved Hide resolved
esac

# Install Go
GO_INSTALL_SCRIPT="$(cat <<EOF
set -e
echo "Downloading Go ${TARGET_GO_VERSION}..."
curl -sSL -o /tmp/go.tar.gz "https://golang.org/dl/go${TARGET_GO_VERSION}.linux-amd64.tar.gz"
curl -sSL -o /tmp/go.tar.gz "https://golang.org/dl/go${TARGET_GO_VERSION}.linux-${ARCHITECTURE}.tar.gz"
echo "Extracting Go ${TARGET_GO_VERSION}..."
tar -xzf /tmp/go.tar.gz -C "${TARGET_GOROOT}" --strip-components=1
rm -f /tmp/go.tar.gz
Expand Down
6 changes: 6 additions & 0 deletions script-library/homebrew-debian.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ function updatefishconfig() {

export DEBIAN_FRONTEND=noninteractive

ARCHITECTURE="$(uname -m)"
if [ "${ARCHITECTURE}" != "amd64" ] && [ "${ARCHITECTURE}" != "x86_64" ]; then
echo "(!) Architecture unsupported"
exit 1
fi

# Install dependencies if missing
if ! dpkg -s \
bzip2 \
Expand Down
6 changes: 6 additions & 0 deletions script-library/java-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ function updaterc() {

export DEBIAN_FRONTEND=noninteractive

ARCHITECTURE="$(uname -m)"
if [ "${ARCHITECTURE}" != "amd64" ] && [ "${ARCHITECTURE}" != "x86_64" ] && [ "${ARCHITECTURE}" != "arm64" ] && [ "${ARCHITECTURE}" != "aarch64" ]; then
echo "(!) Architecture unsupported"
exit 1
fi

# Install curl, zip, unzip if missing
if ! dpkg -s curl ca-certificates zip unzip sed > /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
Expand Down
Loading