diff --git a/scripts/git-clone.sh b/scripts/git-clone.sh index 89ab826..ab41ce5 100755 --- a/scripts/git-clone.sh +++ b/scripts/git-clone.sh @@ -7,6 +7,7 @@ do echo Cloning the repository: $REPOSITORY echo ======================================================== REPO_URL=https://github.com/devmentors/$REPOSITORY.git + cd ../../ git clone $REPO_URL - cd $REPOSITORY && cd .. + cd - done \ No newline at end of file diff --git a/scripts/git-pull-run-local.sh b/scripts/git-pull-run-local.sh new file mode 100644 index 0000000..48968d7 --- /dev/null +++ b/scripts/git-pull-run-local.sh @@ -0,0 +1,34 @@ +#!/bin/bash +REPOSITORIES=(Pacco.APIGateway Pacco.APIGateway.Ocelot Pacco.Services.Availability Pacco.Services.Customers Pacco.Services.Deliveries Pacco.Services.Identity Pacco.Services.Operations Pacco.Services.Orders Pacco.Services.OrderMaker Pacco.Services.Parcels Pacco.Services.Pricing Pacco.Services.Vehicles) + + for REPOSITORY in ${REPOSITORIES[*]} + do + echo ======================================================== + echo Updating the repository: $REPOSITORY + echo ======================================================== + cd ../../$REPOSITORY + git checkout develop && git pull && git checkout master && git pull + cd - + done + + echo ======================================================== + echo "stoping all containers..." + echo ======================================================== + + container_ids=($(docker ps -a -q)) + echo container_ids + for container_id in ${container_ids[@]} + do + echo stopping container with Id: ${container_id} + eval docker stop ${container_id} + echo stopped + echo ======================================================== + done + +echo ======================================================== +echo "building & starting all services..." +echo ======================================================== +cd ../compose +eval "docker network create pacco-network || true" +eval "docker-compose -f services-local.yml up --build --remove-orphans" +echo "DONE" \ No newline at end of file diff --git a/scripts/git-pull.sh b/scripts/git-pull.sh index c07afb7..741f5d3 100755 --- a/scripts/git-pull.sh +++ b/scripts/git-pull.sh @@ -6,5 +6,7 @@ do echo ======================================================== echo Updating the repository: $REPOSITORY echo ======================================================== - cd $REPOSITORY && git checkout develop && git pull && git checkout master && git pull && cd .. + cd ../../$REPOSITORY + git checkout develop && git pull && git checkout master && git pull + cd - done \ No newline at end of file