Skip to content

Commit

Permalink
PR Feedback:
Browse files Browse the repository at this point in the history
- Start two instances of redis
- remove readlink
- use postgres service to create data dir and .postgres14-upgrade-successful
  • Loading branch information
sadiqkhoja committed Dec 2, 2024
1 parent 6338341 commit 97f2bb9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: dev
dev:
docker compose --profile central -f docker-compose.yml -f docker-compose.dev.yml up -d
docker compose exec postgres14 touch /var/lib/odk/postgresql/14/.postgres14-upgrade-successful

.PHONY: stop
stop:
Expand Down
7 changes: 5 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ services:
network_mode: host
postgres:
profiles:
- none
- central
image: debian:bullseye
command: /bin/sh -c 'mkdir -p /var/lib/postgresql/14/data && touch /var/lib/postgresql/14/.postgres14-upgrade-successful'
mail:
profiles:
- none
Expand Down Expand Up @@ -53,6 +55,7 @@ services:
network_mode: host
enketo_redis_cache:
profiles:
- none
- central
network_mode: host
volumes:
dev_secrets:
3 changes: 1 addition & 2 deletions files/enketo/start-enketo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ echo "generating enketo configuration..."

if [ "$ENV" = "DEV" ]; then
sed -i -e 's/enketo_redis_main/localhost/g' \
-e 's/enketo_redis_cache/localhost/g' \
-e 's/6380/6379/g' "$CONFIG_PATH.template"
-e 's/enketo_redis_cache/localhost/g' "$CONFIG_PATH.template"
fi

BASE_URL=$( [ "${HTTPS_PORT}" = 443 ] && echo https://"${DOMAIN}" || echo https://"${DOMAIN}":"${HTTPS_PORT}" ) \
Expand Down
2 changes: 1 addition & 1 deletion files/postgres14/start-postgres.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -eu
set -o pipefail

flag_upgradeCompletedOk=$(readlink -f -m "$PGDATA/../.postgres14-upgrade-successful")
flag_upgradeCompletedOk="$PGDATA/../.postgres14-upgrade-successful"

logPrefix="$(basename "$0")"
log() {
Expand Down

0 comments on commit 97f2bb9

Please sign in to comment.