mirror of
https://github.com/sasjs/server.git
synced 2026-01-07 06:30:06 +00:00
chore: docker start script for development
This commit is contained in:
29
dockerStartDev.sh
Executable file
29
dockerStartDev.sh
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
sasjsPath=$(grep sasPath ./api/package.json | sed 's/.*"sasPath": "\(.*\)".*/\1/')
|
||||||
|
|
||||||
|
if [ -z "$sasjsPath" ]
|
||||||
|
then
|
||||||
|
echo "Please enter path to SAS executable:"
|
||||||
|
read sasjsPath
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e $sasjsPath ]
|
||||||
|
then
|
||||||
|
echo "Using sas executable:" \"$sasjsPath\"
|
||||||
|
else
|
||||||
|
echo "No file present at:" \"$sasjsPath\"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# copy sas executable to current directory, because docker cannot copy files outside of context.
|
||||||
|
cp $sasjsPath ./
|
||||||
|
|
||||||
|
# name of the sas executable file, placed at root of repository
|
||||||
|
sasjs=$(basename $sasjsPath)
|
||||||
|
echo "SAS Executable name:" $sasjs
|
||||||
|
|
||||||
|
# build and run docker-compose
|
||||||
|
SAS_EXEC=$sasjs docker-compose up --build -d
|
||||||
|
|
||||||
|
# remove copied sas executable
|
||||||
|
rm $sasjs
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
sasjsPath=$(grep sasPath package.json | sed 's/.*"sasPath": "\(.*\)".*/\1/')
|
sasjsPath=$(grep sasPath ./api/package.json | sed 's/.*"sasPath": "\(.*\)".*/\1/')
|
||||||
|
|
||||||
if [ -z "$sasjsPath" ]
|
if [ -z "$sasjsPath" ]
|
||||||
then
|
then
|
||||||
@@ -15,9 +15,15 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# copy sas executable to current directory, because docker cannot copy files outside of context.
|
||||||
cp $sasjsPath ./
|
cp $sasjsPath ./
|
||||||
sasjs=$(basename $sasjsPath)
|
|
||||||
|
|
||||||
|
# name of the sas executable file, placed at root of repository
|
||||||
|
sasjs=$(basename $sasjsPath)
|
||||||
echo "SAS Executable name:" $sasjs
|
echo "SAS Executable name:" $sasjs
|
||||||
|
|
||||||
|
# build and run docker-compose
|
||||||
SAS_EXEC=$sasjs docker-compose -f docker-compose.prod.yml up --build -d
|
SAS_EXEC=$sasjs docker-compose -f docker-compose.prod.yml up --build -d
|
||||||
|
|
||||||
|
# remove copied sas executable
|
||||||
|
rm $sasjs
|
||||||
Reference in New Issue
Block a user