Merge branch 'fix_manual_follower_test' into 'master'

Fix manual follower test

See merge request turniere/turniere-backend!44
This commit is contained in:
Daniel Schädler 2026-04-19 11:45:59 +00:00
commit 7ec16521bd
4 changed files with 31 additions and 9 deletions

View File

@ -11,3 +11,4 @@ docker/**
docker-compose.yml docker-compose.yml
README.md README.md
.gitlab-ci.yml .gitlab-ci.yml
/log

View File

@ -7,8 +7,6 @@ ruby '3.1.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.3' gem 'rails', '~> 7.0.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server # Use Puma as the app server
gem 'puma', '~> 5.0' gem 'puma', '~> 5.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
@ -54,6 +52,8 @@ group :development, optional: true do
gem 'listen', '~> 3.3' gem 'listen', '~> 3.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'railroady' gem 'railroady'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'rubocop' gem 'rubocop'
gem 'rubocop-performance' gem 'rubocop-performance'
gem 'rubocop-rails' gem 'rubocop-rails'

View File

@ -1,5 +1,6 @@
ARG base_commit ARG base_commit
FROM ruby:3.1.2-slim FROM ruby:3.1.2-slim
ENV RAILS_ENV production
# RUN apk add --no-cache build-base tzdata sqlite sqlite-dev postgresql-dev git && gem install tzinfo-data # RUN apk add --no-cache build-base tzdata sqlite sqlite-dev postgresql-dev git && gem install tzinfo-data
RUN apt-get update -qq && apt-get install -y openssl git build-essential libpq-dev nodejs && apt-get clean && gem install tzinfo-data RUN apt-get update -qq && apt-get install -y openssl git build-essential libpq-dev nodejs && apt-get clean && gem install tzinfo-data
WORKDIR /app WORKDIR /app
@ -14,6 +15,5 @@ COPY script /app/script
COPY config.ru Rakefile /app/ COPY config.ru Rakefile /app/
# Duplicate production environment to beta environment # Duplicate production environment to beta environment
COPY config/environments/production.rb config/environments/beta.rb COPY config/environments/production.rb config/environments/beta.rb
ENV RAILS_ENV production
EXPOSE 3000 EXPOSE 3000
CMD bundle exec rails db:migrate && bundle exec rails s -p 3000 -b 0.0.0.0 CMD bundle exec rails db:migrate && bundle exec rails s -p 3000 -b 0.0.0.0

View File

@ -1015,18 +1015,39 @@ def docker_blackbox_follow_manual_up(
build=build, build=build,
) )
source_env = _production_env_for("source-postgres", BLACKBOX_SOURCE_DB_NAME) env = _follow_compose_env(
follower_env = _production_env_for("follower-postgres", BLACKBOX_FOLLOWER_DB_NAME) source_host_port=source_host_port,
follower_host_port=follower_host_port,
app_image=app_image,
runner_image=runner_image,
postgres_image=postgres_image,
)
_print_header("Running source production database migrations") _print_header("Running source production database migrations")
c.run("bundle exec rails db:migrate", env=source_env, pty=True) _compose_run(
["exec", "-T", "source-app", "bash", "-lc", "bundle exec rails db:migrate"],
env=env,
project_name=BLACKBOX_FOLLOW_PROJECT,
compose_file=BLACKBOX_FOLLOW_COMPOSE_FILE,
)
_print_header("Running follower production database migrations") _print_header("Running follower production database migrations")
c.run("bundle exec rails db:migrate", env=follower_env, pty=True) _compose_run(
["exec", "-T", "follower-app", "bash", "-lc", "bundle exec rails db:migrate"],
env=env,
project_name=BLACKBOX_FOLLOW_PROJECT,
compose_file=BLACKBOX_FOLLOW_COMPOSE_FILE,
)
_print_header("Bootstrapping confirmed E2E users on source and follower") _print_header("Bootstrapping confirmed E2E users on source and follower")
_bootstrap_blackbox_users(c, source_env, E2E_EMAIL, E2E_PASSWORD, E2E_USERNAME, E2E_ALT_EMAIL, E2E_ALT_PASSWORD, E2E_ALT_USERNAME) docker_blackbox_follow_bootstrap_users(
_bootstrap_blackbox_users(c, follower_env, E2E_EMAIL, E2E_PASSWORD, E2E_USERNAME, E2E_ALT_EMAIL, E2E_ALT_PASSWORD, E2E_ALT_USERNAME) c,
source_host_port=source_host_port,
follower_host_port=follower_host_port,
app_image=app_image,
runner_image=runner_image,
postgres_image=postgres_image,
)
source_base_url = f"http://127.0.0.1:{source_host_port}" source_base_url = f"http://127.0.0.1:{source_host_port}"
follower_base_url = f"http://127.0.0.1:{follower_host_port}" follower_base_url = f"http://127.0.0.1:{follower_host_port}"