Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
SkypLabs committed Nov 10, 2021
2 parents f9fa677 + 2d61828 commit 45dfa50
Show file tree
Hide file tree
Showing 15 changed files with 355 additions and 234 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Test

on:
- push
- pull_request

jobs:
test-code:
name: Test code
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

- name: Terraform Format
id: fmt
run: terraform fmt -check
continue-on-error: true

- name: Terraform Init
id: init
run: terraform init

- name: Terraform Validate
id: validate
run: terraform validate -no-color

- name: Terraform Plan
id: plan
if: github.event_name == 'pull_request'
run: terraform plan -no-color
continue-on-error: true

- uses: actions/github-script@v4
if: github.event_name == 'pull_request'
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outputs.stdout }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${process.env.PLAN}
\`\`\`
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- name: Terraform Plan Status
if: github.plan.outcome == 'failure'
run: exit 1

- name: Terraform Apply
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: terraform apply -auto-approve
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: dafe42560ace053a00e5902931972ba9f28b7d5c # frozen: v1.32.0
rev: c9cbd72913fb54f73ae56a958793b8493505000b # frozen: v1.56.0
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand Down
23 changes: 23 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Changelog

## v0.6.0 - Nov 10, 2021

### Changes

* Add `Test` GitHub Actions workflow
* Upgrade OVH provider to version 0.16
* Upgrade Terraform pre-commit hooks to v1.56.0
* Change file hierarchy

## v0.5.0 - Aug 22, 2020

### Changes
Expand Down
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,37 @@ This module follows the [standard structure][standard-module-structure] describe

| Name | Version |
|------|---------|
| terraform | >= 0.13.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
| <a name="requirement_ovh"></a> [ovh](#requirement\_ovh) | ~> 0.16 |

## Providers

No provider.
No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_dns_records"></a> [dns\_records](#module\_dns\_records) | ./modules/ovh-dns | n/a |

## Resources

No resources.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| ovh\_application\_key | The OVH API application key | `string` | `null` | no |
| ovh\_application\_secret | The OVH API application secret | `string` | `null` | no |
| ovh\_consumer\_key | The OVH API consumer key | `string` | `null` | no |
| ovh\_endpoint | Specify which API endpoint to use | `string` | n/a | yes |
| <a name="input_ovh_application_key"></a> [ovh\_application\_key](#input\_ovh\_application\_key) | The OVH API application key | `string` | `null` | no |
| <a name="input_ovh_application_secret"></a> [ovh\_application\_secret](#input\_ovh\_application\_secret) | The OVH API application secret | `string` | `null` | no |
| <a name="input_ovh_consumer_key"></a> [ovh\_consumer\_key](#input\_ovh\_consumer\_key) | The OVH API consumer key | `string` | `null` | no |
| <a name="input_ovh_endpoint"></a> [ovh\_endpoint](#input\_ovh\_endpoint) | Specify which API endpoint to use | `string` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| records | DNS records |

| <a name="output_records"></a> [records](#output\_records) | DNS records |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

[standard-module-structure]: https://www.terraform.io/docs/modules/index.html#standard-module-structure "Terraform Documentation - Standard Module Structure"
Expand Down
150 changes: 0 additions & 150 deletions dns-records.tf

This file was deleted.

Loading

0 comments on commit 45dfa50

Please sign in to comment.