Merge branch 'fix-deploy' into 'master'
Fix deploy See merge request saburly/gangsta/roraccounting!6
This commit was merged in pull request #6.
This commit is contained in:
19
README.md
19
README.md
@@ -5,10 +5,27 @@
|
|||||||
Install dependencies with `bundle install` and `yarn --cwd client install` (or enter client directory and execute `yarn install`)
|
Install dependencies with `bundle install` and `yarn --cwd client install` (or enter client directory and execute `yarn install`)
|
||||||
|
|
||||||
Build docker image with `docker build -t roraccounting .`
|
Build docker image with `docker build -t roraccounting .`
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
Start docker container with Postgres DB (if not already running) : `yarn run dev-db` or
|
Start docker container with Postgres DB (if not already running) : `yarn run dev-db` or
|
||||||
`docker run --name gangstadb -d -p 5432:5432 -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=roraccounting_development roraccounting`
|
`docker run --name gangstadb -d -p 5432:5432 -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=roraccounting_development roraccounting`
|
||||||
|
|
||||||
Start backend server : `yarn run server` or `PORT=3001 bundle exec rails s`
|
Start backend server : `BASIC_AUTH_USERNAME=user BASIC_AUTH_PASSWORD=pass yarn run server` or `BASIC_AUTH_USERNAME=user BASIC_AUTH_PASSWORD=pass PORT=3001 bundle exec rails s`
|
||||||
|
|
||||||
Start frontend with : `yarn run client` or `PORT=3000 yarn --cwd client start`
|
Start frontend with : `yarn run client` or `PORT=3000 yarn --cwd client start`
|
||||||
|
|
||||||
|
### Note about authentication
|
||||||
|
|
||||||
|
Authentication is currently basic auth, note ENV variables in starting backend server commands! At the moment, loading
|
||||||
|
from .ENV file is not supported
|
||||||
|
|
||||||
|
## Heroku Deploy Procedure
|
||||||
|
|
||||||
|
Add `BASIC_AUTH_USERNAME` and `BASIC_AUTH_PASSWORD` ENV variables to the Heroku.
|
||||||
|
|
||||||
|
Deploy master branch from local repository to the heroku : `git push heroku master` (if heroku is name of the heroku remote)
|
||||||
|
|
||||||
|
(For testing purposes)
|
||||||
|
Deploy non-master branch from local repository to the heroku : `git push heroku other-branch:master`
|
||||||
|
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -3,18 +3,15 @@
|
|||||||
"node": "10.15.3",
|
"node": "10.15.3",
|
||||||
"yarn": "1.15.2"
|
"yarn": "1.15.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
|
||||||
"build": "yarn --cwd client install && yarn --cwd client build",
|
|
||||||
"deploy": "cp -a client/build/. protected_public/",
|
|
||||||
"heroku-postbuild": "yarn build && yarn deploy"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-router-dom": "^5.0.1"
|
"react-router-dom": "^5.0.1"
|
||||||
},
|
},
|
||||||
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev-db": "docker run --name gangstadb -d -p 5432:5432 -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=roraccounting_development roraccounting",
|
"dev-db": "docker run --name gangstadb -d -p 5432:5432 -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=roraccounting_development roraccounting",
|
||||||
"server": "PORT=3001 bundle exec rails s",
|
"server": "PORT=3001 bundle exec rails s",
|
||||||
"client": "PORT=3000 yarn --cwd client start"
|
"client": "PORT=3000 yarn --cwd client start",
|
||||||
|
"build": "yarn --cwd client install && yarn --cwd client build",
|
||||||
|
"deploy": "cp -a client/build/. protected_public/",
|
||||||
|
"heroku-postbuild": "yarn build && yarn deploy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user