-
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.
- Loading branch information
1 parent
e40caaa
commit bf71111
Showing
6 changed files
with
70 additions
and
20 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 |
---|---|---|
@@ -1,5 +1,29 @@ | ||
#!/bin/bash | ||
|
||
cleanup() { | ||
echo | ||
echo "Removing pipe..." | ||
rm -f deploypipe | ||
exit 1 | ||
} | ||
|
||
# if you do Ctrl+C it will run cleanup | ||
trap cleanup SIGINT | ||
|
||
# remove the pipe if it somehow still exists | ||
rm -f deploypipe | ||
# create a named fifo pipe at ./deploypipe | ||
mkfifo deploypipe | ||
docker run -e BWS_ACCESS_TOKEN -v ./deploypipe:/dployer/ti_dploy_pipe -v ./tidploy.json:/dployer/tidploy.json ghcr.io/tiptenbrink/bws-dployer:latest & ./source.sh ./deploypipe | ||
# run the deployer, providing it with the Secrets Manager access token and | ||
# mounting the named pipe as well as the JSON containing the secrets to the | ||
# container | ||
# the process is started in the background (the '&') and then we run our | ||
# previous script with the name of the pipe as the first argument | ||
docker run \ | ||
-e BWS_ACCESS_TOKEN \ | ||
-v ./deploypipe:/dployer/ti_dploy_pipe \ | ||
-v "./tidploy.json:/dployer/tidploy.json" \ | ||
ghcr.io/tiptenbrink/bws-dployer:latest & \ | ||
./source.sh ./deploypipe | ||
# finally we clean up the pipe by removing it | ||
rm deploypipe |
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
#!/bin/bash | ||
# we want to auto-export all environment variables we set so docker compose can use them | ||
set -a | ||
echo "Waiting for secrets..." | ||
while [ true ] | ||
do | ||
# if file exists and is named pipe | ||
if [ -p "$1" ]; then | ||
echo "Loaded secret." | ||
. $1 | ||
if [ -n "$TIDPLOY_READY" ]; then | ||
echo "Starting...." | ||
./entrypoint.sh | ||
break | ||
else | ||
echo "Secrets loaded." | ||
fi | ||
# if pipe doesn't exist we don't want to run too many loops | ||
else | ||
sleep 1 | ||
fi | ||
|
||
if [ -n "$TIDPLOY_READY" ]; then | ||
echo "Starting...." | ||
./entrypoint.sh | ||
break | ||
fi | ||
done |
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 |
---|---|---|
@@ -1,5 +1,29 @@ | ||
#!/bin/bash | ||
|
||
cleanup() { | ||
echo | ||
echo "Removing pipe..." | ||
rm -f deploypipe | ||
exit 1 | ||
} | ||
|
||
# if you do Ctrl+C it will run cleanup | ||
trap cleanup SIGINT | ||
|
||
# remove the pipe if it somehow still exists | ||
rm -f deploypipe | ||
# create a named fifo pipe at ./deploypipe | ||
mkfifo deploypipe | ||
docker run -e BWS_ACCESS_TOKEN -v ./deploypipe:/dployer/ti_dploy_pipe -v ./tidploy.json:/dployer/tidploy.json ghcr.io/tiptenbrink/bws-dployer:latest & ./source.sh ./deploypipe | ||
# run the deployer, providing it with the Secrets Manager access token and | ||
# mounting the named pipe as well as the JSON containing the secrets to the | ||
# container | ||
# the process is started in the background (the '&') and then we run our | ||
# previous script with the name of the pipe as the first argument | ||
docker run \ | ||
-e BWS_ACCESS_TOKEN \ | ||
-v ./deploypipe:/dployer/ti_dploy_pipe \ | ||
-v "./tidploy.json:/dployer/tidploy.json" \ | ||
ghcr.io/tiptenbrink/bws-dployer:latest & \ | ||
./source.sh ./deploypipe | ||
# finally we clean up the pipe by removing it | ||
rm deploypipe |
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
#!/bin/bash | ||
# we want to auto-export all environment variables we set so docker compose can use them | ||
set -a | ||
echo "Waiting for secrets..." | ||
while [ true ] | ||
do | ||
# if file exists and is named pipe | ||
if [ -p "$1" ]; then | ||
echo "Loaded secret." | ||
. $1 | ||
if [ -n "$TIDPLOY_READY" ]; then | ||
echo "Starting...." | ||
./entrypoint.sh | ||
break | ||
else | ||
echo "Secrets loaded." | ||
fi | ||
# if pipe doesn't exist we don't want to run too many loops | ||
else | ||
sleep 1 | ||
fi | ||
|
||
if [ -n "$TIDPLOY_READY" ]; then | ||
echo "Starting...." | ||
./entrypoint.sh | ||
break | ||
fi | ||
done |
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