<commit_before># HP4T

## Usage

Usage:

    hp4t <command> [options]

Commands:

- `provision <app_name>` - provision app_name
- `pipeline` - provision pipeline
- `deploy <app_name>` - deploy to app_name
- `promote <app_name>` - promote from app
- `run <command>` - run command on Heroku
- `local <command>` - run command locally
- `setup` - initialize project
- `export <app_name>` - export Heroku app configuration

Options:

- `--branch <branch_name>` - deploy only from a specific branch
- `--tags` - deploy only from tags
- `--slug <slug_name>` - deploy only from specific repository slug

## Configuration

File: `.hp4t.yaml`, format YAML.

Example:

    deployment:
    - slug: wojtekk/hp4t
    - branch: master
    infrastructure:
    - dir: infrastructure/
<commit_msg>Example configuration<commit_after># HP4T

## Usage

Usage:

    hp4t <command> [options]

Commands:

- `provision <env_name>` - provision app_name
- `provision-pipeline` - provision pipeline
- `deploy <env_name>` - deploy to app_name
- `promote <env_name>` - promote from app
- `run <env_name> <command>` - run command on Heroku
- `local <command>` - run command locally
- `setup` - initialize project
- `export <env_name>` - export Heroku app configuration

Options:

- `--branch <branch_name>` - deploy only from a specific branch
- `--tags` - deploy only from tags
- `--slug <slug_name>` - deploy only from specific repository slug

### Example `.travis.yml` flow

Trunk base development:

```yaml
install:
- npm install
- alias hp4t="$(npm bin)/hp4t"
before_script:
npm test
hp4t provision-pipeline
hp4t provision stage
hp4t run stage "migrate database"
hp4t deploy stage
hp4t provision production
hp4t promote stage # to production
hp4t run production "migrate database"
after_success:
- hp4t notify rollbar
notifications:
- hp4t notify slack
```

With feature branch:

```yaml
install:
- npm install
- alias hp4t="$(npm bin)/hp4t"
before_script:
npm test
hp4t provision-pipeline
hp4t provision stage
hp4t run stage "migrate database"
hp4t deploy stage
hp4t provision production
hp4t promote stage # to production
hp4t run production "migrate database"
hp4t deploy featureX --branch featureX
after_success:
- hp4t notify rollbar
notifications:
- hp4t notify slack
```

Continuous delivery (deploy on tag):

```yaml
install:
- npm install
- alias hp4t="$(npm bin)/hp4t"
before_script:
- npm test
- hp4t provision-pipeline
- hp4t provision stage --branch develop
- hp4t run stage "migrate database" --branch develop
- hp4t deploy stage --branch develop
- hp4t provision production --tags --branch master
- hp4t deploy production --tags # to production
- hp4t run production "migrate database" --tags --branch master
- hp4t deploy featureX --branch featureX
after_success:
- hp4t notify rollbar
notifications:
- hp4t notify slack
```

## Configuration

File: `.hp4t.yaml`, format YAML.

Example:

```yaml
infrastructure:
- dir: infrastructure/
environments:
  defaults:
  - slug: wojtekk/hp4t
  - branch: master
  stage:
  - app: app_name-stage
  - branch: develop
  - tags: false
  production:
  - app: app_name
  - branch: master
  - tags: true
```
{'fraction_non_alphanumeric': 0.11015325670498084, 'fraction_numerical': 0.013729246487867178, 'mean_word_length': 3.84984520123839, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7260568', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1024, 'n_words': 349}