podman.conf.sh.DEV 2.56 KB
Newer Older
Andreas Mann's avatar
initial  
Andreas Mann committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# -----------------------------------------------------------------------------
# steps:
# (1) provide tcp external port of pod (POD_EX_PORT)
# (2) provide a name for the pod
# (3) provide user id for the mongodb process which will access the host filesystem
# (4) mv podman.conf.sh.EDIT podman.conf.sh
# -----------------------------------------------------------------------------


#if (( $EUID != 0 )); then
    #echo "Please run with sudo.."
    #exit
#fi

# service admin e-mail
Andreas Mann's avatar
Andreas Mann committed
17
sysadmin_email="noreply@example.com";
Andreas Mann's avatar
initial  
Andreas Mann committed
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

# hostname 
host_name=$(hostname);

# path to backup directory, shared by all pods on host
# this pod will have its own dir inside that path 
PATH_BKUP_DIR="/var/data/bkup";

#echo inside podman.conf.sh

# if you run production and master branch of turnkey on same machine:
# (1) provide container name suffix 
# (2) adjust different external port for api access and db access (if required)
# (3) use different POD_NAME_SVC value like turnkey-service-dev

# container name suffix, leave empty single installation of production
DATABASE_CONT_NAME_SUFFIX="-dev";
API_CONT_NAME_SUFFIX="-dev";
DATALOADING_CONT_NAME_SUFFIX="-dev";
PERFORMANCE_TESTING_CONT_NAME_SUFFIX="-dev";

# container tags are configured for production installation
# for dev installations use other value

# prod:turnkey-v3 dev:master
DATABASE_TAG="master"
# prod:turnkey-v3 dev:latest
API_TAG="latest"
# prod:turnkey-v3-dataloading dev:turnkey-dataloading-latest
DATALOADING_TAG="turnkey-dataloading-latest"
# prod:turnkey-v3-performance dev:turnkey-performance-latest
PERFORMANCE_TESTING_TAG="turnkey-performance-latest"

# podman command name
PODMAN_CMD="podman";
#echo PODMAN_CMD = $PODMAN_CMD 

# pod external port
POD_EX_PORT="8444";
#echo POD_EX_PORT = $POD_EX_PORT

# external port of mongo db process
POD_EX_PORT_DB="27018";

# pod service name
POD_NAME_SVC="turnkey-service-dev";
#echo POD_NAME_SVC = $POD_NAME_SVC

# service account id running the pod 
POD_USER_ID="1000"

# existing file will trigger db backup
# created by load_ and update_ scripts
DO_BKUP_FLAG=${PATH_BKUP_DIR}/${POD_NAME_SVC}/BKUP_DB.FLAG

# -----------------------------------------------------------------------------

SCRIPT_DIR=`dirname "$0"`

CURRENTUSER=$(who | awk 'NR==1{print $1}')
#echo $CURRENTUSER

LOGFILE_NAME="scriptspod_${host_name}_${POD_NAME_SVC}_.log"
if [ ! -e $SCRIPT_DIR/$LOGFILE_NAME  ];then
	touch $SCRIPT_DIR/$LOGFILE_NAME
	#chown $CURRENTUSER:$CURRENTUSER $SCRIPT_DIR/$LOGFILE_NAME
fi

function log () {
	local msg=$1
	echo $msg
	local dt=`date +%F_%T`
	echo "$dt $msg" >> $SCRIPT_DIR/$LOGFILE_NAME
}

log "---"