Skip to content

Commit a1ee355

Browse files
authored
Put platform db:dump command into conditional (#4)
1 parent 1e9c490 commit a1ee355

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

entrypoint.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ sed -i 's/# StrictHostKeyChecking ask.*/StrictHostKeyChecking accept-new/' /et
88
FILENAME="${INPUT_DB_DUMP_FILENAME_BASE}-$(date +%F-%T)"
99

1010
# Check if the optional relationship value exists.
11-
RELATIONSHIP=""
1211
if [ -z "${INPUT_PLATFORMSH_RELATIONSHIP}" ]
1312
then
14-
echo "No relationship variable provided so no relationship parameter added to platform db:dump."
13+
# Run command without --relationship parameter.
14+
platform db:dump -v --yes --project "$INPUT_PLATFORMSH_PROJECT" --environment "$INPUT_PLATFORMSH_ENVIRONMENT" --gzip -f "$FILENAME".sql.gz
1515
else
16-
RELATIONSHIP="--relationship $INPUT_PLATFORMSH_RELATIONSHIP"
16+
# Run command with --relationship parameter.
17+
platform db:dump -v --yes --project "$INPUT_PLATFORMSH_PROJECT" --environment "$INPUT_PLATFORMSH_ENVIRONMENT" --relationship "$INPUT_PLATFORMSH_RELATIONSHIP" --gzip -f "$FILENAME".sql.gz
1718
fi
1819

19-
platform db:dump -v --yes --project "$INPUT_PLATFORMSH_PROJECT" --environment "$INPUT_PLATFORMSH_ENVIRONMENT" "$RELATIONSHIP" --gzip -f "$FILENAME".sql.gz
20-
2120
aws s3 cp "$FILENAME".sql.gz s3://"$INPUT_AWS_S3_BUCKET"

0 commit comments

Comments
 (0)