Skip to content

Commit 5e3d509

Browse files
committed
build: improve server push automation
1 parent c7dacf3 commit 5e3d509

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.dev/githooks/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ scopes_file=".dev/scopes.txt"
55
test -r $scopes_file &&
66
scopes="($(cat "$scopes_file" | sed '/^\(#.*\|\)$/d' | sed ':a;N;s/\n/|/g;ta'))"
77

8-
head -1 "$1" | grep -Eq "^(fix|feat|docs|style|refactor|test|chore|rework|release|revert)(\(${scopes:-.*}(/.+)?\))?: [A-Za-z]"
8+
head -1 "$1" | grep -Eq "^(fix|feat|docs|style|refactor|test|build|rework|release|revert)(\(${scopes:-.*}(/.+)?\))?: [A-Za-z]"
99
result=$?
1010
if test $result -ne 0
1111
then printf "Invalid commit message: '$(head -1 "$1")'

.dev/githooks/prepare-commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ then
4343

4444
printf "\n\n# Please enter the message in the format\n"
4545
echo "# <type>(<scope>): <description>"
46-
echo "# Possible types: fix, feat, docs, style, refactor, test, chore"
46+
echo "# Possible types: fix, feat, docs, style, refactor, test, build"
4747
test -n "$scopes" && echo "# Allowed scopes: $scopes"
4848
echo "# For details see https://www.notion.so/softwarechallenge/Git-217333329ea64db5b2cc8bbbaf79db87"
4949
echo "$original"

.dev/scopes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ contributing
55
git
66
gradle
77
ci
8-
bundle
8+
helpers
99

1010
# Modules
1111
testclient

helpers/push_to_server.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
#!/bin/sh
1+
#!/bin/sh -ex
22

33
if test -z "$server"; then
44
# server is not set or ""
55
echo "please call push_staging.sh or push_production.sh"
66
exit 1
77
fi
8+
9+
if test -S .ssh-socket~
10+
then ssh -S .ssh-socket~ -O exit $server && sleep 1 || rm .ssh-socket~
11+
fi
12+
813
ssh -M -S .ssh-socket~ -fnNT -L 5000:localhost:5000 $server
914
ssh -S .ssh-socket~ -O check $server || exit 1
10-
docker login localhost:5000 || exit 1
15+
echo testpassword | docker login --username testuser --password-stdin localhost:5000 || exit 1
1116

1217
./gradlew clean dockerImage
1318

@@ -16,8 +21,6 @@ docker push localhost:5000/swc_game-server
1621

1722
ssh -S .ssh-socket~ -O exit $server
1823

19-
# this is currently done in webapp
20-
#scp docker-compose-production.yml $server:./docker-compose.yml
2124
ssh $server 'sudo docker pull localhost:5000/swc_game-server' && \
2225
# NOTE This requires the other services (client-controller and gameserver) in the compose file also already deployed
2326
ssh $server 'sudo docker service update --image localhost:5000/swc_game-server:latest --with-registry-auth contest_gameserver'

0 commit comments

Comments
 (0)