-
Notifications
You must be signed in to change notification settings - Fork 12
/
manage.sh
executable file
·68 lines (55 loc) · 1.27 KB
/
manage.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
#!/usr/bin/env bash
function docker_install()
{
echo "Nothing to do"
# echo "MANAGE: Install docker..."
# yum update -y
# curl http://repo.net.billing.ru/scripts/add-docker-ce-repo.sh | sudo sh
# yum install -y epel-release
# yum install -y yum-utils device-mapper-persistent-data lvm2 python36 docker-ce docker-ce-cli containerd.io docker-compose
# systemctl start docker
# systemctl enable docker
# echo "MANAGE: docker has been installed and started!"
}
function container_build()
{
echo "MANAGE: Build \"grafana\" container..."
docker rm grafana_csv-plugin
docker build --no-cache --tag=grafana:csv-plugin .
}
function container_up()
{
echo "MANAGE: Up \"grafana\" container..."
docker run -d -p 3000:3000 --name=grafana_csv-plugin grafana:csv-plugin
}
function container_down()
{
echo "MANAGE: Stop \"grafana\" container..."
docker stop grafana_csv-plugin
}
main()
{
cmd="$1"
case $cmd in
build)
container_build
shift # past argument
;;
up)
container_up
shift # past argument
;;
install)
docker_install
shift # past argument
;;
down)
container_down
shift # past argument
;;
*) # unknown option
echo "ERROR: unknown command \"$cmd\""
;;
esac
}
main $1