Skip to content

Commit

Permalink
Merge pull request #35 from mineiros-io/soerenmartius/add-terraform-0…
Browse files Browse the repository at this point in the history
…-15-support

feat: add support for Terraform v0.15
  • Loading branch information
soerenmartius authored May 22, 2021
2 parents e431582 + c8e7112 commit 0e285c4
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 22 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: CI/CD Pipeline

on: push
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
pre-commit:
Expand Down
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
repos:
- repo: https://github.com/mineiros-io/pre-commit-hooks
rev: v0.2.2
rev: v0.2.3
hooks:
- id: terraform-fmt
- id: terraform-validate
exclude: ^examples|.terraform/
- id: tflint
- id: gofmt
- id: goimports
- id: golangci-lint
- id: phony-targets
- id: markdown-link-check
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.5.0]

### Added

- feat: add support for Terraform `v0.15`

### Changed

- feat: upgrade pre-commit hooks to `v0.2.3`
- build: upgrade build-tools hooks to `v0.11.0`

### Fixed

- Preserve case of user names added to teams in plan output
Expand Down Expand Up @@ -94,11 +105,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- markdown-link-check-disable -->

[unreleased]: https://github.com/mineiros-io/terraform-github-team/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/mineiros-io/terraform-github-team/compare/v0.3.1...v0.4.0
[unreleased]: https://github.com/mineiros-io/terraform-github-team/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/mineiros-io/terraform-github-team/compare/v0.4.0...v0.5.0

<!-- markdown-link-check-enable -->

[0.4.0]: https://github.com/mineiros-io/terraform-github-team/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/mineiros-io/terraform-github-team/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/mineiros-io/terraform-github-team/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/mineiros-io/terraform-github-team/compare/v0.1.3...v0.2.0
Expand Down
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# Set default shell to bash
SHELL := /bin/bash -o pipefail

BUILD_TOOLS_VERSION ?= v0.7.0
BUILD_TOOLS_VERSION ?= v0.11.0
BUILD_TOOLS_DOCKER_REPO ?= mineiros/build-tools
BUILD_TOOLS_DOCKER_IMAGE ?= ${BUILD_TOOLS_DOCKER_REPO}:${BUILD_TOOLS_VERSION}

# If running in CI (e.g. GitHub Actions)
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
#
# Some CI providers such as GitHub Actions, CircleCI, and TravisCI are setting
# the CI environment variable to a non-empty value by default to indicate that
# the current workflow is running in a Continuous Integration environment.
#
# If TF_IN_AUTOMATION is set to any non-empty value, Terraform adjusts its
# output to avoid suggesting specific commands to run next.
# To disable TF_IN_AUTOMATION in CI set it to empty
# https://www.terraform.io/docs/commands/environment-variables.html#tf_in_automation
#
# We are using GNU style quiet commands to disable set V to non-empty e.g. V=1
# https://www.gnu.org/software/automake/manual/html_node/Debugging-Make-Rules.html
#
ifdef CI
TF_IN_AUTOMATION ?= 1
export TF_IN_AUTOMATION
Expand All @@ -31,10 +27,15 @@ ifndef NOCOLOR
RESET := $(shell tput -Txterm sgr0)
endif

# We are creating docker volumes for /go and /terraform that are unique per
# repository to reuse dependencies between different docker run commands.
VOLUME_PREFIX ?= mineiros_build_tools
VOLUME_SUFFIX ?= $(notdir $(shell git rev-parse --show-toplevel || "build"))
DOCKER_RUN_FLAGS += -v ${VOLUME_PREFIX}-terraform-${VOLUME_SUFFIX}:/terraform
DOCKER_RUN_FLAGS += -v ${VOLUME_PREFIX}-go-${VOLUME_SUFFIX}:/go
DOCKER_RUN_FLAGS += -v ${PWD}:/build
DOCKER_RUN_FLAGS += --rm
DOCKER_RUN_FLAGS += -v ${PWD}:/app/src
DOCKER_RUN_FLAGS += -e TF_IN_AUTOMATION
DOCKER_RUN_FLAGS += -e USER_UID=$(shell id -u)

DOCKER_GITHUB_FLAGS += -e GITHUB_TOKEN
DOCKER_GITHUB_FLAGS += -e GITHUB_ORGANIZATION
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

A [Terraform] module that offers a more convenient and tested way to provision and manage [GitHub teams].

**_This module supports Terraform v0.13 as well as v0.12.9 and above
**_This module supports Terraform v0.15, v0.14, v0.13 as well as v0.12.9 and above
and is compatible with the Terraform Github Provider v4, v3 as well as v2.4 and above._**

- [Features](#features)
Expand Down Expand Up @@ -47,7 +47,7 @@ This module supports the following resources:
```hcl
module "team" {
source = "mineiros-io/team/github"
version = "~> 0.4.0"
version = "~> 0.5.0"
name = "DevOps"
description = "The DevOps Team"
Expand Down Expand Up @@ -210,7 +210,7 @@ Copyright &copy; 2020 [Mineiros GmbH][homepage]
[badge-build]: https://github.com/mineiros-io/terraform-github-team/workflows/CI/CD%20Pipeline/badge.svg
[badge-semver]: https://img.shields.io/github/v/tag/mineiros-io/terraform-github-team.svg?label=latest&sort=semver
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.15%20|0.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[build-status]: https://github.com/mineiros-io/terraform-github-team/actions
[releases-github]: https://github.com/mineiros-io/terraform-github-team/releases
Expand Down
4 changes: 2 additions & 2 deletions examples/github-team/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and push permissions to the other.
```hcl
module "team" {
source = "mineiros-io/team/github"
version = "~> 0.4.0"
version = "~> 0.5.0"
name = "Engineering"
description = "This team is created with terraform to test the terraformn-github-repository module."
Expand All @@ -39,7 +39,7 @@ module "team" {
module "child_team" {
source = "mineiros-io/team/github"
version = "~> 0.4.0"
version = "~> 0.5.0"
name = "DevOps"
parent_team_id = module.team.id
Expand Down
4 changes: 2 additions & 2 deletions examples/github-team/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "github_repository" "another_repository" {

module "team" {
source = "mineiros-io/team/github"
version = "~> 0.4.0"
version = "~> 0.5.0"

name = "Engineering"
description = "This team is created with terraform to test the terraformn-github-repository module."
Expand All @@ -59,7 +59,7 @@ module "team" {

module "child_team" {
source = "mineiros-io/team/github"
version = "~> 0.4.0"
version = "~> 0.5.0"

name = "DevOps"
parent_team_id = module.team.id
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ---------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12.20, < 0.15"
required_version = ">= 0.12.20, < 0.16"

required_providers {
github = ">= 2.4, < 5.0"
Expand Down

0 comments on commit 0e285c4

Please sign in to comment.