-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save old deployment before saving new one
- Loading branch information
1 parent
e0552cc
commit f4a79d7
Showing
3 changed files
with
2,103 additions
and
0 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
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,22 @@ | ||
#!/usr/bin/env bash | ||
set -e -u -o pipefail | ||
|
||
# before we generate a new deployment, save the current one in | ||
# `/static/deployment-snapshots` so we can ensure they can all be read over | ||
# time | ||
|
||
CHINOOK_DEPLOYMENT="$1" | ||
|
||
CURRENT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" > /dev/null && echo "$PWD")" | ||
|
||
SNAPSHOT_DIR="$(realpath ${CURRENT_DIR}/../static/deployment-snapshots)" | ||
|
||
mkdir -p "$SNAPSHOT_DIR" | ||
|
||
NEW_FILENAME="$(sha256sum "${CHINOOK_DEPLOYMENT}" | cut -f1 -d' ').json" | ||
|
||
echo "$SNAPSHOT_DIR" | ||
|
||
echo "${CHINOOK_DEPLOYMENT}" | ||
|
||
cp "${CHINOOK_DEPLOYMENT}" "${SNAPSHOT_DIR}/${NEW_FILENAME}" |
Oops, something went wrong.