-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixes the encode test * fixes integration, we will need to override this in dev and terra * better way to have integration drop all before migrating and running tests * styling * utility scripts
- Loading branch information
thathert
authored
Jul 3, 2019
1 parent
812174d
commit c94b580
Showing
5 changed files
with
57 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
: ${DB:?} | ||
|
||
PW=$( vault read -format=json secret/dsde/datarepo/integration/api-secrets-integration.json | \ | ||
jq -r .data.datarepoPassword ) | ||
|
||
kubectl --namespace data-repo run psql -it --serviceaccount=jade-sa --restart=Never --rm --image postgres:9.6 -- \ | ||
psql "postgresql://drmanager:${PW}@cloudsql-proxy-service.data-repo/${DB}" |
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,39 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
: ${GOOGLE_CLOUD_PROJECT:?} | ||
: ${VAULT_ADDR:?} | ||
: ${ENVIRONMENT:?} | ||
: ${SUFFIX:?} | ||
|
||
if [ -z "$VAULT_TOKEN" ]; then | ||
if [ ! -f ~/.vault-token ]; then | ||
echo "VAULT_TOKEN needs to be set or ~/.vault-token needs to exist" | ||
exit 1 | ||
fi | ||
export VAULT_TOKEN=$( cat ~/.vault-token ) | ||
fi | ||
|
||
# the paths we'll use will be relative to this script | ||
WD=$( dirname "${BASH_SOURCE[0]}" ) | ||
NOW=$(date +%Y-%m-%d_%H-%M-%S) | ||
DATA_REPO_TAG="${GOOGLE_CLOUD_PROJECT}_${NOW}" | ||
SCRATCH=/tmp/deploy-scratch | ||
|
||
# Make sure kubectl is pointing at the right project | ||
KUBECTL_CONTEXT=$(kubectl config current-context) | ||
if [[ $KUBECTL_CONTEXT != *${GOOGLE_CLOUD_PROJECT}* ]]; then | ||
echo "the kubernetes context (${KUBECTL_CONTEXT}) does not match your GOOGLE_CLOUD_PROJECT: ${GOOGLE_CLOUD_PROJECT}" | ||
echo "the easiest way to change it is using the context menu after clicking on the Docker icon in your top bar" | ||
exit 1 | ||
fi | ||
|
||
# make a temporary directory for rendering, we'll delete it later | ||
mkdir -p $SCRATCH | ||
|
||
# render secrets, create or update on kubernetes | ||
consul-template -template "${WD}/k8s/secrets/api-secrets.yaml.ctmpl:${SCRATCH}/api-secrets.yaml" -once | ||
kubectl apply -f "${SCRATCH}/api-secrets.yaml" | ||
|
||
rm -r $SCRATCH |
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 @@ | ||
db.migrate.dropAllOnStart=true |
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