Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(user-notification): Firebase Credentials Setup for Local Development #17199

Merged
merged 13 commits into from
Dec 13, 2024
Merged
1 change: 1 addition & 0 deletions libs/shared/utils/src/lib/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ if (isServer) {
* @param environment
*/
export const isRunningOnEnvironment = (environment: ActiveEnvironment) => {
console.log('isRunningOnEnvironment', environment, activeEnvironment)
rafnarnason marked this conversation as resolved.
Show resolved Hide resolved
return environment === activeEnvironment
}
24 changes: 24 additions & 0 deletions scripts/get-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ function get-secrets {
fi
}

function get-secrets {
echo "Fetching secret environment variables for '$*'"

pre=$(wc -l "$env_secret_file" | awk '{print $1}')
debug "Project '$*' has $pre secrets before render-secrets"

# Capture output of ts-node command
output=$(ts-node --dir "$ROOT"/infra "$ROOT"/infra/src/cli/cli render-secrets --service="$*")

# Process each line of output
echo "$output" | while IFS= read -r line; do
# Clean each line: remove newlines and backslashes within the line but keep JSON format intact
cleaned_line=$(echo "$line" | tr -d '\n' | sed 's/\\n/ /g' | sed 's/\\//g')
echo "$cleaned_line" >> "$env_secret_file"
done

post=$(wc -l "$env_secret_file" | awk '{print $1}')
debug "Project '$*' has $post secrets after render-secrets"

if [ "$pre" == "$post" ]; then
echo "No secrets found for project '$*'"
fi
}

function aws-check {
if ! aws sts get-caller-identity &>/dev/null; then
echo "You must be logged in to AWS to fetch secrets" >&2
Expand Down
Loading