-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from kbase/deploy-ci
- Loading branch information
Showing
15 changed files
with
298 additions
and
87 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,33 @@ | ||
{ | ||
"environments": { | ||
"appdev": { | ||
"domain": "appdev.kbase.us", | ||
"legacy": "legacy.appdev.kbase.us", | ||
"public_url": "/" | ||
}, | ||
|
||
"ci": { | ||
"domain": "ci.kbase.us", | ||
"legacy": "legacy.ci.kbase.us", | ||
"public_url": "/" | ||
}, | ||
|
||
"ci-europa": { | ||
"domain": "ci-europa.kbase.us", | ||
"legacy": "legacy.ci-europa.kbase.us", | ||
"public_url": "/" | ||
}, | ||
|
||
"narrative-dev": { | ||
"domain": "narrative-dev.kbase.us", | ||
"legacy": "legacy.narrative-dev.kbase.us", | ||
"public_url": "/" | ||
}, | ||
|
||
"production": { | ||
"domain": "narrative.kbase.us", | ||
"legacy": "legacy.narrative.kbase.us", | ||
"public_url": "/" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Here we are using bash "here strings" | ||
IFS=$'\n' read -d '' -r -a enviromentsConfig <<< "$(jq -r '.environments | ||
| keys[] as $k | ||
| [($k), (.[$k]["domain"]) , (.[$k]["legacy"]) , (.[$k]["public_url"])] | ||
| join(" ")' config.json)" | ||
|
||
declare -a enviroments=( | ||
# "<name> <domain> <legacy-domain> <public-url>" | ||
"ci ci.kbase.us legacy.kbase.us /" | ||
"ci-europa ci-europa.kbase.us legacy.ci-europa.kbase.us /" | ||
"narrative-dev narrative-dev.kbase.us legacy.narrative-dev.kbase.us /" | ||
) | ||
for enviro in "${enviromentsConfig[@]}"; do | ||
read -a envConf <<< "$enviro" | ||
echo "Building static files for enviroment \"${envConf[0]}\"..."; | ||
|
||
for enviro in "${enviroments[@]}"; do | ||
read -a strarr <<< "$enviro" | ||
echo "Building static files for enviroment \"${strarr[0]}\"..."; | ||
|
||
BUILD_PATH="./deploy/${strarr[0]}" \ | ||
REACT_APP_KBASE_DOMAIN="${strarr[1]}" \ | ||
REACT_APP_KBASE_LEGACY_DOMAIN="${strarr[2]}" \ | ||
PUBLIC_URL="${strarr[3]}" \ | ||
BUILD_PATH="./deploy/${envConf[0]}" \ | ||
REACT_APP_KBASE_ENV="${envConf[0]}" \ | ||
REACT_APP_KBASE_DOMAIN="${envConf[1]}" \ | ||
REACT_APP_KBASE_LEGACY_DOMAIN="${envConf[2]}" \ | ||
PUBLIC_URL="${envConf[3]}" \ | ||
npm run build && \ | ||
echo "Built static files for enviroment \"${strarr[0]}\"."; | ||
echo "Built static files for enviroment \"${envConf[0]}\"."; | ||
done |
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
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
Oops, something went wrong.