Skip to content

Commit 41580e2

Browse files
committed
Allow config to be mounted
1 parent 9aab782 commit 41580e2

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

docker/entrypoint.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,22 @@
1515
# - then run codegen for router and processors
1616
# - run migrations
1717

18+
CONFIG=$(find "/config" -maxdepth 1 -name "*.config.php" | head -n 1);
19+
if [ -f "$CONFIG" ]; then
20+
mv "$CONFIG" "/app/config/mocking.development.config.php";
21+
fi
1822

19-
20-
DIRECTORY="/api"
21-
FILE=$(find "$DIRECTORY" -maxdepth 1 -name "*.yaml" -o -name "*.yml" -o -name "*.json" | head -n 1)
22-
23-
echo -n $FILE > /app/config/openapi-file
24-
25-
if ! [ -f "$FILE" ]; then
23+
API=$(find "/api" -maxdepth 1 -name "*.yaml" -o -name "*.yml" -o -name "*.json" | head -n 1);
24+
if ! [ -f "$API" ]; then
2625
echo "Your OpenAPI must be mounted in $DIRECTORY";
2726
exit 1;
2827
fi
2928

30-
if ! /app/bin/validate-user-api $FILE; then
29+
if ! /app/bin/validate-user-api $API; then
3130
exit 1;
3231
fi
3332

34-
if ! /app/bin/codegen $FILE; then
33+
if ! /app/bin/codegen $API; then
3534
exit 1;
3635
fi
3736

0 commit comments

Comments
 (0)