mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Merge branch 'master' of https://github.com/miketimofeev/virtual-environments into v-mitim/get_rid_of_apt.sh_invocation
This commit is contained in:
@@ -14,9 +14,9 @@ download_with_retries() {
|
||||
local COMPRESSED="$4"
|
||||
|
||||
if [ $COMPRESSED == "compressed" ]; then
|
||||
COMMAND="curl $URL -4 -s --compressed -o '$DEST/$NAME'"
|
||||
COMMAND="curl $URL -4 -sL --compressed -o '$DEST/$NAME'"
|
||||
else
|
||||
COMMAND="curl $URL -4 -s -o '$DEST/$NAME'"
|
||||
COMMAND="curl $URL -4 -sL -o '$DEST/$NAME'"
|
||||
fi
|
||||
|
||||
echo "Downloading $URL..."
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
## File: basic.sh
|
||||
## Desc: Installs basic command line utilities and dev packages
|
||||
################################################################################
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
|
||||
set -e
|
||||
|
||||
common_packages="dnsutils
|
||||
iproute2
|
||||
iputils-ping
|
||||
libc++-dev
|
||||
libc++abi-dev
|
||||
libcurl3
|
||||
libicu55
|
||||
libunwind8
|
||||
locales
|
||||
openssh-client
|
||||
tzdata
|
||||
zstd
|
||||
lib32z1
|
||||
libxkbfile-dev
|
||||
pkg-config
|
||||
libsecret-1-dev
|
||||
libxss1
|
||||
libgconf-2-4
|
||||
dbus
|
||||
xvfb
|
||||
libgbm-dev
|
||||
libgtk-3-0
|
||||
tk
|
||||
fakeroot
|
||||
dpkg
|
||||
rpm
|
||||
xz-utils
|
||||
xorriso
|
||||
zsync
|
||||
gnupg2
|
||||
texinfo"
|
||||
|
||||
cmd_packages="curl
|
||||
file
|
||||
ftp
|
||||
jq
|
||||
netcat
|
||||
ssh
|
||||
parallel
|
||||
rsync
|
||||
shellcheck
|
||||
sudo
|
||||
telnet
|
||||
time
|
||||
unzip
|
||||
zip
|
||||
wget
|
||||
upx
|
||||
m4
|
||||
bison
|
||||
flex"
|
||||
|
||||
# Install basic command-line utilities
|
||||
for package in $common_packages $cmd_packages; do
|
||||
echo "Install $package"
|
||||
apt-fast install -y --no-install-recommends $package
|
||||
done
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
for cmd in $cmd_packages; do
|
||||
if ! command -v $cmd; then
|
||||
echo "$cmd was not installed"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "Basic packages:"
|
||||
for package in $common_packages $cmd_packages; do
|
||||
DocumentInstalledItemIndent $package
|
||||
done
|
||||
@@ -37,7 +37,8 @@ common_packages="dnsutils
|
||||
zsync
|
||||
gnupg2
|
||||
lib32z1
|
||||
texinfo"
|
||||
texinfo
|
||||
libsqlite3-dev"
|
||||
|
||||
cmd_packages="curl
|
||||
file
|
||||
@@ -56,7 +57,10 @@ cmd_packages="curl
|
||||
wget
|
||||
m4
|
||||
bison
|
||||
flex"
|
||||
flex
|
||||
patchelf
|
||||
bzip2
|
||||
sqlite3"
|
||||
|
||||
if isUbuntu20 ; then
|
||||
echo "Install python2"
|
||||
@@ -64,7 +68,7 @@ if isUbuntu20 ; then
|
||||
fi
|
||||
|
||||
echo "Install libcurl"
|
||||
if isUbuntu18 ; then
|
||||
if isUbuntu16 || isUbuntu18; then
|
||||
libcurelVer="libcurl3"
|
||||
fi
|
||||
|
||||
@@ -74,12 +78,19 @@ fi
|
||||
|
||||
apt-get install -y --no-install-recommends $libcurelVer
|
||||
|
||||
# install additional packages only for Ubuntu16.04
|
||||
if isUbuntu16; then
|
||||
common_packages="$common_packages
|
||||
libc++-dev
|
||||
libc++abi-dev
|
||||
libicu55"
|
||||
fi
|
||||
|
||||
for package in $common_packages $cmd_packages; do
|
||||
echo "Install $package"
|
||||
apt-get install -y --no-install-recommends $package
|
||||
done
|
||||
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
for cmd in $cmd_packages; do
|
||||
|
||||
30
images/linux/scripts/installers/oras-cli.sh
Normal file
30
images/linux/scripts/installers/oras-cli.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
## File: oras-cli.sh
|
||||
## Desc: Installs ORAS CLI
|
||||
################################################################################
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
source $HELPER_SCRIPTS/install.sh
|
||||
|
||||
# Determine latest ORAS CLI version
|
||||
ORAS_CLI_LATEST_VERSION_URL=https://api.github.com/repos/deislabs/oras/releases/latest
|
||||
ORAS_CLI_DOWNLOAD_URL=$(curl -s $ORAS_CLI_LATEST_VERSION_URL | jq -r '.assets[].browser_download_url | select(contains("linux_amd64.tar.gz"))')
|
||||
ORAS_CLI_ARCHIVE=$(basename $ORAS_CLI_DOWNLOAD_URL)
|
||||
|
||||
# Install ORAS CLI
|
||||
cd /tmp
|
||||
download_with_retries $ORAS_CLI_DOWNLOAD_URL
|
||||
tar -zxvf $ORAS_CLI_ARCHIVE -C /usr/local/bin oras
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! oras version; then
|
||||
echo "ORAS CLI was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "ORAS CLI $(oras version | awk 'NR==1{print $2}')"
|
||||
@@ -19,13 +19,15 @@ source $CARGO_HOME/env
|
||||
# Install common tools
|
||||
rustup component add rustfmt clippy
|
||||
cargo install bindgen cbindgen
|
||||
cargo install cargo-audit
|
||||
cargo install cargo-outdated
|
||||
|
||||
echo "Test installation of the Rust toochain"
|
||||
|
||||
# Permissions
|
||||
chmod -R 777 $(dirname $RUSTUP_HOME)
|
||||
|
||||
for cmd in rustup rustc rustdoc cargo rustfmt cargo-clippy bindgen cbindgen; do
|
||||
for cmd in rustup rustc rustdoc cargo rustfmt cargo-clippy bindgen cbindgen 'cargo audit' 'cargo outdated'; do
|
||||
if ! command -v $cmd --version; then
|
||||
echo "$cmd was not installed or is not found on the path"
|
||||
exit 1
|
||||
@@ -54,3 +56,5 @@ DocumentInstalledItem "clippy ($(cargo-clippy --version 2>&1 | cut -d ' ' -f 2))
|
||||
DocumentInstalledItem "rustdoc ($(rustdoc --version 2>&1 | cut -d ' ' -f 2))"
|
||||
DocumentInstalledItem "bindgen ($(bindgen --version 2>&1 | cut -d ' ' -f 2))"
|
||||
DocumentInstalledItem "cbindgen ($(cbindgen --version 2>&1 | cut -d ' ' -f 2))"
|
||||
DocumentInstalledItem "cargo audit ($(cargo audit --version 2>&1 | cut -d ' ' -f 2))"
|
||||
DocumentInstalledItem "cargo outdated ($(cargo outdated --version 2>&1 | cut -d ' ' -f 2))"
|
||||
Reference in New Issue
Block a user