git actions v2

This commit is contained in:
Davidson Gomes 2024-06-09 14:53:48 -03:00
parent 6c8e84eed4
commit 7dd4d8ae86
3 changed files with 21 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
source ./scripts/env_functions.sh
source ./Docker/scripts/env_functions.sh
if [ "$DOCKER_ENV" != "true" ]; then
export_env_vars

18
Docker/scripts/env_functions.sh Executable file
View File

@ -0,0 +1,18 @@
export_env_vars() {
if [ -f .env ]; then
while IFS='=' read -r key value; do
if [[ -z "$key" || "$key" =~ ^\s*# || -z "$value" ]]; then
continue
fi
key=$(echo "$key" | tr -d '[:space:]')
value=$(echo "$value" | tr -d '[:space:]')
value=$(echo "$value" | tr -d "'" | tr -d "\"")
export "$key=$value"
done < .env
else
echo ".env file not found"
exit 1
fi
}

View File

@ -27,11 +27,11 @@ COPY ./.env.example ./.env
COPY ./Docker ./Docker
RUN chmod +x ./Docker/deploy_database.sh
RUN chmod +x ./Docker/scripts/*
ENV DATABASE_CONNECTION_URI=postgres://postgres:pass@localhost/evolution
RUN ./Docker/deploy_database.sh
RUN ./Docker/scripts/deploy_database.sh
RUN npm run build