Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
typeofweb committed Oct 3, 2018
1 parent e82d2c0 commit 2c3ac1f
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 58 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.log
/public/
/server/*.js
/server/*.map
.version
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
staging:master:f5a8bcaf0216d79d171229c1295bdb77025cfe10
4 changes: 2 additions & 2 deletions components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default class Layout extends React.Component<LayoutProps> {
return (
<React.Fragment>
<Head>
<title key="title">Fefaq.pl &bull; {title}</title>
<title key="title">Fefaq.pl {title}</title>
<meta key="description" name="description" content={description} />
<meta property="og:title" itemProp="title name" content={`Fefaq.pl &bull; ${title}`} />
<meta property="og:title" itemProp="title name" content={`Fefaq.pl ${title}`} />
<meta property="og:description" itemProp="description" content={description} />
</Head>
<div className="app-root">
Expand Down
15 changes: 0 additions & 15 deletions deploy-production.sh

This file was deleted.

15 changes: 0 additions & 15 deletions deploy-staging.sh

This file was deleted.

29 changes: 29 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -e

DIR=`dirname $0`


if [[ "$1" == "production" ]]; then
SUBDOMAIN="app"
elif [[ "$1" == "staging" ]]; then
SUBDOMAIN="staging"
else
echo 'Incorrect environment. "production" or "staging" allowed.'
exit 1
fi

ENVIRONMENT=$1

echo $ENVIRONMENT:`git rev-parse --abbrev-ref HEAD`:`git rev-parse HEAD` > .version
echo "🥁 VERSION: " `cat .version`

echo "👉 Building…"
NODE_ENV=$ENVIRONMENT npm run build
echo "👉 Cleaning"
ssh sinpai@s18.mydevil.net SUBDOMAIN=$SUBDOMAIN 'bash -s' < $DIR/ssh-script-clean.sh
echo "👉 Uploading…"
rsync -avP -e ssh --exclude=node_modules --exclude=".git" --include="**/.*" ./ sinpai@s18.mydevil.net:/home/sinpai/domains/$SUBDOMAIN.fefaq.pl/public_nodejs/
echo "👉 Installing…"
ssh sinpai@s18.mydevil.net SUBDOMAIN=$SUBDOMAIN 'bash -s' < $DIR/ssh-script-deploy.sh
echo "👉 Done! 😎"
7 changes: 0 additions & 7 deletions ssh-script-clean-staging.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ssh-script-clean-production.sh → ssh-script-clean.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

cd /home/sinpai/domains/staging.fefaq.pl/public_nodejs
cd /home/sinpai/domains/$SUBDOMAIN.fefaq.pl/public_nodejs
echo "👉 Cleaning"
rm -rf .next
rm -rf public
9 changes: 0 additions & 9 deletions ssh-script-deploy-production.sh

This file was deleted.

9 changes: 0 additions & 9 deletions ssh-script-deploy-staging.sh

This file was deleted.

9 changes: 9 additions & 0 deletions ssh-script-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

cd /home/sinpai/domains/$SUBDOMAIN.fefaq.pl/public_nodejs
npm i -f
echo "👉 Restarting…"
devil www restart $SUBDOMAIN.fefaq.pl
echo "👉 Fetching…"
curl -I https://$SUBDOMAIN.fefaq.pl/

0 comments on commit 2c3ac1f

Please sign in to comment.