-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added Tiltfile We can now have a complete setup ready for development When working use command `tilt up -- --local-app`
- Loading branch information
1 parent
5d45ae7
commit b203d93
Showing
8 changed files
with
120 additions
and
1 deletion.
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
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,42 @@ | ||
# point Tilt at the existing docker-compose configuration. | ||
docker_compose("./docker-compose.yml") | ||
|
||
config.define_bool("local-app") | ||
|
||
cfg = config.parse() | ||
|
||
local_app = cfg.get("local-app", False) | ||
|
||
resources = [ | ||
"redis", | ||
"database", | ||
"app", | ||
"worker" | ||
] | ||
|
||
|
||
if local_app: | ||
resources.remove("app") | ||
resources.remove("worker") | ||
local_resource( | ||
"local_app", | ||
serve_cmd="./bin/app-startup.sh", | ||
serve_env={ | ||
"RAILS_ENV": "development" | ||
}, | ||
resource_deps=["database", "redis"], | ||
readiness_probe=probe( | ||
period_secs=15, http_get=http_get_action(port=3000, path="/healthcheck") | ||
), | ||
) | ||
local_resource( | ||
"local_worker", | ||
serve_cmd="./bin/worker-startup.sh", | ||
resource_deps=["database", "redis"], | ||
) | ||
resources.append("local_app") | ||
resources.append("local_worker") | ||
|
||
|
||
config.clear_enabled_resources() | ||
config.set_enabled_resources(resources) |
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,9 @@ | ||
#!/usr/bin/env sh | ||
# | ||
# worker startup script | ||
# | ||
|
||
set -e | ||
|
||
# start sidekiq | ||
bundle exec sidekiq -C ./config/sidekiq.yml |
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
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,47 @@ | ||
version: '3.9' | ||
services: | ||
|
||
redis: | ||
image: redis:6.0-alpine | ||
networks: | ||
- gtrp | ||
ports: | ||
- 6379:6379 | ||
|
||
database: | ||
image: postgres:15-alpine | ||
networks: | ||
- gtrp | ||
environment: | ||
- POSTGRES_USER=gtrp | ||
- POSTGRES_PASSWORD=gtrp | ||
- POSTGRES_DB=get_an_international_relocation_payment_development | ||
ports: | ||
- 5432:5432 | ||
|
||
app: &app | ||
build: | ||
context: . | ||
args: | ||
- COMMIT_SHA=shafoo | ||
- GOVUK_NOTIFY_API_KEY | ||
- GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID | ||
networks: | ||
- gtrp | ||
depends_on: [ database, redis ] | ||
ports: | ||
- 3000:3000 | ||
environment: | ||
- DATABASE_URL=postgresql://gtrp:gtrp@database/get_an_international_relocation_payment_development | ||
- REDIS_URL=redis://redis | ||
- RAILS_ENV=development | ||
env_file: | ||
- .env | ||
|
||
worker: | ||
<<: *app | ||
ports: | ||
- 3001:3001 | ||
command: ./bin/worker-startup.sh | ||
networks: | ||
gtrp: |