Skip to content

Commit

Permalink
fix: do not download envsubst if not required
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Feb 15, 2024
1 parent e9717aa commit 9448a10
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 35 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/openapi_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ jobs:
env:
EXAMPLE_DOTENV: ${{ inputs.example_env_file_path }}
run: |
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
echo "Checking if ${EXAMPLE_DOTENV} exists"
if [ -f ${EXAMPLE_DOTENV} ]; then
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
echo "Substituting variables from ${EXAMPLE_DOTENV} --> .env"
./envsubst < "${EXAMPLE_DOTENV}" > .env
else
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/remote_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,16 @@ jobs:
- name: Create .env file
run: |
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
# Check if .env.example exists
if [ -f .env.example ]; then
echo "Substituting variables from .env.example --> .env"
./envsubst < .env.example > .env
echo "Checking if ${EXAMPLE_DOTENV} exists"
if [ -f ${EXAMPLE_DOTENV} ]; then
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
echo "Substituting variables from ${EXAMPLE_DOTENV} --> .env"
./envsubst < "${EXAMPLE_DOTENV}" > .env
else
echo ".env.example not found, creating empty .env"
echo "${EXAMPLE_DOTENV} not found, creating empty .env"
touch .env
fi
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/test_compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,16 @@ jobs:
- name: Create .env file
run: |
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
# Check if .env.example exists
if [ -f .env.example ]; then
echo "Substituting variables from .env.example --> .env"
./envsubst < .env.example > .env
echo "Checking if ${EXAMPLE_DOTENV} exists"
if [ -f ${EXAMPLE_DOTENV} ]; then
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
echo "Substituting variables from ${EXAMPLE_DOTENV} --> .env"
./envsubst < "${EXAMPLE_DOTENV}" > .env
else
echo ".env.example not found, creating empty .env"
echo "${EXAMPLE_DOTENV} not found, creating empty .env"
touch .env
fi
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/test_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,16 @@ jobs:
- name: Create .env file
run: |
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
# Check if .env.example exists
if [ -f .env.example ]; then
echo "Substituting variables from .env.example --> .env"
./envsubst < .env.example > .env
echo "Checking if ${EXAMPLE_DOTENV} exists"
if [ -f ${EXAMPLE_DOTENV} ]; then
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
echo "Substituting variables from ${EXAMPLE_DOTENV} --> .env"
./envsubst < "${EXAMPLE_DOTENV}" > .env
else
echo ".env.example not found, creating empty .env"
echo "${EXAMPLE_DOTENV} not found, creating empty .env"
touch .env
fi
Expand Down

0 comments on commit 9448a10

Please sign in to comment.