Cache Steam runtime SDKs in their own subdirs

libdrm_amdgpu
jackun 3 years ago
parent f8bb948de2
commit ea45caa876
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -1,4 +1,5 @@
#!/usr/bin/env bash
# Usage example: $0 master soldier 0.20210618.0
set -u
if [ $# -eq 2 ]; then
@ -11,9 +12,12 @@ BRANCH="${1:-master}"
# soldier 0.20201022.1 or newer
# scout 0.20201104.0 or newer
RUNTIME="${2:-soldier}"
VERSION="${3:-0.20201022.1}"
IMAGE="steamrt_${RUNTIME}_amd64:mango-${VERSION}"
VERSION="${3:-0.20210618.0}"
IMAGE="steamrt_${RUNTIME}_${VERSION}_amd64:mango-${RUNTIME}"
BASEURL="https://repo.steampowered.com/steamrt-images-${RUNTIME}/snapshots/${VERSION}"
CACHEDIR="./cache/steamrt-images-${RUNTIME}/snapshots/${VERSION}"
mkdir -p "${CACHEDIR}"
echo -e "\e[1mBuilding branch \e[92m${BRANCH}\e[39m using \e[92m${RUNTIME}:${VERSION}\e[39m runtime\e[0m"
@ -23,8 +27,8 @@ if ! docker inspect --type=image ${IMAGE} 2>&1 >/dev/null ; then
mkdir -p ./cache/empty
sed "s/%RUNTIME%/${RUNTIME}/g" steamrt.Dockerfile.in > ./cache/steamrt.Dockerfile
wget -P ./cache -c ${BASEURL}/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-${RUNTIME}-sysroot.tar.gz
cp --reflink=always "./cache/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-${RUNTIME}-sysroot.tar.gz" ./cache/empty/
wget -P "${CACHEDIR}" -c ${BASEURL}/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-${RUNTIME}-sysroot.tar.gz
cp --reflink=always "${CACHEDIR}/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-${RUNTIME}-sysroot.tar.gz" ./cache/empty/
docker build -f ./cache/steamrt.Dockerfile -t ${IMAGE} ./cache/empty
fi

Loading…
Cancel
Save