-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add local dev setup and fix ci db connection
- Loading branch information
1 parent
16ee170
commit df44505
Showing
8 changed files
with
125 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Gemfile.lock | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,2 @@ | ||
Gemfile.lock | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
coverage | ||
InstalledFiles | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp | ||
|
||
# YARD artifacts | ||
.yardoc | ||
_yardoc | ||
doc/ | ||
|
||
nc.yml | ||
prodder-workspace/ | ||
features/support/blog.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ARG RUBY_VERSION=3.0 | ||
|
||
FROM ruby:${RUBY_VERSION} | ||
|
||
WORKDIR /app | ||
|
||
RUN apt update && \ | ||
apt install -y git postgresql-client && \ | ||
apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV BUNDLER_VERSION 2.4.22 | ||
|
||
RUN gem install bundler -v $BUNDLER_VERSION | ||
|
||
COPY Gemfile ./ | ||
|
||
RUN bundle install -j $(nproc) | ||
|
||
COPY . . | ||
|
||
ENTRYPOINT ["entrypoints/entry.sh"] | ||
CMD ["bin/prodder"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
services: | ||
postgres: | ||
image: postgres:13-alpine | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
healthcheck: | ||
test: ["CMD", "pg_isready"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
restart: on-failure:5 | ||
|
||
prodder: | ||
platform: linux/arm64 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
RUBY_VERSION: 3.0 | ||
volumes: | ||
- .:/app | ||
- /app/config | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
environment: | ||
PGHOST: localhost | ||
PGPORT: "5432" | ||
PGUSER: postgres | ||
PGPASSWORD: postgres | ||
network_mode: host | ||
|
||
rspec: | ||
profiles: | ||
- test | ||
extends: | ||
service: prodder | ||
command: bundle exec rspec | ||
|
||
cucumber: | ||
profiles: | ||
- test | ||
extends: | ||
service: prodder | ||
command: bundle exec cucumber | ||
|
||
volumes: | ||
postgres_data: |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
cmd=("$@") | ||
|
||
mkdir -p config | ||
cat <<EOF > config/database.yml | ||
test: | ||
adapter: postgresql | ||
encoding: unicode | ||
pool: 20 | ||
database: prodder_test | ||
EOF | ||
|
||
exec "${cmd[@]}" |