[ubuntu] Remove apt-key from build scripts (#9082)

This commit is contained in:
Shamil Mubarakshin
2023-12-29 18:11:55 +01:00
committed by GitHub
parent 1658c2e905
commit 266f9413d3
5 changed files with 52 additions and 25 deletions

View File

@@ -19,11 +19,12 @@ fi
# Packages is available in the official Ubuntu upstream starting from Ubuntu 21 # Packages is available in the official Ubuntu upstream starting from Ubuntu 21
if is_ubuntu20; then if is_ubuntu20; then
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable" REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$(lsb_release -rs)"
source /etc/os-release GPG_KEY="/usr/share/keyrings/devel_kubic_libcontainers_stable.gpg"
sh -c "echo 'deb ${REPO_URL}/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" REPO_PATH="/etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
apt-key add Release.key curl -fsSL "${REPO_URL}/Release.key" | gpg --dearmor -o $GPG_KEY
echo "deb [arch=amd64 signed-by=$GPG_KEY] ${REPO_URL}/ /" > $REPO_PATH
fi fi
# Install podman, buildah, scopeo container's tools # Install podman, buildah, scopeo container's tools
@@ -34,7 +35,9 @@ printf "[registries.search]\nregistries = ['docker.io', 'quay.io']\n" | tee /etc
if is_ubuntu20; then if is_ubuntu20; then
# Remove source repo # Remove source repo
rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list rm $GPG_KEY
rm $REPO_PATH
# Document source repo # Document source repo
echo "containers $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt echo "containers $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
fi fi

View File

@@ -4,16 +4,19 @@
## Desc: Install Heroku CLI. Based on instructions found here: https://devcenter.heroku.com/articles/heroku-cli ## Desc: Install Heroku CLI. Based on instructions found here: https://devcenter.heroku.com/articles/heroku-cli
################################################################################ ################################################################################
# add heroku repository to apt REPO_URL="https://cli-assets.heroku.com/channels/stable/apt"
echo "deb https://cli-assets.heroku.com/channels/stable/apt ./" > /etc/apt/sources.list.d/heroku.list GPG_KEY="/usr/share/keyrings/heroku.gpg"
REPO_PATH="/etc/apt/sources.list.d/heroku.list"
# install heroku's release key for package verification # add heroku repository to apt
curl https://cli-assets.heroku.com/channels/stable/apt/release.key | apt-key add - curl -fsSL "${REPO_URL}/release.key" | gpg --dearmor -o $GPG_KEY
echo "deb [signed-by=$GPG_KEY] $REPO_URL ./" > $REPO_PATH
# install heroku # install heroku
apt-get update -y && apt-get install -y heroku apt-get update -y && apt-get install -y heroku
# remove heroku's apt repository # remove heroku's apt repository
rm /etc/apt/sources.list.d/heroku.list rm $REPO_PATH
rm $GPG_KEY
invoke_tests "Tools" "Heroku" invoke_tests "Tools" "Heroku"

View File

@@ -4,10 +4,20 @@
## Desc: Install HHVM ## Desc: Install HHVM
################################################################################ ################################################################################
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 REPO_URL="https://dl.hhvm.com/ubuntu"
add-apt-repository https://dl.hhvm.com/ubuntu GPG_KEY="/usr/share/keyrings/hhvm.gpg"
REPO_PATH="/etc/apt/sources.list.d/hhvm.list"
# add HHVM repository to apt
curl -fsSL https://dl.hhvm.com/conf/hhvm.gpg.key | gpg --dearmor -o $GPG_KEY
echo "deb [signed-by=$GPG_KEY] $REPO_URL $(lsb_release -cs) main" > $REPO_PATH
# install HHVM
apt-get update apt-get update
apt-get -qq install -y hhvm apt-get -qq install -y hhvm
# remove HHVM's apt repository
rm $REPO_PATH
rm $GPG_KEY
invoke_tests "Tools" "HHVM" invoke_tests "Tools" "HHVM"

View File

@@ -7,19 +7,24 @@
# Source the helpers # Source the helpers
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
REPO_URL="https://repo.mongodb.org/apt/ubuntu"
os_label=$(lsb_release -cs)
toolset_version=$(get_toolset_value '.mongodb.version') toolset_version=$(get_toolset_value '.mongodb.version')
REPO_URL="https://repo.mongodb.org/apt/ubuntu"
GPG_KEY="/usr/share/keyrings/mongodb-org-$toolset_version.gpg"
REPO_PATH="/etc/apt/sources.list.d/mongodb-org-$toolset_version.list"
# Install Mongo DB # add Mongo DB repository to apt
wget -qO - https://www.mongodb.org/static/pgp/server-$toolset_version.asc | sudo apt-key add - curl -fsSL https://www.mongodb.org/static/pgp/server-$toolset_version.asc | gpg --dearmor -o $GPG_KEY
echo "deb [ arch=amd64,arm64 signed-by=$GPG_KEY ] $REPO_URL $(lsb_release -cs)/mongodb-org/$toolset_version multiverse" > $REPO_PATH
echo "deb [ arch=amd64,arm64 ] $REPO_URL $os_label/mongodb-org/$toolset_version multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$toolset_version.list # Install Mongo DB
sudo apt-get update sudo apt-get update
sudo apt-get install -y mongodb-org sudo apt-get install -y mongodb-org
rm /etc/apt/sources.list.d/mongodb-org-$toolset_version.list # remove Mongo DB's apt repository
rm $REPO_PATH
rm $GPG_KEY
# Document source repo
echo "mongodb $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt echo "mongodb $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
invoke_tests "Databases" "MongoDB" invoke_tests "Databases" "MongoDB"

View File

@@ -8,23 +8,29 @@
source $HELPER_SCRIPTS/os.sh source $HELPER_SCRIPTS/os.sh
os_label=$(lsb_release -cs) os_label=$(lsb_release -cs)
REPO_URL="https://download.mono-project.com/repo/ubuntu"
GPG_KEY="/usr/share/keyrings/mono-official-stable.gpg"
REPO_PATH="/etc/apt/sources.list.d/mono-official-stable.list"
# There are no packages for Ubuntu 22 in the repo, but developers confirmed that packages from Ubuntu 20 should work # There are no packages for Ubuntu 22 in the repo, but developers confirmed that packages from Ubuntu 20 should work
if is_ubuntu22; then if is_ubuntu22; then
os_label="focal" os_label="focal"
fi fi
# Test to see if the software in question is already installed, if not install it # Install Mono repo
# wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -O out && sudo apt-key add out && rm out curl -fsSL https://download.mono-project.com/repo/xamarin.gpg | gpg --dearmor -o $GPG_KEY
echo "deb [signed-by=$GPG_KEY] $REPO_URL stable-$os_label main" > $REPO_PATH
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF # Install Mono
echo "deb https://download.mono-project.com/repo/ubuntu stable-$os_label main" | tee /etc/apt/sources.list.d/mono-official-stable.list
apt-get update apt-get update
apt-get install -y --no-install-recommends apt-transport-https mono-complete nuget apt-get install -y --no-install-recommends apt-transport-https mono-complete nuget
rm /etc/apt/sources.list.d/mono-official-stable.list # Remove Mono's apt repo
rm -f /etc/apt/sources.list.d/mono-official-stable.list.save rm $REPO_PATH
rm -f "${REPO_PATH}.save"
rm $GPG_KEY
# Document source repo
echo "mono https://download.mono-project.com/repo/ubuntu stable-$os_label main" >> $HELPER_SCRIPTS/apt-sources.txt echo "mono https://download.mono-project.com/repo/ubuntu stable-$os_label main" >> $HELPER_SCRIPTS/apt-sources.txt
invoke_tests "Tools" "Mono" invoke_tests "Tools" "Mono"