-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestart.sh
More file actions
executable file
·31 lines (24 loc) · 877 Bytes
/
restart.sh
File metadata and controls
executable file
·31 lines (24 loc) · 877 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
#!/bin/bash
set -e
source ./deploy/utilities.bash
if [[ -f .env.production ]]; then
export $(xargs < .env.production)
fi
if [ -z "${GITHUB_HEAD_REF+x}" ]; then
GITHUB_HEAD_REF=$(git rev-parse --abbrev-ref HEAD)
export GITHUB_HEAD_REF
fi
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch'");
what="$1"
if [[ "$what" == "scraper" ]]; then
echo "Restarting typesense-scraper in namespace $namespace"
lttle machine restart --ns $namespace typesense-scraper
elif [[ "$what" == "docs" ]]; then
echo "Restarting nginx-docs in namespace $namespace"
lttle machine restart --ns $namespace nginx-docs
elif [[ "$what" == "search" ]]; then
echo "Restarting typesense-search in namespace $namespace"
lttle machine restart --ns $namespace typesense-search
else
restartMachines "$namespace"
fi