aboutsummaryrefslogtreecommitdiff
path: root/aux/ci
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-04 16:17:09 -0300
committerEuAndreh <eu@euandre.org>2021-07-04 16:17:09 -0300
commit209af7d8849515fd9f8bc2873bb7e999b2d14240 (patch)
treeff2a9c5a611d47316315fbc26dc23f052c630e85 /aux/ci
parentdependencies.dot: Add colors to all; remove makecheck dependency; tabify (diff)
downloadpackage-repository-209af7d8849515fd9f8bc2873bb7e999b2d14240.tar.gz
package-repository-209af7d8849515fd9f8bc2873bb7e999b2d14240.tar.xz
aux/: Update, adjust Makefile accordingly
Diffstat (limited to 'aux/ci')
-rwxr-xr-xaux/ci/ci-build.sh2
-rwxr-xr-xaux/ci/report.sh26
2 files changed, 25 insertions, 3 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh
index 7fa3382..be97866 100755
--- a/aux/ci/ci-build.sh
+++ b/aux/ci/ci-build.sh
@@ -26,7 +26,7 @@ EOF
git notes append -m "$NOTE"
cd -
- sh aux/ci/report.sh "$PROJECT" public
+ sh aux/ci/report.sh -n "$PROJECT" -o public
rsync -av public/ "/srv/http/$PROJECT/" --delete
printf "\n>>>\n>>> CI logs added as Git note.\n>>>\n>>> Run status was %s" "$STATUS"
diff --git a/aux/ci/report.sh b/aux/ci/report.sh
index c873f54..69dbea3 100755
--- a/aux/ci/report.sh
+++ b/aux/ci/report.sh
@@ -1,9 +1,31 @@
#!/bin/sh
set -eu
-PROJECT="$1"
-OUTDIR="$2"
TLD="$(cat aux/tld.txt)"
+while getopts 'n:o:' flag; do
+ case "$flag" in
+ n)
+ PROJECT="$OPTARG"
+ ;;
+ o)
+ OUTDIR="$OPTARG"
+ ;;
+ *)
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+assert_arg() {
+ if [ -z "$1" ]; then
+ echo "Missing $2" >&2
+ exit 2
+ fi
+}
+
+assert_arg "${PROJECT:-}" '-n PROJECT'
+assert_arg "${OUTDIR:-}" '-o OUTDIR'
PASS='✅'
FAIL='❌'