-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·43 lines (28 loc) · 1.22 KB
/
update.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
#!/bin/bash
set -e
CYAN='\033[01;36m'
RED='\033[01;31m'
NC='\033[00m'
SCRIPT=$(readlink -f $0)
DIRNAME=$(dirname $SCRIPT)
# -----------------------------------------------------------------------------
# Pull updated images.
# -----------------------------------------------------------------------------
echo -e "${CYAN}[${SCRIPT}] Pull updated images${NC}"
docker-compose -f $DIRNAME/docker-compose.yml pull
# -----------------------------------------------------------------------------
# Stop the containers.
# -----------------------------------------------------------------------------
echo -e "${CYAN}[${SCRIPT}] Stop the containers${NC}"
systemctl stop loki-server
# -----------------------------------------------------------------------------
# Start the containers.
# -----------------------------------------------------------------------------
echo -e "${CYAN}[${SCRIPT}] Start the containers${NC}"
systemctl start loki-server
# -----------------------------------------------------------------------------
# Remove untagged images.
# -----------------------------------------------------------------------------
echo -e "${CYAN}[${SCRIPT}] Remove untagged images${NC}"
docker container prune -f
docker image prune -f