forked from fossasia/query-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add .dockerignore and .editorconfig (fossasia#238)
- Loading branch information
1 parent
3a6e85a
commit 2ec4259
Showing
6 changed files
with
163 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.git | ||
.dockerignore | ||
|
||
##################### | ||
# .gitignore copied | ||
##################### | ||
|
||
.cache/* | ||
__pycache__/* | ||
node_modules/* | ||
.coverage | ||
.idea/* | ||
*.pyc | ||
*.py.bak | ||
*.swp | ||
app/static/bower_components/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.html] | ||
indent_size = 4 | ||
|
||
[*.js] | ||
indent_size = 4 | ||
|
||
[*.css] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Docker | ||
|
||
[](https://cloud.docker.com/stack/deploy/?repo=https://github.com/fossasia/query-server) | ||
|
||
* Get the latest version of docker. See the [offical site](https://docs.docker.com/engine/installation/) for installation info for your platform. | ||
|
||
* Install the latest version of docker-compose. Windows and Mac users should have docker-compose by default as it is part of Docker toolbox. For Linux users, see the | ||
[official guide](https://docs.docker.com/compose/install/). | ||
|
||
* Run `docker` and in terminal to see if they are properly installed. | ||
|
||
* Clone the project and cd into it. | ||
|
||
```bash | ||
git clone https://github.com/fossasia/query-server.git && cd query-server | ||
``` | ||
|
||
* In the terminal window, run `docker build -t query-server:latest` to build badgeyay's docker image. This process can take some time. | ||
|
||
* After build is done, run `docker run -d -p 7001:7001 query-server` to start the server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Heroku | ||
|
||
One-click Heroku deployment is available: | ||
|
||
[](https://heroku.com/deploy?template=https://github.com/fossasia/query-server) | ||
|
||
### Steps for Manual Deployment | ||
|
||
* We need to install heroku on our machine. Type the following in your linux terminal: | ||
* ```wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh``` | ||
This installs the Heroku Toolbelt on your machine to access heroku from the command line. | ||
* Next we need to login to our heroku server (assuming that you have already created an account). Type the following in the terminal: | ||
* ```heroku login``` | ||
* Enter your credentials and login. | ||
* Once logged in we need to create a space on the heroku server for our application. This is done with the following command | ||
* ```heroku create``` | ||
* Add nodejs build pack to the app | ||
* ```heroku buildpacks:add --index 1 heroku/nodejs``` | ||
* Add python build pack to the app | ||
* ```heroku buildpacks:add --index 2 heroku/python``` | ||
* Check nodejs and python build pack in the app | ||
* ```heroku buildpacks``` | ||
It should return | ||
|
||
> 1. heroku/nodejs | ||
> 2. heroku/python | ||
* Then we deploy the code to heroku. | ||
* ```git push heroku master``` or | ||
* ```git push heroku yourbranch:master``` if you are in a different branch than master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Local Development Setup | ||
|
||
The instructions on this page will guide you in setting up a local development environment in your system. | ||
|
||
For a start, fork Query-Server to your own github account. Then, clone it to your local system. | ||
|
||
```sh | ||
git clone -b master https://github.com/<your_username>/query-server.git | ||
``` | ||
|
||
Add an upstream remote so that you can push your patched branches for starting a PR . | ||
|
||
```sh | ||
cd query-server | ||
git remote add upstream https://github.com/fossasia/query-server.git | ||
``` | ||
|
||
Make sure you have [Nodejs](https://nodejs.org/en/) installed. | ||
Running this tool requires installing the nodejs as well as python dependencies. | ||
|
||
``` | ||
npm install -g bower | ||
bower install | ||
pip install -r requirements.txt | ||
``` | ||
|
||
To set up MongoDB on your server : | ||
|
||
```bash | ||
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | ||
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | ||
sudo apt-get update | ||
sudo apt-get install -y mongodb-org | ||
sudo service mongod start | ||
``` | ||
|
||
To run the project on a local machine. | ||
|
||
```sh | ||
python app/server.py | ||
``` | ||
|
||
## Preferred Development Workflow | ||
|
||
1. Get the latest copy of code from upstream. | ||
|
||
```sh | ||
git pull upstream master | ||
``` | ||
|
||
2. Once you get assigned an issue, create a new branch from `master`. | ||
|
||
```sh | ||
git checkout -b XXX-mock-issue # XXX is the issue number | ||
``` | ||
|
||
3. Work on your patch, test it and when it's done, push it to your fork. | ||
|
||
```sh | ||
git push origin XXX-mock-issue | ||
``` | ||
|
||
4. File a PR and wait for the maintainers to suggest reviews or in the best case | ||
merge the PR. Then just update `master` of your local clone. | ||
|
||
```sh | ||
git pull upstream master | ||
``` | ||
|
||
And then loop back again. For contribution guidelines, refer [here](https://github.com/fossasia/query-server/blob/master/.github/CONTRIBUTING.md) |