Unverified Commit a4716f0f authored by Tom Moulard's avatar Tom Moulard
Browse files

codimd: adding health tests

parent ec0f5ec0
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -131,3 +131,22 @@ jobs:
        run: docker-compose -f docker-compose.yml -f ${SERVICE}/docker-compose.${SERVICE}.yml ps
      - name: Check health
        run: docker-compose -f docker-compose.yml -f ${SERVICE}/docker-compose.${SERVICE}.yml ps | grep "Up (healthy)"
  Health-checks-codimd:
    runs-on: ubuntu-latest
    env:
      SERVICE: codimd
    steps:
      - uses: actions/checkout@v2
      - name: Caching
        uses: actions/cache@v2
        with:
          path: /var/lib/docker/
          key: ${{ runner.os }}-health-${{ github.job }}
      - name: Build the docker-compose stack
        run: docker-compose -f docker-compose.yml -f ${SERVICE}/docker-compose.${SERVICE}.yml up -d
      - name: Waiting for service startup (10s)
        run: sleep 10s
      - name: Check running containers
        run: docker-compose -f docker-compose.yml -f ${SERVICE}/docker-compose.${SERVICE}.yml ps
      - name: Check health
        run: docker-compose -f docker-compose.yml -f ${SERVICE}/docker-compose.${SERVICE}.yml ps | grep "Up (healthy)"
+11 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ networks:

services:
  codimd:
    image: nabo.codimd.dev/hackmdio/hackmd:2.1.0
    image: nabo.codimd.dev/hackmdio/hackmd:2.2.0
    environment:
      - 'CMD_DB_URL=postgres://codimd:mypwd@codimd-db/codimd'
      - 'CMD_USECDN=false'
@@ -19,6 +19,11 @@ services:
      - 'srv'
      - 'codi-internal'
    restart: always
    healthcheck:
      test: ['CMD', 'wget', '0.0.0.0:3000', '|', 'grep', '200']
      interval: 10s
      timeout: 10s
      retries: 5
    labels:
      - 'traefik.enable=true'
      - 'traefik.frontend.rule=Host:codimd.${SITE}'
@@ -35,5 +40,10 @@ services:
    networks:
      - 'codi-internal'
    restart: always
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'codimd']
      interval: 10s
      timeout: 10s
      retries: 5
    labels:
      - 'traefik.enable=false'
+20 −0
Original line number Diff line number Diff line
@@ -115,6 +115,17 @@ services:
    environment:
      CMD_DB_URL: postgres://codimd:mypwd@codimd-db/codimd
      CMD_USECDN: "false"
    healthcheck:
      interval: 10s
      retries: 5
      test:
      - CMD
      - curl
      - 0.0.0.0:3000
      - '|'
      - grep
      - 200
      timeout: 10s
    image: nabo.codimd.dev/hackmdio/hackmd:2.1.0
    labels:
      traefik.enable: "true"
@@ -133,6 +144,15 @@ services:
      POSTGRES_DB: codimd
      POSTGRES_PASSWORD: mypwd
      POSTGRES_USER: codimd
    healthcheck:
      interval: 10s
      retries: 5
      test:
      - CMD
      - pg_isready
      - -U
      - codimd
      timeout: 10s
    image: postgres:11.6-alpine
    labels:
      traefik.enable: "false"