Skip to content

Commit

Permalink
Ignore changes to Gemfile.lock (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtnstar authored Oct 28, 2024
1 parent 70685e9 commit 5dd0638
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.local
.yarnrc
/dumps
/docker/home/rails/*
!/docker/home/rails/.*rc
/docker/rails/home/*
!/docker/rails/home/.*rc
/shared/.env.generated
docker/rails/Gemfile.lock
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ Useful when adding new seeds
hit rails seed
```

### Gemfile.lock

Since the wagon gem is always causing changes in Gemfile.lock we do not want to check in to core repo, changes to this file are ignored. If you updated gems you need to manually copy the Gemfile.lock from `docker/rails/Gemfile.lock` to the core repo.

### Shutdown

🍺 finished work ? execute `hit down` to shut down all running containers
3 changes: 3 additions & 0 deletions bin/hit/_hit
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
HIT_SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]:-$_}")")"
HIT_PROJECT="$(basename "$(cd "$HIT_SCRIPT_DIR/../../" && pwd)")"
HIT_WAGON_NAMES=$(ls -d "$HIT_SCRIPT_DIR"/../../app/hitobito_* | sed 's|.*/hitobito_||')
HIT_CORE_DIR="$HIT_SCRIPT_DIR/../../app/hitobito"
export HIT_SCRIPT_DIR
export HIT_PROJECT
export HIT_WAGON_NAMES
export HIT_CORE_DIR
source "$HIT_SCRIPT_DIR/welcome_info"

PS1="HIT-$HIT_PROJECT> "
Expand Down Expand Up @@ -50,6 +52,7 @@ EOF
}

hit() {
source "$HIT_SCRIPT_DIR/pre_hit"
case $1 in
r | rails)
case $2 in
Expand Down
13 changes: 13 additions & 0 deletions bin/hit/pre_hit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

copy_gemfile_lock() {
(
cd $HIT_CORE_DIR
git checkout Gemfile.lock
cp Gemfile.lock $HIT_SCRIPT_DIR/../../docker/rails/Gemfile.lock
) > /dev/null 2>&1
echo "Changes to Gemfile.lock are ignored, check README.md#Gemfile.lock for more details."
echo
}

copy_gemfile_lock
15 changes: 7 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
services:
rails: &rails
build:
context: ./docker
dockerfile: rails.dockerfile
context: ./docker/rails
image: ghcr.io/hitobito/development/rails
user: "${RAILS_UID:-1000}"
tty: true
Expand All @@ -12,7 +11,7 @@ services:
- mailcatcher
- cache
- webpack
env_file: docker/rails.env
env_file: docker/rails/env
environment:
WEBPACKER_DEV_SERVER_HOST: webpack
DISABLE_SPRING: 'true'
Expand All @@ -22,12 +21,12 @@ services:
- ./app/:/usr/src/app
- hitobito_bundle:/opt/bundle
- seed:/seed
- ./docker/home/rails:/home/developer
- ./docker/rails/home:/home/developer
- /tmp/.X11-unix:/tmp/.X11-unix
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ./docker/rails/Gemfile.lock:/usr/src/app/hitobito/Gemfile.lock

# `exec` into this to execute the tests of the core
rails_test:
<<: *rails
profiles:
Expand Down Expand Up @@ -82,11 +81,10 @@ services:

webpack:
build:
context: ./docker
dockerfile: rails.dockerfile
context: ./docker/rails
image: ghcr.io/hitobito/development/rails
entrypoint: [ "webpack-entrypoint.sh" ]
env_file: docker/rails.env
env_file: docker/rails/env
environment:
WEBPACKER_DEV_SERVER_HOST: webpack
SKIP_BUNDLE_INSTALL: 1
Expand All @@ -98,6 +96,7 @@ services:
- ./app/:/usr/src/app
- hitobito_bundle:/opt/bundle
- hitobito_yarn_cache:/home/developer/.cache/yarn
- ./docker/rails/Gemfile.lock:/usr/src/app/hitobito/Gemfile.lock

volumes:
postgres:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5dd0638

Please sign in to comment.