Skip to content

Commit

Permalink
ci(CI/CD): 💚 Added CI/CD to testing
Browse files Browse the repository at this point in the history
  • Loading branch information
egalvis39 committed Nov 15, 2023
1 parent e2b1a14 commit 037e576
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,32 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: bramenn/menuflow:latest
tags: ${{ variables.MENUFLOW_IMAGE }}

-
name: Run Bash script
# Download updated docker image to testing server
run: |
echo "** Download updated docker image **"
ssh -tt $secrets.HOST_TESTING "docker pull $variables.MENUFLOW_IMAGE"
echo "** Update menuflow image in registered domains **"
for domain in ${variables.DOMAINS}; do
echo " >> Setting service variables"
stack_name=$(echo ${domain} | tr -d '.')
service=$(echo ${domain} | cut -d '.' -f1)
menuflow_service="${stack_name}_${service}-menuflow"
echo " >> Remove the service if exists"
ssh -tt $secrets.HOST_TESTING " \
if docker service ps ${menuflow_service}; then \
docker service rm ${menuflow_service}; \
else \
echo 'The service ${menuflow_service} is not exists'; \
fi;
"
echo " >> Deploy the service"
docker_compose_file="/mnt/shared/matrix/${domain}/docker-compose.yml"
ssh -tt $secrets.HOST_TESTING " \
docker-compose -f ${docker_compose_file} config | \
docker stack deploy -c - ${stack_name};
"
done

0 comments on commit 037e576

Please sign in to comment.