<commit_before># Installation Production

### Puppet
```sh
# Become root
$ sudo -i or su -

$ apt-get update && apt-get upgrade
$ apt-get install puppet curl

# Install iot module
$ puppet module install maasch-iot_provisioning

# Create manifest for current node (masterless puppet)
$ vi /etc/puppet/manifests/site.pp
```

#### Content of site.pp
```puppet
node default {
  class { 'iot_provisioning':
          system_username => 'iot',
          system_user_home => '/home/iot',
          iot_repo => 'https://github.com/TomWieschalla/Masterprojekt-WS15-16-MMI-IoT.git',
          iot_repo_clone_dir => '/home/iot/iot-app',      
        }
}
```

```bash
# Apply the manifest to current node
$ puppet apply /etc/puppet/manifests/site.pp
```

### NodeJS

TODO: 

### Build WAR

```bash
$ sudo su - ${{system_username}} or su - ${{system_username}}
$ cd ${{iot_repo_clone_dir}}/iot-backend
$ cp ./docs/resources/example-application-production.properties \
  ./iot-friss/src/main/resources/application-production.properties

# ADVICE
# -----------------
# Change credentials in application-production.properties
# -----------------
```

```bash
$ cd ${{iot_repo_clone_dir}}/iot-backend
$ ./gradlew :iot-friss:war
```
The WAR archive is resided in ./iot-friss/build/libs.
This directory is mounted as a data volume to the Tomcat Docker container.

### Docker
```bash
$ sudo su - ${{system_username}} or su - ${{system_username}}
$ cd ${{iot_repo_clone_dir}}/iot-infrastructure

# ADVICE
# -----------------
# - Change credentials in docker-compose-production.yml and tomcat-users.xml
# - If ${{iot_repo_clone_dir}} was changed, please change paths
#   in docker-compose.prod.yml (nodejs -> build, tomcat -> volumes)
# -----------------

# Start all containers
$ docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

# Stop all containers
$ docker-compose stop

```
<commit_msg>update another README<commit_after># Installation Production

### Puppet
```sh
# Become root
$ sudo -i or su -

$ apt-get update && apt-get upgrade
$ apt-get install puppet curl

# Install iot module
$ puppet module install maasch-iot_provisioning

# Create manifest for current node (masterless puppet)
$ vi /etc/puppet/manifests/site.pp
```

#### Content of site.pp
```puppet
node default {
  class { 'iot_provisioning':
          system_username => 'iot',
          system_user_home => '/home/iot',
          iot_repo => 'https://github.com/TomWieschalla/Masterprojekt-WS15-16-MMI-IoT.git',
          iot_repo_clone_dir => '/home/iot/iot-app',      
        }
}
```

```bash
# Apply the manifest to current node
$ puppet apply /etc/puppet/manifests/site.pp
```

### NodeJS

In `iot-frontend/build/` is an example credentials file `example_aws_config.json`. If you need to add aws credentials for using the cloud add a `aws_config.json` file with you credentials. If you save them in this file your credentials will not be uploaded to git.

### Build WAR

```bash
$ sudo su - ${{system_username}} or su - ${{system_username}}
$ cd ${{iot_repo_clone_dir}}/iot-backend
$ cp ./docs/resources/example-application-production.properties \
  ./iot-friss/src/main/resources/application-production.properties

# ADVICE
# -----------------
# Change credentials in application-production.properties
# -----------------
```

```bash
$ cd ${{iot_repo_clone_dir}}/iot-backend
$ ./gradlew :iot-friss:war
```
The WAR archive is resided in ./iot-friss/build/libs.
This directory is mounted as a data volume to the Tomcat Docker container.

### Docker
```bash
$ sudo su - ${{system_username}} or su - ${{system_username}}
$ cd ${{iot_repo_clone_dir}}/iot-infrastructure

# ADVICE
# -----------------
# - Change credentials in docker-compose-production.yml and tomcat-users.xml
# - If ${{iot_repo_clone_dir}} was changed, please change paths
#   in docker-compose.prod.yml (nodejs -> build, tomcat -> volumes)
# -----------------

# Start all containers
$ docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

# Stop all containers
$ docker-compose stop

```

{'fraction_non_alphanumeric': 0.1660908193484699, 'fraction_numerical': 0.0019743336623889436, 'mean_word_length': 3.204356846473029, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '545619', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1258, 'n_words': 346}