-
Notifications
You must be signed in to change notification settings - Fork 18
/
pullpush.sh
executable file
·81 lines (66 loc) · 2.4 KB
/
pullpush.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
set -x # print all command
set -e # exit on error
if [ $# -eq 0 ] ; then
echo "Usage:
./pullpush.sh 'the commit message'"
exit
fi
# generate documentation
for x in A B F I L M T X; do # remove S C until https://github.com/robertkrimen/godocdown/issues/17 fixed
godocdown $x > $x/README.md
replacer gotro/$x github.com/kokizzu/gotro/$x '# ' $x/README.md
done
# format indentation
go install golang.org/x/tools/cmd/goimports@latest
goimports -w **/*.go
echo "codes formatted.."
# testing if has error 1
go build loader.go || ( echo 'has error, exiting..' ; kill 0 )
echo "codes tested.."
(cd W2/internal/example1 ; go get -u -v github.com/gofiber/fiber/v2@latest ; go mod tidy)
(cd W2/internal/example2 ; go get -u -v github.com/gofiber/fiber/v2@latest ; go mod tidy)
go get -u -v github.com/ory/dockertest/v3@latest
go get -u -v github.com/kokizzu/id64@latest
go get -u -v github.com/kokizzu/lexid@latest
go get -u -v github.com/ClickHouse/clickhouse-go/v2@latest
go get -u -v github.com/tarantool/go-tarantool/v2@latest
go get -u -v github.com/jackc/pgx/v5@latest
go get -u -v github.com/mitchellh/mapstructure@latest
go get -u -v github.com/vmihailenco/msgpack/v5@latest
go get -u -v github.com/goccy/go-json@latest
go get -u -v github.com/zeebo/xxh3@latest
go get -u -v github.com/redis/rueidis@latest
go get -u -v github.com/kpango/fastime@latest
go get -u -v github.com/fatih/color@latest
go get -u -v github.com/kr/pretty@latest
go get -u -v github.com/op/go-logging@latest
go get -u -v github.com/gofiber/fiber/v2@latest
go mod tidy
# testing if has error after update
go build loader.go || ( echo 'has error, exiting..' ; kill 0 )
echo "codes tested.."
# testing if has "gokil" included
ag gokil **/*.go && ( echo 'echo should not import previous gokil library..' ; kill 0 )
echo "imports checked.."
# run linter
golangci-lint run
# run tests
go test ./...
# add and commit all files
git add .
git status
read -p "Press Ctrl+C to exit, press any enter key to check the diff..
"
# recheck again
git diff --staged
echo 'Going to commit with message: '\""$*"\"
read -p "Press Ctrl+C to exit, press any enter key to really commit..
"
git commit -m "$*" && git pull && git push origin master
TAG=$(ruby -e 't = Time.now; print "v1.#{t.month+(t.year-2021)*12}%02d.#{t.hour}%02d" % [t.day, t.min]')
git tag -a "$TAG" -m "$*"
git push --tags
echo "# to undo this release:
git tag -d $TAG
git push -d origin $TAG"