Trove image build fails getting percona key
This fails often in the gate and I ran into it migrating trove-integration into trove-image-builder. The most common cause for this is that keys.gnupg.net fails. While there are multiple servers proxied for this service, sometimes they fail. In general people have found keyserver.ubuntu.com to be more reliable. Change-Id: I97dcb9120c75129d8a0aaed9ddd39b9e5fa7e608 Closes-Bug: #1579094
This commit is contained in:
parent
ccc33811cf
commit
e363325c02
|
@ -12,8 +12,23 @@ set -o xtrace
|
|||
# Add Percona GPG key
|
||||
mkdir -p /home/${GUEST_USERNAME}/.gnupg
|
||||
|
||||
# sometimes the primary key server is unavailable and we should try an
|
||||
# alternate. see
|
||||
# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
|
||||
# shell errexit so we can interrogate the exit code and take action
|
||||
# based on the exit code. We will reenable it later.
|
||||
set +e
|
||||
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
|
||||
|
||||
if [ "$?" -ne "0" ];
|
||||
then
|
||||
echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
|
||||
set -e
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# Add Percona repo
|
||||
# Creates the Percona sources list
|
||||
cat <<EOL > /etc/apt/sources.list.d/percona.list
|
||||
|
|
|
@ -12,8 +12,23 @@ set -o xtrace
|
|||
# Add Percona GPG key
|
||||
mkdir -p /home/${GUEST_USERNAME}/.gnupg
|
||||
|
||||
# sometimes the primary key server is unavailable and we should try an
|
||||
# alternate. see
|
||||
# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
|
||||
# shell errexit so we can interrogate the exit code and take action
|
||||
# based on the exit code. We will reenable it later.
|
||||
set +e
|
||||
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
|
||||
|
||||
if [ "$?" -ne "0" ];
|
||||
then
|
||||
echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
|
||||
set -e
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# Add Percona repo
|
||||
# Creates the percona sources list
|
||||
cat <<EOL > /etc/apt/sources.list.d/percona.list
|
||||
|
|
|
@ -14,8 +14,23 @@ if [ ! -e /home/${GUEST_USERNAME}/.gnupg ]; then
|
|||
mkdir -p /home/${GUEST_USERNAME}/.gnupg
|
||||
fi
|
||||
|
||||
# sometimes the primary key server is unavailable and we should try an
|
||||
# alternate. see
|
||||
# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
|
||||
# shell errexit so we can interrogate the exit code and take action
|
||||
# based on the exit code. We will reenable it later.
|
||||
set +e
|
||||
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
|
||||
|
||||
if [ "$?" -ne "0" ];
|
||||
then
|
||||
echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
|
||||
set -e
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# add Percona repo
|
||||
# creates the percona sources list
|
||||
cat <<EOL > /etc/apt/sources.list.d/percona.list
|
||||
|
|
|
@ -14,8 +14,23 @@ if [ ! -e /home/${GUEST_USERNAME}/.gnupg ]; then
|
|||
mkdir -p /home/${GUEST_USERNAME}/.gnupg
|
||||
fi
|
||||
|
||||
# sometimes the primary key server is unavailable and we should try an
|
||||
# alternate. see
|
||||
# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
|
||||
# shell errexit so we can interrogate the exit code and take action
|
||||
# based on the exit code. We will reenable it later.
|
||||
set +e
|
||||
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
|
||||
|
||||
if [ "$?" -ne "0" ];
|
||||
then
|
||||
echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
|
||||
set -e
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# add Percona repo
|
||||
# creates the percona sources list
|
||||
cat <<EOL > /etc/apt/sources.list.d/percona.list
|
||||
|
|
Loading…
Reference in New Issue