Files
packages/.github/workflows/mg.sh
T
madomado 3ee61c35aa feat(ci): add debug to mg.sh (#367)
Signed-off-by: madomado <wboy111@outlook.com>
2023-04-09 15:22:36 -07:00

18 lines
656 B
Bash
Executable File

set -x
if $1; then
dirs=$2
dirs=${dirs/\/pkg/}
export p="{\"id\":\"$5\",\"ver\":\"%v\",\"rel\":\"%r\",\"arch\":\"$4\",\"dirs\":\"$dirs\"}"
else
export p="{\"id\":\"$5\",\"ver\":\"%v\",\"rel\":\"%r\",\"arch\":\"$4\"}"
fi
for f in anda-build/rpm/rpms/*; do
n=$(lesspipe.sh $f | grep -E "Name\s*: " | sed "s@Name\s*: @@")
v=$(lesspipe.sh $f | grep -E "Version\s*: " | sed "s@Version\s*: @@")
r=$(lesspipe.sh $f | grep -E "Release\s*: " | sed "s@Release\s*: @@")
d=${p/\%v/$v}
d=${d/\%r/$r}
curl -H "Authorization: Bearer $6" https://madoguchi.fyralabs.com/ci/terra$3/builds/$n -X PUT -H "Content-Type: application/json" -d $d --fail-with-body
done