-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpublish.sh
executable file
·40 lines (32 loc) · 1 KB
/
publish.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
#!/bin/bash
GIT_PATH=/home/stt/prod/cpp-image-analysis
SITE_PATH=/home/stt/prod/website
pushd $GIT_PATH
git pull 2>&1
if [ $? -ne 0 ]
then
echo "Failed during git pull"
exit 1
fi
# TODO: versioning?
docker build --tag stt-datacore/cpp-image-analysis:latest .
if [ $? -ne 0 ]
then
echo "Failed during Docker build"
exit 3
fi
popd
# TODO: remove old image and restart; is there a best practices for this?
docker stop DCImageAnalysis
docker rm DCImageAnalysis
# See https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file for env.list
docker run -d --name=DCImageAnalysis \
--restart unless-stopped \
--publish 5000:5000 \
--mount type=bind,source="$SITE_PATH",target=/sitedata \
--mount type=bind,source="$GIT_PATH",target=/traindata \
stt-datacore/cpp-image-analysis:latest \
--asseturl=https://assets.datacore.app/ \
--trainpath=/traindata/train \
--datapath=/traindata/data \
--jsonpath=/sitedata/static/structured/