Skip to content

Commit 21240df

Browse files
authored
Merge pull request #41 from blocknotes/improve-dev-setup
Improve dev setup
2 parents 39cc369 + ab140d9 commit 21240df

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ rails_ver = ENV.fetch('RAILS_VERSION', '')
2020
rails = eval_version('rails', rails_ver)
2121
gem(*rails)
2222

23+
ransack_ver = ENV.fetch('RANSACK_VERSION', '')
24+
ransack = eval_version('ransack', ransack_ver)
25+
gem(*ransack)
26+
2327
administrate_ver = ENV.fetch('ADMINISTRATE_VERSION', '')
2428
administrate = eval_version('administrate', administrate_ver)
2529
gem(*administrate)

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ include extra/.env
22

33
help:
44
@echo -e "${COMPOSE_PROJECT_NAME} - Main project commands:\n\
5-
make up # starts the dev services (optional env vars: RUBY / RAILS / ADMINISTRATE)\n\
5+
make up # starts the dev services (optional env vars: RUBY / RAILS / RANSACK / ADMINISTRATE)\n\
66
make specs # run the tests (after up)\n\
77
make lint # run the linters (after up)\n\
88
make server # run the server (after up)\n\
99
make shell # open a shell (after up)\n\
1010
make down # cleanup (after up)\n\
11-
Example: RUBY=3.2 RAILS=7.1 ADMINISTRATE=0.18.0 make up"
11+
Example: RUBY=3.2 RAILS=7.1 RANSACK=4.2.0 ADMINISTRATE=0.18.0 make up"
1212

1313
# System commands
1414

@@ -44,4 +44,4 @@ server: seed
4444
@docker compose -f extra/docker-compose.yml exec app bin/rails server -b 0.0.0.0 -p ${SERVER_PORT}
4545

4646
specs:
47-
@docker compose -f extra/docker-compose.yml exec app bin/rspec --fail-fast
47+
@docker compose -f extra/docker-compose.yml exec app bin/rspec

extra/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ ARG UID
1616
RUN useradd -u $UID --shell /bin/bash app
1717

1818
RUN mkdir -p /home/app && chown -R app:app /home/app
19+
RUN chown -R app:app /usr/local/bundle
20+
RUN ln -s /app/extra/.bashrc /home/app/.bashrc
1921

2022
ARG RAILS_VERSION
2123
ENV RAILS_VERSION=$RAILS_VERSION
2224

25+
ARG RANSACK_VERSION
26+
ENV RANSACK_VERSION=$RANSACK_VERSION
27+
2328
ARG ADMINISTRATE_VERSION
2429
ENV ADMINISTRATE_VERSION=$ADMINISTRATE_VERSION
2530

31+
USER $UID
2632
WORKDIR /app
2733
COPY . /app
2834
RUN bundle install
29-
RUN chown -R app:app /usr/local/bundle
30-
31-
RUN ln -s /app/extra/.bashrc /home/app/.bashrc

extra/development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ There are 2 ways to interact with this project:
77
1) Using Docker:
88

99
```sh
10-
make up # starts the dev services (optional env vars: RUBY / RAILS / ADMINISTRATE)
10+
make up # starts the dev services (optional env vars: RUBY / RAILS / RANSACK / ADMINISTRATE)
1111
make specs # run the tests (after up)
1212
make lint # run the linters (after up)
1313
make server # run the server (after up)
1414
make shell # open a shell (after up)
1515
make down # cleanup (after up)
1616

1717
# Example using specific versions:
18-
RUBY=3.2 RAILS=7.1 ADMINISTRATE=0.18.0 make up
18+
RUBY=3.2 RAILS=7.1 RANSACK=4.2.0 ADMINISTRATE=0.18.0 make up
1919
```
2020

2121
2) With a local setup:

extra/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
BUNDLER_VERSION: ${BUNDLER_VERSION}
88
RUBY_IMAGE: ruby:${RUBY:-3.4}-slim
99
RAILS_VERSION: ${RAILS:-}
10+
RANSACK_VERSION: ${RANSACK:-}
1011
ADMINISTRATE_VERSION: ${ADMINISTRATE:-}
1112
UID: ${UID}
1213
user: ${UID}:${GID}

0 commit comments

Comments
 (0)