Copyright 2018 Milieu Cities && Project Collaborators
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Current stage site and production site
-
Clone the repository to your local machine:
git clone https://github.com/Milieucities/m-server. -
Bundle the gemfile
bundle install. Note you may have to install bundlergem install bundler. -
Download and start up a postgressql. Best way to install it
brew install postgresqlAsk for.envfiles ask fordatabase.ymlfile.envgoes to the root folderdatabase.ymlgoes to/configAccordingly to database.yml you'll need to create user mainly postgrespsqlCREATE USER postgres;ALTER USER postgres with SUPERUSER; -
Set up your
config/database.ymlto configure with postgres and runrake db:create db:migrate db:seedand if you just want to reset databaserake db:resetit should run all commands above with db:drop as first. if you have any problems with database that doesn't exist, you should be able to see error in terminal of rails saying what DB name is missing based on that create one by running:CREATE DATABASE missingName -
(good to have) Download and start up a redis with this being said -> sooon moving to Docker is must have
-
Install node packages
npm install. -
You're done! You have 2 options to run you development environment 1: is more encouraged to use to see what's going on
npm startin one tab of terminal,rails sin another one 2: these 2 commands below bundles everything from point above in 1 commandforeman startorheroku local
Typically localhost:3000 or if nothing works try http://127.0.0.1:3000/
and you good, man or lady !
#. SYNCING AND SEEDING DEV_SITES if you need to ->
Run the rake sync_devsites to get some devsites. Whenever you feel the devsites are enough,
run Ctrl+C(even more times)to stop the process. Now you're ready to start developing!
for more syncing options run rake -T
Application's stylesheets are located in/app/assets/stylesheets
if you open application.scss you'll see what's being imported to the whole app in base folder you see base styles being used
-
Install Docker on Mac, Linux or Windows 10 (Windows 7, 8 installation is pretty complex)
-
Clone the repository to your local machine:
git clone https://github.com/Milieucities/m-server. -
Set up your
.envandconfig/database.yml. See the .example file as the example. -
Go to your local repository directory and build docker image:
docker-compose build. -
Start with
docker-compose up. -
Open another terminal to run
docker-compose run web rake db:create&docker-compose run web rake db:migrate&docker-compose run web rake db:seed
- Merge master into staging:
git push origin master:staging - Deploy with capistrano:
cap staging deploy
- Merge master into production:
git push origin master:production - SSH into production server:
ssh rails@cities.milieu.io - Log in as the root user:
su - - Go the to m-server directory:
cd /home/rails/m-server - Pull the production code:
git pull origin production - Migrate:
rake db:migrate - Compile the node code:
npm start - Compile all the assets:
rake assets:precompile - Restart unicorn:
service unicorn restart
- SSH into remote server
- Run rake task to sync dev sites from CSV file:
rake sync_devsites_from_csv['example_filename.csv'] - The file should be the most recent CSV file, in the
lib/fixturesdirectory