Add support for direct building of a URL
This allows for things like: (to build test a PR branch directly) ```console $ ./build.sh https://raw.githubusercontent.com/infosiftr/stackbrew/redis/library/redis ``` Or: (to build test just one tag of a PR branch) ```console $ ./build.sh https://raw.githubusercontent.com/infosiftr/stackbrew/redis/library/redis:2.6 ```
This commit is contained in:
parent
ea51941ed4
commit
ad38f3333a
34
build.sh
34
build.sh
|
|
@ -112,17 +112,35 @@ for repoTag in "${repos[@]}"; do
|
||||||
tag="${repoTag#*:}"
|
tag="${repoTag#*:}"
|
||||||
[ "$repo" != "$tag" ] || tag=
|
[ "$repo" != "$tag" ] || tag=
|
||||||
|
|
||||||
if [ -f "$repo" ]; then
|
if [ "$repo" = 'http' -o "$repo" = 'https' ] && [[ "$tag" == //* ]]; then
|
||||||
repoFile="$repo"
|
# IT'S A URL!
|
||||||
repo="$(basename "$repoFile")"
|
repoUrl="$repo:${tag%:*}"
|
||||||
|
repo="$(basename "$repoUrl")"
|
||||||
|
if [ "${tag##*:}" != "$tag" ]; then
|
||||||
|
tag="${tag##*:}"
|
||||||
|
else
|
||||||
|
tag=
|
||||||
|
fi
|
||||||
repoTag="${repo}${tag:+:$tag}"
|
repoTag="${repo}${tag:+:$tag}"
|
||||||
|
|
||||||
|
echo "$repoTag ($repoUrl)" >> "$logDir/repos.txt"
|
||||||
|
|
||||||
|
cmd=( curl -sSL --compressed "$repoUrl" )
|
||||||
else
|
else
|
||||||
repoFile="$library/$repo"
|
if [ -f "$repo" ]; then
|
||||||
|
repoFile="$repo"
|
||||||
|
repo="$(basename "$repoFile")"
|
||||||
|
repoTag="${repo}${tag:+:$tag}"
|
||||||
|
else
|
||||||
|
repoFile="$library/$repo"
|
||||||
|
fi
|
||||||
|
|
||||||
|
repoFile="$(readlink -f "$repoFile")"
|
||||||
|
echo "$repoTag ($repoFile)" >> "$logDir/repos.txt"
|
||||||
|
|
||||||
|
cmd=( cat "$repoFile" )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
repoFile="$(readlink -f "$repoFile")"
|
|
||||||
echo "$repoTag ($repoFile)" >> "$logDir/repos.txt"
|
|
||||||
|
|
||||||
if [ "${repoGitRepo[$repoTag]}" ]; then
|
if [ "${repoGitRepo[$repoTag]}" ]; then
|
||||||
queue+=( "$repoTag" )
|
queue+=( "$repoTag" )
|
||||||
continue
|
continue
|
||||||
|
|
@ -130,7 +148,7 @@ for repoTag in "${repos[@]}"; do
|
||||||
|
|
||||||
# parse the repo library file
|
# parse the repo library file
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
repoTagLines=( $(cat "$repoFile" | grep -vE '^#|^\s*$') )
|
repoTagLines=( $("${cmd[@]}" | grep -vE '^#|^\s*$') )
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
tags=()
|
tags=()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue