forked from nextstrain/docker-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete-envd
More file actions
executable file
·26 lines (23 loc) · 785 Bytes
/
delete-envd
File metadata and controls
executable file
·26 lines (23 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -euo pipefail
# Optionally remove the contents of /nextstrain/env.d (and any remote archive)
# so values remain only in process memory. We don't remove /nextstrain/env.d
# itself because it might be mounted in from the host system and thus
# undeletable.
case "${NEXTSTRAIN_DELETE_ENVD:-}" in
1|yes|true)
rm -rf /nextstrain/env.d/*
if [[ -n "${NEXTSTRAIN_ENVD_URL:-}" ]]; then
case "$NEXTSTRAIN_ENVD_URL" in
s3://*)
aws s3 rm "$NEXTSTRAIN_ENVD_URL"
;;
*)
echo "delete-envd: No handler for NEXTSTRAIN_ENVD_URL <$NEXTSTRAIN_ENVD_URL>" >&2
exit 1
;;
esac
fi
;;
esac
exec "$@"