From 4482212909d628f37d778d65a6afb32f4f394e01 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 28 Jan 2019 10:17:19 -0500 Subject: [PATCH] Add submit-builds script --- sr.ht/{buildall.yml => build.yml} | 35 +----------------------- sr.ht/submit-builds | 44 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 34 deletions(-) rename sr.ht/{buildall.yml => build.yml} (83%) create mode 100755 sr.ht/submit-builds diff --git a/sr.ht/buildall.yml b/sr.ht/build.yml similarity index 83% rename from sr.ht/buildall.yml rename to sr.ht/build.yml index 9ebdffb..9e8ee5a 100644 --- a/sr.ht/buildall.yml +++ b/sr.ht/build.yml @@ -9,40 +9,7 @@ packages: environment: repo_server: deploy@mirror.sr.ht repo_path: /var/www/mirror.sr.ht/alpine/sr.ht/x86_64 - packages: - - fcgiwrap - - py-alembic - - py-cssselect2 - - py-editor - - py-misaka - - py-qrcode - - py-tinycss2 - - py-weasyprint - - py3-amqp - - py3-anyjson - - py3-arrow - - py3-billiard - - py3-bleach - - py3-case - - py3-celery - - py3-colour - - py3-furl - - py3-html5lib - - py3-humanize - - py3-infinity - - py3-intervals - - py3-kombu - - py3-nose - - py3-orderedmultidict - - py3-passlib - - py3-pgpy - - py3-pyotp - - py3-redis - - py3-sqlalchemy-utils - - py3-sshpubkeys - - py3-stripe - - py3-vine - - py3-webencodings + packages: [] sources: - https://git.sr.ht/~sircmpwn/sr.ht-apkbuilds secrets: diff --git a/sr.ht/submit-builds b/sr.ht/submit-builds new file mode 100755 index 0000000..3c4f4b2 --- /dev/null +++ b/sr.ht/submit-builds @@ -0,0 +1,44 @@ +#!/bin/sh +if [ -e ~/.config/sr.ht ] +then + . ~/.config/sr.ht +fi + +upstream=https://builds.sr.ht + +while getopts u:t:h flag +do + case $flag in + u) + upstream="$OPTARG" + ;; + t) + token="$OPTARG" + ;; + h) + echo "Usage: $0 [-u https://upstream...] [-t oauth token] " + exit 0 + ;; + esac +done +shift $((OPTIND-1)) + +builds="" +for target in $* +do + if [ "$builds" = "" ] + then + builds="'$target'" + else + builds="$builds, '$target'" + fi +done +sed "s/packages: \\[\\]/packages: [$builds]/g" < build.yml | jq -sR '{ + "manifest": ., + "tags": ["sr.ht-apkbuilds"], + }' | curl \ + -H Authorization:"token $oauth_token" \ + -H Content-Type:application/json \ + -X POST \ + -d @- $upstream/api/jobs +printf '\n' -- 2.45.2