mirror of https://github.com/vernonkeenan/lib
fix: repair Gitea mirror sync
parent
58ebde8660
commit
8f853d056d
11
README.md
11
README.md
|
|
@ -19,8 +19,8 @@ pins the same module, a `lib` bump is a constellation-wide rebuild (KV-C6a).
|
||||||
`plex`, `render`, `research`, `sf-gate`, `stash`) pins an explicit
|
`plex`, `render`, `research`, `sf-gate`, `stash`) pins an explicit
|
||||||
`code.tnxs.net/vernonkeenan/lib` tag in its own `go.mod`; consumption is a
|
`code.tnxs.net/vernonkeenan/lib` tag in its own `go.mod`; consumption is a
|
||||||
per-consumer `go.mod` bump, never automatic.
|
per-consumer `go.mod` bump, never automatic.
|
||||||
- Distribution is via a world-readable Gitea pull-mirror at
|
- Distribution is via the world-readable Gitea pull-mirror at
|
||||||
`code.tnxs.net/vernonkeenan/lib` (and `work/lib`), enabling
|
`code.tnxs.net/vernonkeenan/lib`, enabling
|
||||||
credential-free `go get code.tnxs.net/vernonkeenan/lib@vX.Y.Z` from
|
credential-free `go get code.tnxs.net/vernonkeenan/lib@vX.Y.Z` from
|
||||||
Docker/CI/dev boxes even though the GitHub repo itself is private
|
Docker/CI/dev boxes even though the GitHub repo itself is private
|
||||||
(ADR-KV-014). Everything committed here is treated as **published,
|
(ADR-KV-014). Everything committed here is treated as **published,
|
||||||
|
|
@ -128,11 +128,8 @@ service's own README for its file name and required keys.
|
||||||
3. Runs `go build ./...` and `go vet ./...` as a last sanity check.
|
3. Runs `go build ./...` and `go vet ./...` as a last sanity check.
|
||||||
4. Creates an annotated tag at HEAD, pushes it, and runs `gh release
|
4. Creates an annotated tag at HEAD, pushes it, and runs `gh release
|
||||||
create` with generated notes.
|
create` with generated notes.
|
||||||
5. POSTs to the Gitea mirror-sync API for `vernonkeenan/lib` and
|
5. POSTs an explicit zero-length body to the Gitea mirror-sync API for
|
||||||
`work/lib` (skipped with a warning if `GITEA_TOKEN` is unset — there is
|
`vernonkeenan/lib` (skipped with a warning if `GITEA_TOKEN` is unset).
|
||||||
no existing Gitea/tnxs token variable defined anywhere on this
|
|
||||||
workstation today; `GITEA_TOKEN` is a new name, not a rename of
|
|
||||||
something already in use).
|
|
||||||
|
|
||||||
`make release-dry-run VERSION=vX.Y.Z` runs steps 1-3 and prints what
|
`make release-dry-run VERSION=vX.Y.Z` runs steps 1-3 and prints what
|
||||||
steps 4-5 would do, without tagging, pushing, publishing, or syncing
|
steps 4-5 would do, without tagging, pushing, publishing, or syncing
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
# rosetta.env, wdwai.env); GITEA_TOKEN is a new variable name
|
# rosetta.env, wdwai.env); GITEA_TOKEN is a new variable name
|
||||||
# introduced by this script, not a rename of an existing one.
|
# introduced by this script, not a rename of an existing one.
|
||||||
# GITEA_MIRRORS Space-separated "owner/repo" mirror list (default
|
# GITEA_MIRRORS Space-separated "owner/repo" mirror list (default
|
||||||
# "vernonkeenan/lib work/lib").
|
# "vernonkeenan/lib").
|
||||||
#
|
#
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||||
SWAGGER_VERSION="${SWAGGER_VERSION:-v0.35.0}"
|
SWAGGER_VERSION="${SWAGGER_VERSION:-v0.35.0}"
|
||||||
GITHUB_REPO="${GITHUB_REPO:-vernonkeenan/lib}"
|
GITHUB_REPO="${GITHUB_REPO:-vernonkeenan/lib}"
|
||||||
GITEA_BASE_URL="${GITEA_BASE_URL:-https://code.tnxs.net/api/v1}"
|
GITEA_BASE_URL="${GITEA_BASE_URL:-https://code.tnxs.net/api/v1}"
|
||||||
GITEA_MIRRORS="${GITEA_MIRRORS:-vernonkeenan/lib work/lib}"
|
GITEA_MIRRORS="${GITEA_MIRRORS:-vernonkeenan/lib}"
|
||||||
|
|
||||||
# Sibling service repos this ritual pulls specs from, and the go-swagger
|
# Sibling service repos this ritual pulls specs from, and the go-swagger
|
||||||
# generate flags the README's `make swagger` target used to run inline.
|
# generate flags the README's `make swagger` target used to run inline.
|
||||||
|
|
@ -329,6 +329,7 @@ gitea_mirror_sync() {
|
||||||
repo="${mirror##*/}"
|
repo="${mirror##*/}"
|
||||||
log "Gitea mirror-sync: ${mirror}"
|
log "Gitea mirror-sync: ${mirror}"
|
||||||
status="$(curl -sS -o /dev/null -w '%{http_code}' -X POST \
|
status="$(curl -sS -o /dev/null -w '%{http_code}' -X POST \
|
||||||
|
--data '' \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
"${GITEA_BASE_URL}/repos/${owner}/${repo}/mirror-sync")"
|
"${GITEA_BASE_URL}/repos/${owner}/${repo}/mirror-sync")"
|
||||||
if [[ "$status" != "200" ]]; then
|
if [[ "$status" != "200" ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue