Skip to content

Commit e29dc72

Browse files
LeonidVasTotktonada
authored andcommitted
travis-ci: handle packagecloud's HTTP redirects
Added curl options: * -L (--location) to follow Location header value from 3XX responses, because packagecloud.io redirects a GPG key request to a CDN. * -s (--silent) to don't show a progress meter. * -f (--fail) to fail the command at non 2XX HTTP responses. It'll fail `curl | <...>` command pipeline, since `set -o pipefail` is now enabled. Aside of that, fail test.sh script (and so a CI job) if something inside the script fails (`set -e`) and catch mistakes from using uninitialized bash variables (`set -u`) inside the script.
1 parent a812c10 commit e29dc72

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#!/bin/bash
22

3+
set -euo pipefail
4+
35
VERSION=${VERSION:-2_2}
46

5-
curl https://packagecloud.io/tarantool/${VERSION}/gpgkey | sudo apt-key add -
7+
curl -sfL https://packagecloud.io/tarantool/${VERSION}/gpgkey | sudo apt-key add -
68
release=`lsb_release -c -s`
79

810
sudo apt-get install -y apt-transport-https
911

1012
sudo tee /etc/apt/sources.list.d/tarantool_${VERSION}.list <<- EOF
11-
deb https://packagecloud.io/tarantool/${VERSION}/ubuntu/ $release main
12-
deb-src https://packagecloud.io/tarantool/${VERSION}/ubuntu/ $release main
13+
deb https://packagecloud.io/tarantool/${VERSION}/ubuntu/ ${release} main
14+
deb-src https://packagecloud.io/tarantool/${VERSION}/ubuntu/ ${release} main
1315
EOF
1416

1517
sudo apt-get update > /dev/null

0 commit comments

Comments
 (0)