Skip to content

Commit

Permalink
feat: add github/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mamrajyadav committed Dec 12, 2023
1 parent 0a5c65c commit f49103b
Show file tree
Hide file tree
Showing 16 changed files with 146 additions and 187 deletions.
4 changes: 4 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version = 1

[[analyzers]]
name = "terraform"
41 changes: 39 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,52 @@

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 3
assignees:
- "clouddrove-ci"
reviewers:
- "approvers"

- package-ecosystem: "terraform" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
assignees:
- "clouddrove-ci"
# Add reviewer
reviewers:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3

- package-ecosystem: "terraform" # See documentation for possible values
directory: "_example/basic" # Location of package manifests
directory: "/_example/basic" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
assignees:
- "clouddrove-ci"
# Add reviewer
reviewers:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3

- package-ecosystem: "terraform" # See documentation for possible values
directory: "_example/complete" # Location of package manifests
directory: "/_example/complete" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
assignees:
- "clouddrove-ci"
# Add reviewer
reviewers:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3
14 changes: 14 additions & 0 deletions .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign PRs

on:
pull_request:
types: [opened, reopened]

workflow_dispatch:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.8
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
assignees: 'clouddrove-ci'
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- "*"
workflow_dispatch:
jobs:
call-workflow-changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.8
secrets: inherit
with:
branch: 'master'
branch: 'master'
13 changes: 6 additions & 7 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,28 @@ jobs:
uses: actions/checkout@master

- name: 'Set up Python 3.7'
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: 'pre-commit check errors'
uses: pre-commit/action@v2.0.0
uses: pre-commit/action@v3.0.0
continue-on-error: true

- name: 'pre-commit fix erros'
uses: pre-commit/action@v2.0.0
uses: pre-commit/action@v3.0.0
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
continue-on-error: true
with:
actions_subcommand: 'push'
Expand All @@ -51,4 +50,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
30 changes: 0 additions & 30 deletions .github/workflows/semantic-releaser.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/static-checks.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: tf-checks
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
example-basic:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.8
with:
working_directory: './_example/basic/'

example-complete:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.8
with:
working_directory: './_example/complete/'
11 changes: 11 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: tf-lint
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
tf-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.8
secrets:
GITHUB: ${{ secrets.GITHUB }}
4 changes: 2 additions & 2 deletions .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
jobs:
tfsec:
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.8
secrets: inherit
with:
working_directory: '.'
working_directory: '.'
45 changes: 30 additions & 15 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ github_repo: clouddrove/terraform-azure-vnet

# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/Terraform-v1.0.0-green"
url: "https://www.terraform.io"
- name: "Latest Release"
image: "https://img.shields.io/github/release/clouddrove/terraform-azure-vnet.svg"
url: "https://github.com/clouddrove/terraform-azure-vnet/releases/latest"
- name: "tfsec"
image: "https://github.com/clouddrove/terraform-azure-vnet/actions/workflows/tfsec.yml/badge.svg"
url: "https://github.com/clouddrove/terraform-azure-vnet/actions/workflows/tfsec.yml"
- name: "Licence"
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"
Expand All @@ -34,17 +37,29 @@ include:
# How to use this project
# yamllint disable rule:line-length
usage: |-
### Simple Example
Here is an example of how you can use this module in your inventory structure:
### Basic Example
```hcl
module "virtual-network" {
source = "clouddrove/vnet/azure"
name = "app"
environment = "test"
label_order = ["name", "environment"]
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
address_space = "10.0.0.0/16"
enable_network_watcher = false # To be set true when network security group flow logs are to be tracked and network watcher with specific name is to be deployed.
}
```
module "vnet" {
source = "clouddrove/vnet/azure"
name = local.name
environment = local.environment
resource_group_name = "testsg"
location = "NorthEurope"
address_space = "10.0.0.0/16"
enable_network_watcher = false # To be set true when network security group flow logs are to be tracked and network watcher with specific name is to be deployed.
}
```
### Complete Example
```hcl
module "vnet" {
source = "clouddrove/vnet/azure"
name = local.name
environment = local.environment
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
address_space = "10.0.0.0/16"
enable_network_watcher = false # To be set true when network security group flow logs are to be tracked and network watcher with specific name is to be deployed.
}
```
14 changes: 7 additions & 7 deletions _example/basic/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
output "vnet_id" {
description = "The id of the newly created vNet"
value = module.vnet.vnet_id
description = "The id of the newly created vNet"
}

output "vnet_name" {
description = "The name of the newly created vNet"
value = module.vnet.vnet_name
description = "The name of the newly created vNet"
}

output "vnet_location" {
description = "The location of the newly created vNet"
value = module.vnet.vnet_location
description = "The location of the newly created vNet"
}

output "vnet_address_space" {
description = "The address space of the newly created vNet"
value = module.vnet.vnet_address_space
description = "The address space of the newly created vNet"
}

output "vnet_guid" {
description = "The GUID of the virtual network."
value = module.vnet.vnet_guid
description = "The GUID of the virtual network."
}

output "vnet_rg_name" {
description = "The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created."
value = module.vnet.vnet_rg_name
}
description = "The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created."
}
1 change: 1 addition & 0 deletions _example/complete/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ module "vnet" {
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
address_space = "10.0.0.0/16"
enable_ddos_pp = false
enable_network_watcher = false # To be set true when network security group flow logs are to be tracked and network watcher with specific name is to be deployed.
}
Loading

0 comments on commit f49103b

Please sign in to comment.