Skip to content

Commit

Permalink
build: Adds deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed Feb 7, 2022
1 parent 6c3b681 commit a792cac
Show file tree
Hide file tree
Showing 5 changed files with 1,160 additions and 1,280 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/deployment/www

# misc
.DS_Store
Expand Down
13 changes: 13 additions & 0 deletions deployment/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
runtime: python27
api_version: 1
threadsafe: true

handlers:

- url: /(.*\.(gif|png|jpg|js|html|css|json|txt|ico|svg))$
static_files: www/\1
upload: www/.*\.(gif|png|jpg|js|html|css|json|txt|ico|svg)$

- url: /(.*)
static_files: www/index.html
upload: www/index.html
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@testing-library/react": "12.1.2",
"@testing-library/user-event": "13.5.0",
"@tezwell/michelson-sdk": "0.4.1",
"@tezwell/smartts-sdk": "0.1.20",
"@tezwell/smartts-sdk": "0.2.0",
"@types/jest": "27.4.0",
"@types/node": "17.0.13",
"@types/react": "17.0.38",
Expand Down Expand Up @@ -59,7 +59,8 @@
"test": "craco --max_old_space_size=4096 test",
"eject": "react-scripts eject",
"prettier:fix": "prettier --write 'src/**/*.{ts,tsx}'",
"lint:fix": "eslint '*/**/*.{ts,tsx}' --quiet --fix"
"lint:fix": "eslint '*/**/*.{ts,tsx}' --quiet --fix",
"deploy": "bash scripts/deploy.sh"
},
"jest": {
"testMatch": [
Expand Down
16 changes: 16 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -o pipefail

if [ ! -d "build" ] || [ "$1" == "--with-build" ];
then
echo "Building frontend..."
yarn build
fi

rm -rf deployment/www
cp -r build deployment/www
cd deployment

# Deploy
gcloud app deploy --project visualtez
Loading

0 comments on commit a792cac

Please sign in to comment.