-
Notifications
You must be signed in to change notification settings - Fork 224
/
gsl.sh
executable file
·29 lines (25 loc) · 664 Bytes
/
gsl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "$BASH_SOURCE")"
dir="$(basename "$PWD")"
cd ..
from="$(awk '$1 == "FROM" { print $2; exit }' "$dir/Dockerfile")" # TODO multi-stage build??
fromArches="$(bashbrew remote arches --json "$from" | jq -c '.arches | keys')"
arches="$(jq -r -L "$dir/../.libs" --argjson fromArches "$fromArches" '
include "lib"
;
[
$fromArches,
(.arches | map_values(select(.apkArch)) | keys),
empty
]
| intersection
| join(", ")
' "$dir/versions.json")"
[ -n "$arches" ]
source gsl-libs.sh
globalEntry
env="${dir^^}_VERSION"
env="${env//-/_}"
versionedEnvTagsEntry "$dir" "$env" latest
echo "Architectures: $arches"