diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index a3c83c4f..9cef657a 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -2,7 +2,7 @@ name: "Alpha Build" on: push: - branches: [v552/fix-docker-build] + branches: [v552/integration] jobs: frontend: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 61ddab07..9cd7d862 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,7 +2,7 @@ name: "Integration only (test)" on: push: - branches: [v552/integration] + branches: [v552/integrationx] jobs: integration: diff --git a/backend/Dockerfile b/backend/Dockerfile index b74fd0f9..6dd28801 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -4,6 +4,9 @@ WORKDIR /usr/src/backend ENV NODE_ENV=production +RUN apk update +RUN apk add curl + COPY ./yarn.lock ./ COPY ./package.json ./ diff --git a/integration/Makefile b/integration/Makefile index d5f2cb62..e022e85f 100644 --- a/integration/Makefile +++ b/integration/Makefile @@ -12,6 +12,11 @@ local: yarn test docker-compose down +local-compose: + docker build -f ../backend/Dockerfile -t retro-backend:local ../backend + docker build -f ../frontend/Dockerfile -t retro-frontend:local ../frontend + docker-compose -f ./docker-compose.local.local.yml up --exit-code-from cypress + alpha: docker-compose rm -s -f -v docker-compose -f ./docker-compose.ci.alpha.yml pull diff --git a/integration/docker-compose.ci.alpha.yml b/integration/docker-compose.ci.alpha.yml index e61e4ef7..4aa9421c 100644 --- a/integration/docker-compose.ci.alpha.yml +++ b/integration/docker-compose.ci.alpha.yml @@ -1,4 +1,3 @@ -version: '3' services: cypress: image: "cypress/included:12.6.0" @@ -29,11 +28,15 @@ services: image: retrospected/backend:alpha depends_on: - redis + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3201/healthz"] + interval: 2s + timeout: 5s + retries: 30 environment: SELF_HOSTED_ADMIN: 'your@email.com' DB_PASSWORD: some-password SESSION_SECRET: im-a-secret - restart: unless-stopped logging: driver: 'json-file' @@ -43,7 +46,8 @@ services: frontend: image: retrospected/frontend:alpha depends_on: - - backend + backend: + condition: service_healthy environment: BACKEND_HOST: backend BACKEND_PORT: 3201 diff --git a/integration/docker-compose.local.local.yml b/integration/docker-compose.local.local.yml new file mode 100644 index 00000000..9b58112e --- /dev/null +++ b/integration/docker-compose.local.local.yml @@ -0,0 +1,70 @@ +services: + cypress: + image: "cypress/included:12.6.0" + ipc: host + depends_on: + - frontend + environment: + - CYPRESS_baseUrl=http://frontend + - CYPRESS_backend_delay=60000 + working_dir: /e2e + volumes: + - ./:/e2e + + postgres: + image: postgres:16 + hostname: postgres + environment: + POSTGRES_PASSWORD: some-password + POSTGRES_USER: postgres + POSTGRES_DB: retroboard + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + + backend: + image: retro-backend:local + depends_on: + - redis + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3201/healthz"] + interval: 2s + timeout: 5s + retries: 30 + environment: + SELF_HOSTED_ADMIN: 'your@email.com' + DB_PASSWORD: some-password + SESSION_SECRET: im-a-secret + + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + + frontend: + image: retro-frontend:local + depends_on: + backend: + condition: service_healthy + environment: + BACKEND_HOST: backend + BACKEND_PORT: 3201 + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + + redis: + image: redis:latest + depends_on: + - postgres + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' +