Bonde Client app depends on the host name to decide how to behave, considering this you should setup a wildcard DNS domain on the development environment.
Or you could simple add to your /etc/hosts the following names:
127.0.0.1 app.bonde.devel bonde.devel api.bonde.devel data.bonde.devel db.devel keyval.devel meurio.bonde.org
$ git --version
git version 2.7.4
$ docker -v
Docker version 17.07.0-ce-rc1-mac21 (18848), build 9f75bcddf8
$ docker-compose -v
docker-compose version 1.15.0, build e12f3b9
# Install
sh <(curl -s https://raw.githubusercontent.com/nossas/bonde-install/master/install.sh)
# Uninstall
sh <(curl -s https://raw.githubusercontent.com/nossas/bonde-install/master/uninstall.sh)
Images from services used by BONDE ecosystem must be downloaded at the first time container start.
mkdir code/ && cd code/
git clone [email protected]:nossas/bonde-client.git
cd bonde-client
touch .env # fill env vars
docker-compose up -d # download, build and start containers
docker-compose exec api-v1 rake db:migrate # sync db
docker-compose exec api-v1 rake db:seed # fill db
docker-compose restart api-v2 # refresh graphql cache schema
docker-compose run client yarn install # fill volume with node_modules
docker-compose logs client -f # Show logs from container nodejs
docker-compose exec client /bin/bash # Open bash inside frontend container
docker-compose exec api-v2 /bin/bash # Open bash inside ruby container
docker-compose up --build # Force build from images
If you need to rebuild node-sass:
docker-compose exec client npm rebuild node-sass
To cleanup all volumes, images and containers run:
docker rmi $(docker images -a -q)
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
docker volume rm $(docker volume ls -f dangling=true -q)
And you are done!
export DSN_SRC=postgres://postgres:3x4mpl3@localhost:5432/bonde
export DSN_DEST=postgres://postgres:3x4mpl3@localhost:5432/bonde
./tools/restore-db.sh
npm install
npm start
And you are done!
As simples as:
npm run test
Now sit and relax.
If you want to test a single file you can temporarily change the first line of webpack.test.config.js to:
var context = require.context('./app/scripts/tests', true, /MyComponentTest\.jsx/);
We have now two environments, staging and production, hosted by Heroku. All you have to do is to push changes to the master branch of these Heroku repositories, and it will be automatically deployed.
Add staging and production environments into your list of remote repos:
git remote add dokku dokku@server:0-client
git remote add dokku-prod dokku@server:0-client
Commit your changes to the desired environment:
git push dokku commithash:master
git push dokku-prod commithash:master
docker pull nossas/bonde-client:latest