-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·48 lines (37 loc) · 1023 Bytes
/
deploy.sh
File metadata and controls
executable file
·48 lines (37 loc) · 1023 Bytes
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
#!/bin/bash
# deploy client container
test_host="blackhole.local"
function sync_test {
# sync client to blackhole.local
rsync -a --progress --delete-after \
--exclude ".git" \
--exclude ".mypy_cache" \
--exclude ".venv" \
--exclude "**/cache" \
--exclude "**/__pycache__/" \
. -e ssh "$test_host":tubearchivist-members
ssh "$test_host" \
'docker build -t bbilly1/tubearchivist-client tubearchivist-members'
ssh $test_host "docker compose up -d"
}
function sync_production {
echo "latest tags:"
git tag | tail -n 5 | sort -r
printf "\ncreate new version:\n"
read -r VERSION
echo "push new tag: $VERSION?"
read -rn 1
git tag -a "$VERSION" -m "new release version $VERSION"
git push origin "$VERSION"
}
if [[ $1 == "test" ]]; then
sync_test
elif [[ $1 == "docker" ]]; then
sync_production
elif [[ $1 == "validate" ]]; then
validate "$2"
else
echo "valid options are: test | docker"
fi
##
exit 0