Skip to content

Commit

Permalink
chore: Update travis workflow and other CI/CD files
Browse files Browse the repository at this point in the history
  • Loading branch information
kbalk committed Jul 21, 2021
1 parent e32aca5 commit 347f62d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 123 deletions.
11 changes: 0 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ tab_width = 4
[*.md]
trim_trailing_whitespace = false

[*.py]
indent_size = 4

[go.mod]
indent_style = tab
indent_size = 1

[*.go]
indent_style = tab
indent_size = 1

[Makefile]
indent_style = tab
indent_size = 1
Expand Down
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
# .tfvars files
*.tfvars

# ignore this file
!tfmodule-template.tf

# tardigrade-ci
tardigrade-ci/
.tardigrade-ci

# eclint

.git/
# terraform lock file
.terraform.lock.hcl

# terratest
tests/git.*
# Cache created by pytest
tests/__pycache__/
28 changes: 22 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
dist: bionic
dist: focal

language: node_js

node_js:
- "12"
language: minimal

stages:
- lint
- test
- deploy

if: branch = master OR type = pull_request

before_install:
- tmpdaemon=$(mktemp)
- sudo jq '."registry-mirrors" += ["https://mirror.gcr.io"]' /etc/docker/daemon.json > "$tmpdaemon"
- sudo mv "$tmpdaemon" /etc/docker/daemon.json
- sudo systemctl daemon-reload
- sudo systemctl restart docker
- docker system info

jobs:
include:
- stage: lint
name: Project Syntax Verification
script: make && make docker/run target=lint
script: make docker/run target=lint
- stage: test
name: Apply Terraform test configs in mockstack
install:
- make docker-compose/install
- make mockstack/up
script: make mockstack/pytest
after_script:
- make mockstack/clean
- stage: deploy
if: branch = master AND type = push AND repo = plus3it/terraform-aws-tardigrade-ebs-encryption
before_script:
Expand Down
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
FROM plus3it/tardigrade-ci:0.14.0

WORKDIR /ci-harness
ENTRYPOINT ["make"]
FROM plus3it/tardigrade-ci:0.15.0
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SHELL := /bin/bash

-include $(shell curl -sSL -o .tardigrade-ci "https://raw.githubusercontent.com/plus3it/tardigrade-ci/master/bootstrap/Makefile.bootstrap"; echo .tardigrade-ci)
include $(shell test -f .tardigrade-ci || curl -sSL -o .tardigrade-ci "https://raw.githubusercontent.com/plus3it/tardigrade-ci/master/bootstrap/Makefile.bootstrap"; echo .tardigrade-ci)
9 changes: 2 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
##### LOCALS #####
locals {
# kms integration
kms_key_id = var.create_kms_key ? module.kms.keys[var.kms_key_alias].arn : ""
kms_key_policy = var.create_kms_key && var.kms_key_policy == null ? join("", data.aws_iam_policy_document.this.*.json) : var.kms_key_policy
kms_key_id = module.kms.keys[var.kms_key_alias].arn
kms_key_policy = var.kms_key_policy == null ? join("", data.aws_iam_policy_document.this.*.json) : var.kms_key_policy

keys = [
{
Expand All @@ -18,7 +18,6 @@ locals {
module "kms" {
source = "git::https://github.com/plus3it/terraform-aws-tardigrade-kms.git?ref=2.0.0"

create_keys = var.create_kms_key
keys = local.keys
}

Expand All @@ -27,8 +26,6 @@ resource "aws_ebs_encryption_by_default" "this" {
}

resource "aws_ebs_default_kms_key" "this" {
count = var.create_kms_key ? 1 : 0

key_arn = local.kms_key_id
}

Expand All @@ -40,8 +37,6 @@ data "aws_caller_identity" "this" {}
data "aws_partition" "this" {}

data "aws_iam_policy_document" "this" {
count = var.create_kms_key ? 1 : 0

statement {
sid = "Allow access through EBS for all principals in the account that are authorized to use EBS"
actions = [
Expand Down
6 changes: 0 additions & 6 deletions tests/create_ebs_encryption/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
provider "aws" {
region = "us-east-1"
}

module "create_ebs_encryption" {
source = "../../"

create_kms_key = true
}
5 changes: 0 additions & 5 deletions tests/key_policy/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
provider "aws" {
region = "us-east-1"
}

module "create_ebs_encryption" {
source = "../../"

create_kms_key = true
kms_key_policy = data.aws_iam_policy_document.this.json
}

Expand Down
66 changes: 0 additions & 66 deletions tests/module_test.go

This file was deleted.

9 changes: 0 additions & 9 deletions tests/no_kms_key/main.tf

This file was deleted.

0 comments on commit 347f62d

Please sign in to comment.