Skip to content

Commit aa5e5fb

Browse files
committed
Extract homepage adjustment to script
1 parent 262d783 commit aa5e5fb

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ script:
1111
- npm run lint
1212
- npm test -- --coverage
1313
- cp -f src/data.github.js src/data.js
14-
- sed -i -e 's+"homepage".*$+"homepage": "https://stegschreck.github.io",+g' package.json
14+
- ../scripts/adjust_homepage.sh "https://stegschreck.github.io"
1515
- npm run build
1616
after_script:
1717
- codacy-coverage < coverage/lcov.info

DEPLOY_ON_UBERSPACE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ In order to deploy UberPage to Uberspace, you will have to perform the following
3333
3434
source ~/.bash_profile
3535
36-
pushd ~/AngularCV
36+
pushd ~/uberpage/uberpage
3737
3838
git co -- . # ignore local changes
3939
git pull # get the new stuff
4040
npm install # install changes made to package.json
41-
sed -i -e 's#"homepage".*$#"homepage": "<YOUR_DOMAIN>",#g' package.json # add domain where this is deployed, e.g. https://example.com
41+
../scripts/adjust_homepage.sh "<YOUR_DOMAIN>" # add domain where this is deployed, e.g. https://example.com
4242
npm run build # build the app for production environment
4343
rm -rf ~/html/*
4444
cp -r build/* ~/html/

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ phases:
1616
build:
1717
commands:
1818
- echo Build started on `date`
19-
- sed -i -e 's+"homepage".*$+"homepage": "https://uberpage.schreck.berlin",+g' package.json
19+
- ../scripts/adjust_homepage.sh "https://uberpage.schreck.berlin"
2020
- npm run build
2121
post_build:
2222
commands:

scripts/adjust_homepage.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
HOMEPAGE=$1
4+
echo "setting homepage ${HOMEPAGE}"
5+
6+
sed -i "s#\"homepage\".*\$#\"homepage\": \"${HOMEPAGE}\",#g" package.json

uberpage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "AGPL-3.0-or-later",
55
"author": "Sebastian Schreck",
66
"private": true,
7-
"homepage": "https://stegchreck.github.io",
7+
"homepage": "asd",
88
"dependencies": {
99
"react": "^16.8.6",
1010
"react-dom": "^16.8.6",

0 commit comments

Comments
 (0)