Commit ae05c20c authored by Roberto Oliveira's avatar Roberto Oliveira Committed by Jakub Jirutka

travis: don't download static apk if available on the system

Just download the APK tools if the install-alpine script is running in
a system that doesn't have APK installed. This is needed for upcoming
ppc64le builder.
parent bcec60d6
...@@ -7,15 +7,18 @@ set -eu ...@@ -7,15 +7,18 @@ set -eu
APK_TOOLS_SHA256='e949d3826d08ad41622b29186f960b135711dd96aacfb80ff8238c0fd69d051f' APK_TOOLS_SHA256='e949d3826d08ad41622b29186f960b135711dd96aacfb80ff8238c0fd69d051f'
APK=$(which apk 2>/dev/null) || true
title 'Downloading static apk-tools' if [ ! -e "$APK" ]; then
title 'Downloading static apk-tools'
cd /tmp
wget -T 10 "$APK_TOOLS_URI"
echo "$APK_TOOLS_SHA256 ${APK_TOOLS_URI##*/}" | sha256sum -c
tar -xzf ${APK_TOOLS_URI##*/}
mv apk-tools-*/apk apk
cd /tmp
wget -T 10 "$APK_TOOLS_URI"
echo "$APK_TOOLS_SHA256 ${APK_TOOLS_URI##*/}" | sha256sum -c
tar -xzf ${APK_TOOLS_URI##*/}
mv apk-tools-*/apk /tmp/apk
title 'Installing Alpine Linux' title 'Installing Alpine Linux'
...@@ -26,7 +29,7 @@ echo "$MIRROR_URI/main" > etc/apk/repositories ...@@ -26,7 +29,7 @@ echo "$MIRROR_URI/main" > etc/apk/repositories
cp -R "$CLONE_DIR"/.travis/keys etc/apk/keys cp -R "$CLONE_DIR"/.travis/keys etc/apk/keys
cp /etc/resolv.conf etc/resolv.conf cp /etc/resolv.conf etc/resolv.conf
/tmp/apk \ $APK \
--root . --update-cache --initdb --no-progress \ --root . --update-cache --initdb --no-progress \
add alpine-base add alpine-base
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment