From 5c2af0a77f4c831d0e7c250021a184f39170af93 Mon Sep 17 00:00:00 2001 From: Carlo Minotti <50220438+minottic@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:10:30 +0100 Subject: [PATCH] Avoid enforcing not-needed quotes (#96) * Avoid enforcing not-needed quotes * Enforce single quotes --- .github/workflows/docker_compose_test.yaml | 24 +++++++++++----------- .github/yamllint_config.yaml | 8 ++++---- docker-compose.yaml | 16 +++++++-------- services/archivemock/docker-compose.yaml | 8 ++++---- services/backend/docker-compose.yaml | 24 +++++++++++----------- services/frontend/docker-compose.yaml | 8 ++++---- services/mongodb/docker-compose.yaml | 10 ++++----- services/proxy/docker-compose.yaml | 16 +++++++-------- services/rabbitmq/docker-compose.yaml | 18 ++++++++-------- services/searchapi/docker-compose.yaml | 8 ++++---- 10 files changed, 70 insertions(+), 70 deletions(-) diff --git a/.github/workflows/docker_compose_test.yaml b/.github/workflows/docker_compose_test.yaml index d05a186a..e1ec5451 100644 --- a/.github/workflows/docker_compose_test.yaml +++ b/.github/workflows/docker_compose_test.yaml @@ -1,20 +1,20 @@ -name: "Docker Compose CI" +name: Docker Compose CI -"on": # 'on' is a truthy value normally, quotes are needed +on: # yamllint disable-line rule:truthy push: branches: - - "master" + - master pull_request: branches: - - "master" + - master jobs: test: - runs-on: "ubuntu-latest" + runs-on: ubuntu-latest steps: - - uses: "actions/checkout@v3" - - name: "Install 'yamllint'" - run: "sudo apt-get install -y yamllint" - - name: "Lint YAML files" - run: "yamllint -c .github/yamllint_config.yaml ." - - name: "Test docker-compose.yaml" - run: "docker compose up --wait --wait-timeout 300" + - uses: actions/checkout@v3 + - name: Install 'yamllint' + run: sudo apt-get install -y yamllint + - name: Lint YAML files + run: yamllint -c .github/yamllint_config.yaml . + - name: Test docker-compose.yaml + run: docker compose up --wait --wait-timeout 300 diff --git a/.github/yamllint_config.yaml b/.github/yamllint_config.yaml index 7652c9b6..f6578861 100644 --- a/.github/yamllint_config.yaml +++ b/.github/yamllint_config.yaml @@ -1,9 +1,9 @@ --- -extends: "default" +extends: default rules: quoted-strings: - required: true - quote-type: "double" - document-start: "disable" + required: only-when-needed + quote-type: single + document-start: disable diff --git a/docker-compose.yaml b/docker-compose.yaml index 5ec187e6..0d4a1019 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,9 +1,9 @@ -version: "3" +version: '3' include: - - "./services/mongodb/docker-compose.yaml" - - "./services/rabbitmq/docker-compose.yaml" - - "./services/backend/docker-compose.yaml" - - "./services/frontend/docker-compose.yaml" - - "./services/searchapi/docker-compose.yaml" - - "./services/archivemock/docker-compose.yaml" - - "./services/proxy/docker-compose.yaml" + - ./services/mongodb/docker-compose.yaml + - ./services/rabbitmq/docker-compose.yaml + - ./services/backend/docker-compose.yaml + - ./services/frontend/docker-compose.yaml + - ./services/searchapi/docker-compose.yaml + - ./services/archivemock/docker-compose.yaml + - ./services/proxy/docker-compose.yaml diff --git a/services/archivemock/docker-compose.yaml b/services/archivemock/docker-compose.yaml index 35af815a..3a843f91 100644 --- a/services/archivemock/docker-compose.yaml +++ b/services/archivemock/docker-compose.yaml @@ -1,10 +1,10 @@ services: archivemock: - build: "https://github.com/SwissOpenEM/ScicatArchiveMock.git" + build: https://github.com/SwissOpenEM/ScicatArchiveMock.git depends_on: rabbitmq: - condition: "service_healthy" + condition: service_healthy backend: - condition: "service_healthy" + condition: service_healthy env_file: - - "./config/.env" + - ./config/.env diff --git a/services/backend/docker-compose.yaml b/services/backend/docker-compose.yaml index 994bfdf8..ff2f1000 100644 --- a/services/backend/docker-compose.yaml +++ b/services/backend/docker-compose.yaml @@ -1,21 +1,21 @@ services: backend: - image: "scicatproject/backend:v0.0.5" + image: scicatproject/backend:v0.0.5 depends_on: mongodb: - condition: "service_started" + condition: service_started rabbitmq: - condition: "service_healthy" + condition: service_healthy volumes: - - "./config/config.local.js:/usr/src/app/server/config.local.js" - - "./config/datasources.json:/usr/src/app/server/datasources.json" - - "./config/providers.json:/usr/src/app/server/providers.json" - - "./config/component-config.local.json:/usr/src/app/server/component-config.local.json" + - ./config/config.local.js:/usr/src/app/server/config.local.js + - ./config/datasources.json:/usr/src/app/server/datasources.json + - ./config/providers.json:/usr/src/app/server/providers.json + - ./config/component-config.local.json:/usr/src/app/server/component-config.local.json labels: - - "traefik.http.routers.backend.rule=Host(`backend.localhost`)" + - traefik.http.routers.backend.rule=Host(`backend.localhost`) healthcheck: - test: "wget --spider 'http://127.0.0.1:3000/'" - start_period: "5s" - interval: "30s" - timeout: "10s" + test: wget --spider 'http://127.0.0.1:3000/' + start_period: 5s + interval: 30s + timeout: 10s retries: 5 diff --git a/services/frontend/docker-compose.yaml b/services/frontend/docker-compose.yaml index 3f62162e..55da6679 100644 --- a/services/frontend/docker-compose.yaml +++ b/services/frontend/docker-compose.yaml @@ -1,10 +1,10 @@ services: frontend: - image: "scicatproject/frontend:v4.0.0" + image: scicatproject/frontend:v4.0.0 depends_on: backend: - condition: "service_healthy" + condition: service_healthy volumes: - - "./config/config.json:/usr/share/nginx/html/assets/config.json" + - ./config/config.json:/usr/share/nginx/html/assets/config.json labels: - - "traefik.http.routers.frontend.rule=Host(`localhost`)" + - traefik.http.routers.frontend.rule=Host(`localhost`) diff --git a/services/mongodb/docker-compose.yaml b/services/mongodb/docker-compose.yaml index b6fa2241..155b08cc 100644 --- a/services/mongodb/docker-compose.yaml +++ b/services/mongodb/docker-compose.yaml @@ -1,11 +1,11 @@ services: mongodb: - image: "mongo:7.0" + image: mongo:7.0 volumes: - - "mongodb_data:/data/db" - - "./config/init.js:/docker-entrypoint-initdb.d/init.js" - - "./config/seed:/seed" + - mongodb_data:/data/db + - ./config/init.js:/docker-entrypoint-initdb.d/init.js + - ./config/seed:/seed volumes: mongodb_data: - driver: "local" + driver: local diff --git a/services/proxy/docker-compose.yaml b/services/proxy/docker-compose.yaml index eeb8b677..6f548621 100644 --- a/services/proxy/docker-compose.yaml +++ b/services/proxy/docker-compose.yaml @@ -1,12 +1,12 @@ services: proxy: - image: "traefik:2.5" - command: >- - --api.insecure=true - --providers.docker=true - --entrypoints.web.address=:80 + image: traefik:2.5 + command: + - --api.insecure=true + - --providers.docker=true + - --entrypoints.web.address=:80 ports: - - "80:80" - - "8080:8080" + - 80:80 + - 8080:8080 volumes: - - "/var/run/docker.sock:/var/run/docker.sock" + - /var/run/docker.sock:/var/run/docker.sock diff --git a/services/rabbitmq/docker-compose.yaml b/services/rabbitmq/docker-compose.yaml index 14577317..acf601a7 100644 --- a/services/rabbitmq/docker-compose.yaml +++ b/services/rabbitmq/docker-compose.yaml @@ -1,18 +1,18 @@ services: rabbitmq: - image: "rabbitmq:3.13-management-alpine" + image: rabbitmq:3.13-management-alpine labels: - - "traefik.http.routers.rabbitmq.rule=Host(`rabbitmq.localhost`)" - - "traefik.http.services.rabbitmq.loadbalancer.server.port=15672" + - traefik.http.routers.rabbitmq.rule=Host(`rabbitmq.localhost`) + - traefik.http.services.rabbitmq.loadbalancer.server.port=15672 volumes: - - "rabbitmq_data:/bitnami" + - rabbitmq_data:/bitnami healthcheck: - test: "rabbitmq-diagnostics -q ping" - start_period: "5s" - interval: "30s" - timeout: "10s" + test: rabbitmq-diagnostics -q ping + start_period: 5s + interval: 30s + timeout: 10s retries: 5 volumes: rabbitmq_data: - driver: "local" + driver: local diff --git a/services/searchapi/docker-compose.yaml b/services/searchapi/docker-compose.yaml index 179541cd..32af182e 100644 --- a/services/searchapi/docker-compose.yaml +++ b/services/searchapi/docker-compose.yaml @@ -1,9 +1,9 @@ services: searchapi: - image: "dacat/panosc-search-api:latest" + image: dacat/panosc-search-api:latest depends_on: - - "backend" + - backend labels: - - "traefik.http.routers.searchapi.rule=Host(`searchapi.localhost`)" + - traefik.http.routers.searchapi.rule=Host(`searchapi.localhost`) env_file: - - "./config/.env" + - ./config/.env