Skip to content

Commit

Permalink
feat: add maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Jul 1, 2020
1 parent 5f5c109 commit 8ff57b2
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
COMMANDS = hubsync checkoutmaster
COMMANDS = hubsync checkoutmaster maintenance prlist
REPOS ?= $(wildcard */)
OPTS ?= ;

.PHONY: $(COMMANDS)
$(COMMANDS):
for repo in $(REPOS); do ( set -xe; \
cd $$repo && make -f ../Makefile _do.$@ $(OPTS) \
@for repo in $(REPOS); do ( set -e; \
echo "cd $$repo && make -s -f ../Makefile _do.$@ $(OPTS)"; \
cd $$repo && make -s -f ../Makefile _do.$@ $(OPTS) \
); done

_do.checkoutmaster: _do.hubsync
Expand All @@ -14,14 +15,30 @@ _do.checkoutmaster: _do.hubsync
_do.hubsync:
hub sync

_do.bump_renovate: _do.checkoutmaster
_do.prlist:
@hub pr list -f "- %pC%>(8)%i%Creset %U - %t% l%n"

_do.maintenance: _do.checkoutmaster
# renovate.json
mkdir -p .github
git mv renovate.json .github/renovate.json || true
git rm -f renovate.json || true
cp ~/go/src/moul.io/golang-repo-template/.github/renovate.json .github/
git status
git add .github/renovate.json || true
git add renovate.json || true

# rules.mk
if [ -f rules.mk ]; then cp ~/go/src/moul.io/rules.mk/rules.mk .; fi

# authors
if [ -f rules.mk ]; then make generate.authors; fi

# apply changes
git diff
git checkout -b dev/moul/bump-renovate
git commit renovate.json .github/renovate.json -m "chore: bump renovate"
git push -u origin dev/moul/bump-renovate
hub pull-request -m "chore: bump renovate"
git diff --cached
git branch -D dev/moul/maintenance || true
git checkout -b dev/moul/maintenance
git status
git commit -s -a -m "chore: repo maintenance 馃" -m "more details: https://github.com/moul/repoman"
git push -u origin dev/moul/maintenance -f
hub pull-request -m "chore: repo maintenance 馃" -m "more details: https://github.com/moul/repoman" || $(MAKE) -f ../Makefile _do.prlist

0 comments on commit 8ff57b2

Please sign in to comment.