mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Merge remote-tracking branch 'opf/dev' into HEAD
# Conflicts: # lib/open_project/version.rb # modules/backlogs/config/locales/crowdin/de.yml # modules/wikis/config/locales/crowdin/de.yml
This commit is contained in:
@@ -156,22 +156,24 @@ setup_tests() {
|
||||
}
|
||||
|
||||
run_units() {
|
||||
shopt -s extglob
|
||||
shopt -s extglob globstar nullglob
|
||||
reset_dbs
|
||||
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_units.log {,modules/*/}spec/!(features)"
|
||||
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_units.log {,modules/*/}spec/{!(features)/**/,}*_spec.rb"
|
||||
cleanup
|
||||
}
|
||||
|
||||
run_features() {
|
||||
shopt -s globstar nullglob
|
||||
run_background start_hocuspocus
|
||||
reset_dbs
|
||||
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features"
|
||||
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features/**/*_spec.rb"
|
||||
cleanup
|
||||
}
|
||||
|
||||
run_all() {
|
||||
shopt -s globstar nullglob
|
||||
reset_dbs
|
||||
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_all.log {,modules/*/}spec"
|
||||
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_all.log {,modules/*/}spec/**/*_spec.rb"
|
||||
cleanup
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# Docker Development
|
||||
|
||||
The Docker development environment uses configurations in `docker/dev/` and the `bin/compose` wrapper script.
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
# Initial setup (first time only)
|
||||
bin/compose setup # Installs backend and frontend dependencies
|
||||
|
||||
# Starting services
|
||||
bin/compose start # Start backend and frontend in background
|
||||
bin/compose run # Start frontend in background, backend in foreground (for debugging with pry)
|
||||
|
||||
# Running tests
|
||||
bin/compose rspec spec/models/user_spec.rb # Run specific tests in backend-test container
|
||||
|
||||
# Other operations
|
||||
bin/compose reset # Remove all containers and volumes (requires setup again)
|
||||
bin/compose <command> # Pass any docker-compose command directly
|
||||
```
|
||||
|
||||
## Important Notes
|
||||
|
||||
- **CRITICAL**: `config/database.yml` must NOT exist when using Docker (rename or delete it)
|
||||
- Most developers use a local `docker-compose.override.yml` for custom port mappings and configurations
|
||||
- Copy `docker-compose.override.example.yml` to `docker-compose.override.yml` and customize as needed
|
||||
- Default ports: Backend at http://localhost:3000 (or 4200 for frontend dev server)
|
||||
- Services: `backend`, `frontend`, `worker`, `db`, `db-test`, `backend-test`, `cache`
|
||||
- Persisted volumes: `pgdata`, `bundle`, `npm`, `tmp`, `opdata` (data survives container restarts)
|
||||
- Docker build context: Uses Dockerfiles in `docker/dev/backend/` and `docker/dev/frontend/`
|
||||
|
||||
## Commands Reference
|
||||
|
||||
```bash
|
||||
# Setup and lifecycle
|
||||
bin/compose setup # Setup Docker environment (first time)
|
||||
bin/compose start # Start all services in background
|
||||
bin/compose run # Start frontend in background, backend in foreground
|
||||
bin/compose reset # Remove all containers and volumes
|
||||
bin/compose stop # Stop all services
|
||||
bin/compose down # Stop and remove containers
|
||||
|
||||
# Testing
|
||||
bin/compose rspec spec/models/user_spec.rb # Run specific tests
|
||||
bin/compose exec backend bundle exec rspec # Run tests directly in backend container
|
||||
|
||||
# Development
|
||||
bin/compose exec backend bundle exec rails console # Rails console
|
||||
bin/compose logs backend # View backend logs
|
||||
bin/compose logs -f backend # Follow backend logs
|
||||
bin/compose ps # List running containers
|
||||
|
||||
# Database
|
||||
bin/compose exec backend bundle exec rails db:migrate # Run migrations
|
||||
bin/compose exec backend bundle exec rails db:seed # Seed data
|
||||
|
||||
# Direct docker-compose commands
|
||||
bin/compose up -d # Start services
|
||||
bin/compose restart backend # Restart backend service
|
||||
```
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
AGENTS.md
|
||||
@@ -12,7 +12,7 @@ services:
|
||||
- POSTGRES_PASSWORD=keycloak
|
||||
|
||||
keycloak:
|
||||
image: quay.io/keycloak/keycloak:26.2
|
||||
image: quay.io/keycloak/keycloak:26.6
|
||||
command:
|
||||
- "start-dev"
|
||||
- "--proxy-headers"
|
||||
|
||||
@@ -49,17 +49,17 @@ if [ "$(id -u)" = '0' ]; then
|
||||
echo "-----> Setting PGVERSION=$PGVERSION PGBIN=$PGBIN PGCONF_FILE=$PGCONF_FILE"
|
||||
export PATH="$PGBIN:$PATH"
|
||||
|
||||
mkdir -p $APP_DATA_PATH/{files,git,svn}
|
||||
mkdir -p "$APP_DATA_PATH"/{files,git,svn}
|
||||
# The $APP_DATA_PATH may be hosted on a NAS that creates snapshots (or a btrfs filesystem). In such a case, the .snapshot folder cannot be touched.
|
||||
find $APP_DATA_PATH | grep -v .snapshot | xargs -n 1 chown $APP_USER:$APP_USER
|
||||
find "$APP_DATA_PATH" -path '*/.snapshot*' -prune -o -exec chown "$APP_USER:$APP_USER" {} +
|
||||
if [ -d /etc/apache2/sites-enabled ]; then
|
||||
chown -R $APP_USER:$APP_USER /etc/apache2/sites-enabled
|
||||
chown -R "$APP_USER:$APP_USER" /etc/apache2/sites-enabled
|
||||
echo "OpenProject currently expects to be reached on the following domain: ${SERVER_NAME:=localhost}, which does not seem to be how your installation is configured." > /var/www/html/index.html
|
||||
echo "If you are an administrator, please ensure you have correctly set the SERVER_NAME variable when launching your container." >> /var/www/html/index.html
|
||||
fi
|
||||
|
||||
# Clean up any dangling PID file
|
||||
rm -f $APP_PATH/tmp/pids/*
|
||||
rm -f "$APP_PATH"/tmp/pids/*
|
||||
|
||||
# Clean up a dangling PID file of apache
|
||||
if [ -e "$APACHE_PIDFILE" ]; then
|
||||
|
||||
Reference in New Issue
Block a user