Skip to content

Commit

Permalink
Update installation steps for not using apt-key (#1498)
Browse files Browse the repository at this point in the history
Remove use of apt-key for Ubuntu 21+ and Debian 11+
  • Loading branch information
sethiay authored and gargnitingoogle committed Nov 28, 2023
1 parent b452779 commit eee69e4
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tools/cd_scripts/install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,31 @@ EOF
#details.txt file contains the release version and commit hash of the current release.
gsutil cp gs://gcsfuse-release-packages/version-detail/details.txt .
# Writing VM instance name to details.txt (Format: release-test-<os-name>)
curl http://metadata.google.internal/computeMetadata/v1/instance/name -H "Metadata-Flavor: Google" >> details.txt
vm_instance_name=$(curl http://metadata.google.internal/computeMetadata/v1/instance/name -H "Metadata-Flavor: Google")
echo $vm_instance_name >> details.txt
touch ~/logs.txt

# Based on the os type(from vm instance name) in detail.txt, run the following
# commands to install gcsfuse.
if grep -q ubuntu details.txt || grep -q debian details.txt;
then
# For ubuntu and debian os
# For ubuntu and debian os
export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s`
echo "deb https://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
# Don't use apt-key for Debian 11+ and Ubuntu 21+
if { [[ $vm_instance_name == *"debian"* && !( "$vm_instance_name" < "release-test-debian-11") ]]; } || { [[ $vm_instance_name == *"ubuntu"* && !("$vm_instance_name" < "release-test-ubuntu-21") ]]; }
then
echo "deb [signed-by=/usr/share/keyrings/cloud.google.asc] https://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /usr/share/keyrings/cloud.google.asc >> ~/apt_key_logs.txt
else
echo "deb https://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - >> ~/apt_key_logs.txt
fi

if grep -q -i warning ~/apt_key_logs.txt;
then
echo "Failure: Got warning while using apt-key" >> ~/logs.txt
fi

sudo apt-get update
# Install latest released gcsfuse version
sudo apt-get install -y gcsfuse
Expand Down

0 comments on commit eee69e4

Please sign in to comment.