Skip to content

Commit

Permalink
fix(azure-cron): remove infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
guilbep committed Mar 12, 2024
1 parent 8074df6 commit eb50008
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ frontend/public/injectEnv.js
.env
frontend/.env*
unhcr-tss_couchdb_data_docker_volume
couchdb/local.ini
9 changes: 3 additions & 6 deletions azure-cron/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ RUN apk add --update openssl curl jq sed
# /etc/periodic/weekly
# /etc/periodic/monthly

COPY entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /etc/periodic/15min/entrypoint
RUN chmod +x /entrypoint.sh /etc/periodic/15min/entrypoint


ENTRYPOINT ["/entrypoint.sh"]
COPY add_jwt_keys_to_couchdb_via_api.sh /add_jwt_keys_to_couchdb_via_api.sh
COPY add_jwt_keys_to_couchdb_via_api.sh /etc/periodic/15min/add_jwt_keys_to_couchdb_via_api
RUN chmod +x /add_jwt_keys_to_couchdb_via_api.sh /etc/periodic/15min/add_jwt_keys_to_couchdb_via_api

# -f | Foreground
# -l N | Set log level. Most verbose 0, default 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ for key in $(jq -r 'keys[]' jwt_keys.json); do
done

rm jwt_keys.json

rm temp_file
# reload configuration
# POST /_node/nonode@nohost/_config/_reload
# not necessary, keeping as a reference for future use
# curl -X POST "http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@${COUCHDB_HOST}:5984/_node/_local/_config/_reload"

echo "end of configuration jwt_keys update $(date)";

[ "$#" -eq 0 ] && crond -f -l 8 -L /var/log/cron.log || exec "$@"
File renamed without changes.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ services:
condition: service_healthy
init-couchdb:
image: python:3.12-alpine
command: /entrypoint.sh
command: /add_jwt_keys_to_local_ini_file.sh
env_file:
- ./frontend/.env
volumes:
- ./couchdb/entrypoint.sh:/entrypoint.sh
- ./couchdb/add_jwt_keys_to_local_ini_file.sh:/add_jwt_keys_to_local_ini_file.sh
- ./couchdb/local.ini:/local.ini
couchdb:
image: couchdb:3.3
Expand Down

0 comments on commit eb50008

Please sign in to comment.