Skip to content

Commit

Permalink
Fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
nicrausaz committed May 29, 2021
1 parent 8bafa89 commit 492c510
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions run_step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ function step1 {
eval "docker run -d --name static_apache -p 9090:80 res/static-apache";
}

function step2 {
if [ $OMIT_BUILD = false ]
then
function buildstep2 {
eval "cd step2/src";
eval "npm install";
eval "cd ..";
eval "cd ..";
eval "docker build -t res/node-express ./step2";
}

function step2 {
if [ $OMIT_BUILD = false ]
then
buildstep2;
fi
eval "docker run -d --name express_dynamic -p 8282:3000 res/node-express";
}
Expand Down Expand Up @@ -70,7 +74,7 @@ case "$1" in
# Step 4: AJAX requests
if [ $OMIT_BUILD = false ]
then
eval "docker build -t res/node-express ./step2";
buildstep2;
eval "docker build -t res/reverseproxy ./step3";
eval "docker build -t res/static-ajax ./step4";
fi
Expand All @@ -85,7 +89,7 @@ case "$1" in

if [ $OMIT_BUILD = false ]
then
eval "docker build -t res/node-express ./step2";
buildstep2;
eval "docker build -t res/static-ajax ./step4";
eval "docker build -t res/dynamic-proxy ./step5";
fi
Expand All @@ -105,7 +109,7 @@ case "$1" in

if [ $OMIT_BUILD = false ]
then
eval "docker build -t res/node-express ./step2";
buildstep2;
eval "docker build -t res/static-ajax ./step4";
eval "docker build -t res/load-balancing ./loadBalancing";
fi
Expand Down Expand Up @@ -138,7 +142,7 @@ case "$1" in
# Additional steps: Load balancing: round-robin vs sticky sessions
if [ $OMIT_BUILD = false ]
then
eval "docker build -t res/node-express ./step2";
buildstep2;
eval "docker build -t res/static-ajax ./step4";
eval "docker build -t res/round-sticky ./round-sticky";
fi
Expand Down Expand Up @@ -172,7 +176,7 @@ case "$1" in

if [ $OMIT_BUILD = false ]
then
echo "todo";
echo "Not implemented yet";
fi
;;

Expand All @@ -185,7 +189,6 @@ case "$1" in

* )
echo "Invalid step";
exit;
;;
esac

Expand Down

0 comments on commit 492c510

Please sign in to comment.