- VirtualBox 5
- Vagrant
- This repo
- Clone this repo
cd energydata.info
git submodule update --init --recursive
- Copy
development.ini.sample
todevelopment.ini
- Change variables in development.ini:
- beaker.session.secret
- app.instance.uuid
- ckanext.s3.*
- Configure smtp for email
- Start the VM with
vagrant up
vagrant ssh
to ssh into the VM.- Fix the permissions:
sudo usermod -aG docker $(whoami) && newgrp docker
(this should be done by build_box.sh, but currently fails) source venv/bin/activate
which will allow you to use the datacats commandcd /vagrant
datacats init
to initialize the environment and choose an admin password
- In the repo directory
vagrant up
. - Point your web browser to 192.168.101.99 (the address of the VM)
- Modifications to the CSS & templates will be reloaded automatically using vagrant sync. Adding templates or changing configuration files will not cause a server restart, check the next section to restart the server
If you're adding new templates or new functionality to CKAN, you might need to restart the CKAN server.
vagrant ssh
to ssh into the VMsource venv/bin/activate
which will allow you to use the datacats commandcd /vagrant
(this is the synced folder with the git repo)./reload-server.sh
to reload the server
Less is compiled in the local machine, not vagrant. The resulting styles should be committed to the repo.
- Node (v4.2.x) & Npm (nvm usage is advised)
The versions mentioned are the ones used during development. It could work with newer ones.
After these basic requirements are met, run the following commands in the website's folder:
npm install
npm run less-watch
Starts the watcher and recompiles when files change.
This assumes a base OS of Ubuntu 16.04
- Clone this repo on the target machine
- Follow the instructions in
build-box/build_box.sh
, changingvagrant
to this repository's source directory - Copy
development.ini.sample
todevelopment.ini
- Change variables in development.ini:
- beaker.session.secret
- app.instance.uuid
- ckanext.s3.*
- Configure smtp for email
cd wbg-energydata
datacats init
and choose an admin passworddatacats reload
datacats paster -d celeryd
- For HTTPS, install Let's Encrypt and uncomment the HTTPS section of the nginx configuration
To deploy a new iteration of the data platform to the production environment, follow these steps:
- ssh into the machine
cd wbg-energydata
git checkout master
git pull origin master
- [only if you enable a new plugin]
datacats install
./reload-server.sh
to restart the server
cd wbg-energydata
datacats tweak --add-redis
datacats reload
cd ckanext-harvest
datacats paster harvester initdb
datacats paster -d harvester gather_consumer
datacats paster -d harvester fetch_consumer
cd wbg-energydata/ckanext-harvest
datacats paster harvester source energy-gis-arcgis http://data.energy-gis.opendata.arcgis.com/data.json dcat-json "Energy Sector GIS Working Group" true energy-sector-gis-working-group
datacats paster harvester job-all
to create and run a harvest job