Skip to content

Commit

Permalink
Merge pull request #130 from iKonoTelecomunicaciones/129-get-stacks-v…
Browse files Browse the repository at this point in the history
…ariable-in-ci

129 get stacks variable in ci
  • Loading branch information
jcardenas3 committed Jul 10, 2024
2 parents 0d020a1 + f5af303 commit dc37c1c
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: isort/isort-action@master
Expand All @@ -16,7 +16,7 @@ jobs:
- uses: psf/black@stable
with:
src: "./menuflow"
version: "22.3.0"
version: "24.4.2"
- name: pre-commit
run: |
pip install pre-commit
Expand All @@ -30,12 +30,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: ~/.cache/pip
Expand All @@ -57,19 +57,19 @@ jobs:
environment: deploy
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
Expand Down Expand Up @@ -104,11 +104,11 @@ jobs:
# Download updated docker image to testing server
ssh -tt ${{ secrets.HOST_TESTING }} "docker pull ${{ vars.MENUFLOW_IMAGE }}"
echo "** Update menuflow image in registered domains **"
for domain in ${{ vars.DOMAINS }}; do
echo "** Update menuflow image in registered stacks **"
for stack in ${{ vars.STACKS }}; do
echo " >> Setting service variables"
stack_name=$(echo ${domain} | tr -d '.')
service=$(echo ${domain} | cut -d '.' -f1)
stack_name=$(echo ${stack} | tr -d '.')
service=$(echo ${stack} | cut -d '.' -f1)
menuflow_service="${stack_name}_${service}-menuflow"
echo " >> Remove the service if exists"
ssh -tt ${{ secrets.HOST_TESTING }} " \
Expand All @@ -120,7 +120,7 @@ jobs:
"
echo " >> Deploy the service"
docker_compose_file="/mnt/shared/matrix/${domain}/docker-compose.yml"
docker_compose_file="/mnt/shared/matrix/${stack}/docker-compose.yml"
ssh -tt ${{ secrets.HOST_TESTING }} " \
docker-compose -f ${docker_compose_file} config | \
docker stack deploy -c - ${stack_name};
Expand Down

0 comments on commit dc37c1c

Please sign in to comment.