-
Notifications
You must be signed in to change notification settings - Fork 0
/
testme.sh
46 lines (34 loc) · 1.33 KB
/
testme.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
#!/bin/bash
# demo7/testme.sh
#
# Description: Script to test docker container deployment.
# Requirements: **parameters.json** and any custom inputs. **No rs_custom.xml**
# Start docker before running this script
# start docker
# Working Directory should be /moves_anywhere
pwd
# Variables
IMAGE_NAME="moves:v1"
DATA_FOLDER="$(pwd)/demos/demo_docker" # Path to where you will source your data/inputs FROM
RUN="${DATA_FOLDER##*/}" # Extract folder name. This will be the name of your docker image, eg. dockrun1 (dock$RUN)
echo "$DATA_FOLDER"
echo "$RUN"
# For this test, keep only parameters.json and your .csvs
# That means, cut your rs_custom.xml and any data outputs
if [ -e "$DATA_FOLDER/data.csv" ]; then unlink "$DATA_FOLDER/data.csv"; fi
if [ -e "$DATA_FOLDER/movesoutput.csv" ]; then unlink "$DATA_FOLDER/movesoutput.csv"; fi
if [ -e "$DATA_FOLDER/movesactivityoutput.csv" ]; then unlink "$DATA_FOLDER/movesactivityoutput.csv"; fi
# Test container - interactively (remove upon completion) #####################################
docker run \
--rm \
--name "dock$RUN" \
--mount src="$DATA_FOLDER/",target="/cat-api/inputs",type=bind \
-it "$IMAGE_NAME" \
bash -c "bash launch.sh;"
# Exit upon successful completion
exit
# Jump into the Container
# docker exec -it "dock$RUN" bash
# exit
# docker stop "dock$RUN"
# docker rm "dock$RUN"