-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: modification de l'action cypress pour lire les variables du vault (
#947) * fix: modification de l'action cypress pour lire les variables du vault * fix: ajout command avec redirection des logs
- Loading branch information
1 parent
005137b
commit 5617729
Showing
6 changed files
with
62 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
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,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if [ -z "${1:-}" ]; then | ||
read -p "Veuillez renseigner le type de plateforme (recette|preview): " PLATFORM | ||
else | ||
readonly PLATFORM="$1" | ||
shift | ||
fi | ||
|
||
if [[ -z "${ANSIBLE_VAULT_PASSWORD_FILE:-}" ]]; then | ||
ansible_extra_opts+=("--vault-password-file" "${SCRIPT_DIR}/get-vault-password-client.sh") | ||
else | ||
echo "Récupération de la passphrase depuis l'environnement variable ANSIBLE_VAULT_PASSWORD_FILE" | ||
fi | ||
|
||
readonly VAULT_FILE="${ROOT_DIR}/.infra/vault/vault.yml" | ||
CYPRESS_ENV_FILE="${ROOT_DIR}/cypress.${PLATFORM}.env" | ||
|
||
function setCypressEnv() { | ||
echo "writing Cypress env variables to $CYPRESS_ENV_FILE" | ||
echo "" > $CYPRESS_ENV_FILE | ||
ansible-vault view "${ansible_extra_opts[@]}" "$VAULT_FILE" | yq -o=shell '.vault' | grep -E "^CYPRESS_" >> $CYPRESS_ENV_FILE | ||
ansible-vault view "${ansible_extra_opts[@]}" "$VAULT_FILE" | yq -o=shell ".vault.$PLATFORM" | grep -E "^CYPRESS_" >> $CYPRESS_ENV_FILE | ||
} | ||
|
||
setCypressEnv 2> /tmp/setCypressEnv.log |
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
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