Skip to content

Commit 479e8b5

Browse files
authored
Update the install script for doppler to avoid the deprecated apt-key call (#1)
* Update the install script for doppler to avoid the deprecated apt-key call
1 parent 1c0023d commit 479e8b5

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

src/doppler/install.sh

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,29 @@ echo "doppler completion files installed: $COMPLETION"
1212
DIRECTORY="$_REMOTE_USER_HOME"
1313

1414
export DEBIAN_FRONTEND=noninteractive
15-
apt_get_update()
16-
{
17-
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
18-
echo "Running apt-get update..."
19-
apt-get update -y
20-
fi
15+
apt_get_update() {
16+
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
17+
echo "Running apt-get update..."
18+
apt-get update -y
19+
fi
2120
}
2221

2322
# Checks if packages are installed and installs them if not
2423
check_packages() {
25-
if ! dpkg -s "$@" > /dev/null 2>&1; then
26-
apt_get_update
27-
apt-get -y install --no-install-recommends "$@"
28-
fi
24+
if ! dpkg -s "$@" >/dev/null 2>&1; then
25+
apt_get_update
26+
apt-get -y install --no-install-recommends "$@"
27+
fi
2928
}
3029

3130
apt_get_update
3231
check_packages apt-transport-https ca-certificates curl gnupg
3332

34-
35-
# Add Doppler's GPG key
36-
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | apt-key add -
33+
# Add Doppler's GPG key without apt-key (deprecated)
34+
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | sudo gpg --dearmor -o /usr/share/keyrings/doppler-archive-keyring.gpg
3735

3836
# Add Doppler's apt repo
39-
echo "deb https://packages.doppler.com/public/cli/deb/debian any-version main" > /etc/apt/sources.list.d/doppler-cli.list
37+
echo "deb [signed-by=/usr/share/keyrings/doppler-archive-keyring.gpg] https://packages.doppler.com/public/cli/deb/debian any-version main" | sudo tee /etc/apt/sources.list.d/doppler-cli.list
4038

4139
# Fetch and install latest doppler cli
4240
apt-get update && apt-get install -y doppler
@@ -46,18 +44,18 @@ cp ${PWD}/scripts/setup-doppler.sh /usr/local/share/doppler/setup-doppler.sh
4644
chmod +x /usr/local/share/doppler/setup-doppler.sh
4745

4846
if [ "$COMPLETION" = "true" ]; then
49-
apt-get install -y bash-completion
47+
apt-get install -y bash-completion
5048

51-
mkdir -p /usr/share/bash-completion/completions
52-
doppler completion install bash
49+
mkdir -p /usr/share/bash-completion/completions
50+
doppler completion install bash
5351

54-
mkdir -p /usr/local/share/zsh/site-functions
55-
doppler completion install zsh
52+
mkdir -p /usr/local/share/zsh/site-functions
53+
doppler completion install zsh
5654

57-
# for some reason you can't install fish completions from a shell
58-
# other than fish. So we'll skip until someone files an issue.
59-
#mkdir -p /usr/share/fish/vendor_completions.d
60-
#doppler completion install fish
55+
# for some reason you can't install fish completions from a shell
56+
# other than fish. So we'll skip until someone files an issue.
57+
#mkdir -p /usr/share/fish/vendor_completions.d
58+
#doppler completion install fish
6159
fi
6260

6361
# Clean up

0 commit comments

Comments
 (0)