-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_pe_image.sh
More file actions
33 lines (24 loc) · 1.18 KB
/
run_pe_image.sh
File metadata and controls
33 lines (24 loc) · 1.18 KB
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
#!/bin/bash
echo "+++++++++++++++++++++++++++ run_pe_image.sh ++++++++++++++++++++++++++++++++++++++++++++++++"
echo " "
echo "Starting docker container with the latest planengine image : $PE_LATEST_IMAGE "
echo "creating Log directory for the current plan engine installation"
echo " "
cd $PE_LOG &>/dev/null
if [ $? -eq 0 ];
then
echo "$PE_LOG found"
echo "deleting log directory if already exist for this instance"
rm -rf "$PE_LOG"/"$PLAN_EHGINE_INSTANCES_NAME"/ &>/dev/null
mkdir "$PLAN_EHGINE_INSTANCES_NAME"/ &>/dev/null
else
echo "$PE_LOG not found !! first installation of planEngine with docker...."
echo "making log directory"
mkdir "$PE_LOG"/ &>/dev/null
mkdir "$PE_LOG"/"$PLAN_EHGINE_INSTANCES_NAME"/ &>/dev/null
fi
echo "Running $PE_LATEST_IMAGE with docker cli command for Bigfix server host : $PLAN_EHGINE_INSTANCES_NAME "
docker run --cidfile "$PE_instance_APP"/pe_instance.cid -d -it --rm --name "$PLAN_EHGINE_INSTANCES_NAME" -v "$PE_LOG"/"$PLAN_EHGINE_INSTANCES_NAME":/Logs -t "$PE_LATEST_IMAGE"
read PE_Container_id < "$PE_instance_APP"/pe_instance.cid
echo " "
echo "$PLAN_EHGINE_INSTANCES_NAME plan engine instance started with in docker container with id : $PE_Container_id"