Skip to content

Commit dd0eea4

Browse files
committed
fixing smart deployer script
1 parent 67fe55a commit dd0eea4

File tree

2 files changed

+29
-33
lines changed

2 files changed

+29
-33
lines changed
Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
11
#! /bin/bash
22

33
. envisage/envisage_settings.sh
4-
. default/parse_params.sh
4+
. misc/parse_params.sh
55

6-
# use minizinc 1.6 that is assumed to be stored in $MAINGENHOME/minizinc-1.6/bin
7-
PATH=$MAINGENHOME/minizinc-1.6/bin:$PATH
6+
execroot=$(getparam "execroot")
7+
files=$(getparam "files")
8+
outdir=$execroot/_ei_tmp
89

9-
abs=""
10-
spec=""
11-
json=""
10+
file=""
11+
orderedfiles=""
1212

13-
for f in $files
13+
for f in $files
1414
do
15-
ext=${f##*.}
16-
if [ $ext = "abs" ]; then
17-
abs=$f
18-
elif [ $ext = "spec" ]; then
19-
spec=$f
20-
elif [ $ext = "json" ]; then
21-
json=$f
22-
fi;
15+
grep "\[[\ ]*SmartDeploy[\ ]*:" $f > /dev/null
16+
if [ $? == 0 ]; then
17+
file=$f
18+
orderedfiles="$f $orderedfiles"
19+
else
20+
orderedfiles="$orderedfiles $f"
21+
fi
2322
done
2423

24+
echo "<eiout>"
25+
echo "<eicommands>"
26+
echo "<printonconsole>"
27+
echo "<content format='text'><![CDATA["
2528

26-
if [ ! -z $abs ] && [ ! -z $spec ] && [ ! -z $json ]; then
27-
python $MAINGENHOME/abs_deployer/abs_deployer.py $abs $spec $json
28-
29+
if [ $file == "" ]; then
30+
echo "Not found"
2931
else
30-
echo "<eiout>"
31-
echo "<eicommands>"
32-
echo "<dialogbox outclass='error' boxtitle='Error!'>"
33-
echo " <content format='html'>"
34-
echo
35-
echo " <ul>"
36-
echo "<li><span style='color: red'>Three input files (.abs, .spec, and .json) are required.</span></li>"
37-
echo "</ul>"
38-
echo "</content>"
39-
echo "</dialogbox>"
40-
echo "</eicommands>"
41-
echo "</eiout>"
32+
python $SMARTDEPLOYERHOME/abs_deployer/abs_deployer.py $orderedfiles 2> $outdir/smartdeployer.stderr
33+
if [ ! $? == 0 ]; then
34+
cat $outdir/smartdeployer.stderr
35+
fi
4236
fi
4337

44-
45-
38+
echo "]]></content>"
39+
echo "</printonconsole>"
40+
echo "</eicommands>"
41+
echo "</eiout>"
4642

server/config/envisage/smart_deployer/smart_deployer.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</desc>
99
</appinfo>
1010
<execinfo method="cmdline">
11-
<cmdlineapp>./envisage/smart_deployer/run.sh -f _ei_files</cmdlineapp>
11+
<cmdlineapp>./envisage/smart_deployer/run.sh -execroot _ei_root -files _ei_files</cmdlineapp>
1212
</execinfo>
1313
</app>

0 commit comments

Comments
 (0)