Skip to content

Commit

Permalink
Rename TDDBIN_ROOT_DOMAIN to TDDBIN_ROOT_URL and store the URL in the…
Browse files Browse the repository at this point in the history
…re, not just the domain, since we moved to HTTPS
  • Loading branch information
wolframkriesing committed Oct 5, 2019
1 parent ebd37a4 commit 46be446
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ after_success:

env:
global:
- TDDBIN_ROOT_DOMAIN: tddbin.com
- TDDBIN_ROOT_URL: https://tddbin.com
- GH_EMAIL: w+travis-for-tddbin@kriesing.de
- GH_REF: github.com/tddbin/katas.git
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
- [x] Fix: Improve one of the promise/api katas
- [x] Use the package for the CHANGELOG checking (it is https://github.com/wolframkriesing/to-do-list-checker)
- [x] Deploy the katas for ES1, ES8 and hamjest
- [ ] Rename TDDBIN_ROOT_DOMAIN to TDDBIN_ROOT_URL and store the URL in there, not just the domain, since we moved to HTTPS
- [x] Rename TDDBIN_ROOT_DOMAIN to TDDBIN_ROOT_URL and store the URL in there, not just the domain, since we moved to HTTPS
2 changes: 1 addition & 1 deletion html/proxy.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE HTML>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.6.17/dist/xdomain.min.js" master="http://${TDDBIN_ROOT_DOMAIN}"></script>
<script src="//unpkg.com/xdomain@0.8.2/dist/xdomain.min.js" master="${TDDBIN_ROOT_URL}"></script>
11 changes: 6 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if [ -z "${TDDBIN_ROOT_DOMAIN:+x}" ]; then
echo "Can not build. Environment variable 'TDDBIN_ROOT_DOMAIN' must be set";
if [ -z "${TDDBIN_ROOT_URL:+x}" ]; then
echo "Can not build. Environment variable 'TDDBIN_ROOT_URL' must be set";
exit 1;
fi;

Expand All @@ -23,9 +23,10 @@ cp $ORIGIN_ROOT/CNAME $DIST_ROOT/CNAME;
cp $ORIGIN_ROOT/.nojekyll $DIST_ROOT/;

cp $ORIGIN_ROOT/html/proxy.html $DIST_ROOT/;
# replace place holder TDDBIN_ROOT_DOMAIN with env var, so it can be different in dev/prod mode
# replace place holder TDDBIN_ROOT_URL with env var, so it can be different in dev/prod mode
TDDBIN_ROOT_URL_ESCAPED_FOR_SED=$(sed -e 's/[\/&]/\\&/g' <<< ${TDDBIN_ROOT_URL})
if [[ $OSTYPE == darwin* ]]; then
sed s/\${TDDBIN_ROOT_DOMAIN}/$TDDBIN_ROOT_DOMAIN/g $DIST_ROOT/proxy.html --in-place
sed s/\${TDDBIN_ROOT_URL}/$TDDBIN_ROOT_URL_ESCAPED_FOR_SED/g $DIST_ROOT/proxy.html --in-place
else
sed -i "s/\${TDDBIN_ROOT_DOMAIN}/$TDDBIN_ROOT_DOMAIN/g" $DIST_ROOT/proxy.html
sed -i "s/\${TDDBIN_ROOT_URL}/$TDDBIN_ROOT_URL_ESCAPED_FOR_SED/g" $DIST_ROOT/proxy.html
fi;

0 comments on commit 46be446

Please sign in to comment.