generated from ddev/ddev-addon-template
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve $PLATFORM_ROUTES to include at least route id and multiple ro…
- Loading branch information
Showing
7 changed files
with
109 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
#ddev-generated | ||
|
||
export relationshipname=$1 | ||
|
||
read -r -d '' redis_stanza <<REDIS_EOF | ||
"${relationshipname}": [ | ||
{ | ||
"username": null, | ||
"scheme": "redis", | ||
"service": "cache", | ||
"fragment": null, | ||
"ip": "255.255.255.255", | ||
"hostname": "redis", | ||
"public": false, | ||
"cluster": "ddev-dummy-cluster", | ||
"host": "redis", | ||
"rel": "redis", | ||
"query": {}, | ||
"path": null, | ||
"password": null, | ||
"type": "redis:6.0", | ||
"port": 6379, | ||
"host_mapped": false | ||
} | ||
] | ||
REDIS_EOF | ||
|
||
printf "$redis_stanza" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
#ddev-generated | ||
|
||
# Create a stanza for $PLATFORM_ROUTES | ||
|
||
# Args: | ||
# route (like https://{default}/) | ||
# id | ||
# production_url | ||
# upstream | ||
# type | ||
# original_url | ||
|
||
export route=$1 | ||
export id=$2 | ||
export production_url=$3 | ||
export upstream=$4 | ||
export type=$5 | ||
export original_url=$6 | ||
|
||
idline='"id": null' | ||
if [ ! -z ${id} ]; then | ||
idline="\"id\": \"${id}\"" | ||
fi | ||
|
||
read -r -d '' route_stanza <<ROUTE_EOF | ||
"${route}": { | ||
"primary": true, | ||
${idline}, | ||
"production_url": "${production_url}", | ||
"attributes": {}, | ||
"upstream": "${upstream}", | ||
"type": "${type}", | ||
"original_url": "${original_url}" | ||
} | ||
ROUTE_EOF | ||
|
||
printf "${route_stanza}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.