;dev: extract tools/push
This commit is contained in:
parent
76165f962d
commit
b49968ee32
31
tools/push
Executable file
31
tools/push
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# push [INTERVALSECS] - push to CI branch, watch for a successful run, then push to master
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
INTERVAL="${1:-10}"
|
||||||
|
|
||||||
|
LOCALBRANCH=master
|
||||||
|
REMOTECIBRANCH=simon
|
||||||
|
REMOTEMAINBRANCH=master
|
||||||
|
NUMRUNS=3
|
||||||
|
NUMCOMMITS=5
|
||||||
|
CISTARTDELAY=10 # too short, and the script will try to push too early
|
||||||
|
|
||||||
|
ciwait() {
|
||||||
|
echo "waiting for CI to start..."
|
||||||
|
sleep $CISTARTDELAY
|
||||||
|
gh run list -L$NUMRUNS
|
||||||
|
echo "waiting for CI to finish..."
|
||||||
|
ciwatch "$INTERVAL"
|
||||||
|
gh run list -L$NUMRUNS
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "force-pushing to github/$REMOTECIBRANCH"
|
||||||
|
git push -f github $LOCALBRANCH:$REMOTECIBRANCH
|
||||||
|
ciwait
|
||||||
|
echo "pushing to $REMOTEMAINBRANCH"
|
||||||
|
git push github $REMOTEMAINBRANCH
|
||||||
|
echo "Latest commits on github/$REMOTEMAINBRANCH are now:"
|
||||||
|
git log --format='%ad %h %s%d' --date=short -$NUMCOMMITS github/$REMOTEMAINBRANCH
|
||||||
|
echo "done"
|
||||||
@ -1,20 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# PROG MSG - commit manuals with ";doc: MSG" prefix, push to CI, then to master
|
# pushdocs [MSG] - commit manuals with ";doc: MSG" prefix, push to CI, then to master
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
DELAY=30
|
|
||||||
INTERVAL=10
|
|
||||||
MSG=";doc: $1"
|
MSG=";doc: $1"
|
||||||
|
|
||||||
#WAIT="sleep $DELAY"
|
DOCS=(hledger/hledger.m4.md hledger-ui/hledger-ui.m4.md hledger-web/hledger-web.m4.md)
|
||||||
WAIT="ciwatch $INTERVAL"
|
|
||||||
|
|
||||||
git commit -uno -m "$MSG" hledger/hledger.m4.md hledger-ui/hledger-ui.m4.md hledger-web/hledger-web.m4.md || true
|
git commit -uno -m "$MSG" "${DOCS[@]}" hledger-web/hledger-web.m4.md || true
|
||||||
git push -f github master:simon \
|
push \
|
||||||
&& echo "waiting for CI to finish..." \
|
|
||||||
&& $WAIT \
|
|
||||||
&& git push github master \
|
|
||||||
&& printf "Docs should be up to date momentarily:\n\
|
&& printf "Docs should be up to date momentarily:\n\
|
||||||
\n\
|
\n\
|
||||||
https://hledger.org/dev/hledger.html\n\
|
https://hledger.org/dev/hledger.html\n\
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user