<commit_before># Contributing

## Requirements

- [VirtualBox 5](http://virtualbox.org)
- [Vagrant](https://www.vagrantup.com/)
- This repo

## Development

1. Clone this repo
2. Copy `development.ini.sample` to `development.ini`
3. In the repo directory `vagrant up`. This will download the VM built for this project and start the CKAN instance
4. Point your web browser to 192.168.101.99 (the address of the VM)
5. 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

## Restarting the server

If you're adding new templates or new functionality to CKAN, you might need to restart the CKAN server.

1. `vagrant ssh` to ssh into the VM
2. `source venv/bin/activate` which will allow you to use the datacats command
3. `cd /vagrant` (this is the synced folder with the git repo)
4. `datacats reload` to reload the server

## Styles (Less)

Less is compiled in the local machine, not vagrant.
The resulting styles should be committed to the repo.
 
#### Requirements

- Node (v4.2.x) & Npm ([nvm](https://github.com/creationix/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
```

#### Watch for changes

```
npm run less-watch
```
Starts the watcher and recompiles when files change.<commit_msg>Deploy instructions to readme<commit_after># Contributing

## Requirements

- [VirtualBox 5](http://virtualbox.org)
- [Vagrant](https://www.vagrantup.com/)
- This repo

## Development

1. Clone this repo
2. Copy `development.ini.sample` to `development.ini`
3. In the repo directory `vagrant up`. This will download the VM built for this project and start the CKAN instance
4. Point your web browser to 192.168.101.99 (the address of the VM)
5. 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

## Restarting the server

If you're adding new templates or new functionality to CKAN, you might need to restart the CKAN server.

1. `vagrant ssh` to ssh into the VM
2. `source venv/bin/activate` which will allow you to use the datacats command
3. `cd /vagrant` (this is the synced folder with the git repo)
4. `datacats reload` to reload the server

## Styles (Less)

Less is compiled in the local machine, not vagrant.
The resulting styles should be committed to the repo.
 
#### Requirements

- Node (v4.2.x) & Npm ([nvm](https://github.com/creationix/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
```

#### Watch for changes

```
npm run less-watch
```
Starts the watcher and recompiles when files change.


## Deploy instructions
To deploy a new version of the data platform to the production environment, follow these steps:

1. ssh into the machine
2. `cd wbg-energydata`
3. `git checkout master`
4. `git pull origin master`
5. [only if you enable a new plugin] `datacats install`
6. `datacats reload -p`
7. `datacats paster -d celeryd`
{'fraction_non_alphanumeric': 0.08240794856808883, 'fraction_numerical': 0.015488018702513151, 'mean_word_length': 4.170694864048339, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '437493', 'n_tokens_mistral': 1036, 'n_tokens_neox': 968, 'n_words': 490}