fix: [CI SKIP] Converting various files to the same basic format.

This commit is contained in:
James Wells 2021-06-03 16:15:26 -07:00
parent 8f8ac47155
commit 0cf7f36f17
Signed by: jwells
GPG key ID: 73196D10B8E65666
9 changed files with 129 additions and 132 deletions

View file

@ -4,78 +4,78 @@ type: docker
name: validation
platform:
arch: amd64
arch: amd64
clone:
depth: 1
depth: 1
volumes:
- name: dockersock
host:
path: /run/docker.sock
- name: dockersock
host:
path: /run/docker.sock
steps:
- name: Notify Datadog That We Are Starting
image: masci/drone-datadog
settings:
api_key:
from_secret: Datadog
events:
- title: "Begin Build: ${DRONE_REPO}"
text: "Build ${DRONE_BUILD_NUMBER}(${DRONE_COMMIT_LINK})"
alert_type: "info"
- name: Notify Datadog That We Are Starting
image: masci/drone-datadog
settings:
api_key:
from_secret: Datadog
events:
- title: "Begin Build: ${DRONE_REPO}"
text: "Build ${DRONE_BUILD_NUMBER}(${DRONE_COMMIT_LINK})"
alert_type: "info"
- name: Validate code base and dependencies
image: dragonheim/golang:1.16.4
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
TRIVY_QUIET: true
TRIVY_LIGHT: true
TRIVY_FORMAT: table
TRIVY_IGNORE_UNFIXED: true
TRIVY_NO_PROGRESS: true
commands:
### Populate temporary container with tools / files we will need for building and testing
- apk add --no-cache zeromq-dev zeromq
# - curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.18.2
- name: Validate code base and dependencies
image: dragonheim/golang:1.16.4
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
TRIVY_QUIET: true
TRIVY_LIGHT: true
TRIVY_FORMAT: table
TRIVY_IGNORE_UNFIXED: true
TRIVY_NO_PROGRESS: true
commands:
### Populate temporary container with tools / files we will need for building and testing
- apk add --no-cache zeromq-dev zeromq
# - curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.18.2
### Format the go code. Go does not care about it, but it helps to ensure everything is formated the same.
- go fmt ./...
### Format the go code. Go does not care about it, but it helps to ensure everything is formated the same.
- go fmt ./...
### Perform a basic lint of the code, we do this after formatting, just in case there are edge cases with the formatting.
- go vet ./...
### Perform a basic lint of the code, we do this after formatting, just in case there are edge cases with the formatting.
- go vet ./...
### Run a security check and warn us about lower level vulnerabilities
- trivy fs --exit-code 0 --severity UNKNOWN,LOW,MEDIUM .
### Run a security check and warn us about lower level vulnerabilities
- trivy fs --exit-code 0 --severity UNKNOWN,LOW,MEDIUM .
### Re-run the scan, but this time looking for higher level vulnerabilities that we want to block for.
- trivy fs --skip-update --exit-code 1 --severity CRITICAL,HIGH .
### Re-run the scan, but this time looking for higher level vulnerabilities that we want to block for.
- trivy fs --skip-update --exit-code 1 --severity CRITICAL,HIGH .
### Perform unit tests
# - @TODO I really don't know how to do unit tests. Will need to figure this out eventually.
### Perform unit tests
# - @TODO I really don't know how to do unit tests. Will need to figure this out eventually.
### Build test container.
# - docker buildx build --platform linux/arm/v7,linux/amd64,linux/arm64 --progress plain -t ${DRONE_REPO}:${DRONE_COMMIT} -f docker/Dockerfile .
- docker buildx build --platform linux/amd64 --progress plain -t ${DRONE_REPO}:${DRONE_COMMIT} -f docker/Dockerfile .
### Build test container.
# - docker buildx build --platform linux/arm/v7,linux/amd64,linux/arm64 --progress plain -t ${DRONE_REPO}:${DRONE_COMMIT} -f docker/Dockerfile .
- docker buildx build --platform linux/amd64 --progress plain -t ${DRONE_REPO}:${DRONE_COMMIT} -f docker/Dockerfile .
### Run a security check and warn us about lower level vulnerabilities
- trivy image --skip-update --exit-code 0 --severity UNKNOWN,LOW,MEDIUM,HIGH ${DRONE_REPO}:${DRONE_COMMIT}
### Run a security check and warn us about lower level vulnerabilities
- trivy image --skip-update --exit-code 0 --severity UNKNOWN,LOW,MEDIUM,HIGH ${DRONE_REPO}:${DRONE_COMMIT}
### Re-run the scan, but this time looking for critical vulnerabilities that we want to block for.
- trivy image --skip-update --exit-code 1 --severity CRITICAL ${DRONE_REPO}:${DRONE_COMMIT}
### Re-run the scan, but this time looking for critical vulnerabilities that we want to block for.
- trivy image --skip-update --exit-code 1 --severity CRITICAL ${DRONE_REPO}:${DRONE_COMMIT}
- name: Notify Datadog That We Have Completed
image: masci/drone-datadog
settings:
api_key:
from_secret: Datadog
events:
- title: "Build failure on amd64"
text: "Build ${DRONE_BUILD_NUMBER}"
alert_type: "error"
when:
status:
- failure
- name: Notify Datadog That We Have Completed
image: masci/drone-datadog
settings:
api_key:
from_secret: Datadog
events:
- title: "Build failure on amd64"
text: "Build ${DRONE_BUILD_NUMBER}"
alert_type: "error"
when:
status:
- failure

View file

@ -5,9 +5,6 @@ import (
"unicode/utf8"
)
/*
* ptESC is @TODO
*/
const (
ptESC = iota
ptSTR

View file

@ -1,9 +1,9 @@
provider "aws" {
alias = "us-west-2"
region = "us-west-2"
alias = "us-west-2"
region = "us-west-2"
}
provider "aws" {
alias = "us-east-1"
region = "us-east-1"
alias = "us-east-1"
region = "us-east-1"
}

View file

@ -1,38 +1,38 @@
# variable "vpc_id" {}
data "aws_vpc" "selected" {
id = var.vpc_id
id = var.vpc_id
}
variable "regional_cidr_blocks" {
description = "A simple map of subnets used by region"
type = map
default = {
"us-west-2a-private" = "10.172.64.0/23",
"us-west-2b-private" = "10.172.66.0/23",
"us-west-2a-public" = "10.172.68.0/26",
"us-west-2b-public" = "10.172.68.64/26",
"us-east-1a-private" = "10.172.0.0/23",
"us-east-1b-private" = "10.172.2.0/23",
"us-east-1a-public" = "10.172.4.0/26",
"us-east-1b-public" = "10.172.4.64/26"
}
description = "A simple map of subnets used by region"
type = map
default = {
"us-west-2a-private" = "10.172.64.0/23",
"us-west-2b-private" = "10.172.66.0/23",
"us-west-2a-public" = "10.172.68.0/26",
"us-west-2b-public" = "10.172.68.64/26",
"us-east-1a-private" = "10.172.0.0/23",
"us-east-1b-private" = "10.172.2.0/23",
"us-east-1a-public" = "10.172.4.0/26",
"us-east-1b-public" = "10.172.4.64/26"
}
}
resource "aws_subnet" "aza-private" {
depends_on = [data.aws_vpc.selected]
vpc_id = data.aws_vpc.id
availability_zone = format("%sa", var.region)
cidr_block = var.regional_cidr_blocks[
format("%sa-private", var.region)
]
tags = merge(
var.extra_tags,
{
Name = "aza-private"
tier = "private"
}
)
depends_on = [data.aws_vpc.selected]
vpc_id = data.aws_vpc.id
availability_zone = format("%sa", var.region)
cidr_block = var.regional_cidr_blocks[
format("%sa-private", var.region)
]
tags = merge(
var.extra_tags,
{
Name = "aza-private"
tier = "private"
}
)
}
# resource "aws_subnet" "aza-public" {

View file

@ -1,9 +1,9 @@
variable "extra_tags" {
description = "Tags required on all resources"
type = map
default = {
"org" = "dragonheim"
"service" = "gagent"
"maintained_by" = "jwells@dragonheim.net"
}
description = "Tags required on all resources"
type = map
default = {
"org" = "dragonheim"
"service" = "gagent"
"maintained_by" = "jwells@dragonheim.net"
}
}

View file

@ -2,22 +2,22 @@ variable "region" {}
variable "provider_alias" {}
variable "regional_vpc_cidr" {
description = "A simple map of VPC subnets used by region"
type = map
default = {
"us-west-2" = "10.172.64.0/19",
"us-east-1" = "10.172.0.0/19",
}
description = "A simple map of VPC subnets used by region"
type = map
default = {
"us-west-2" = "10.172.64.0/19",
"us-east-1" = "10.172.0.0/19",
}
}
resource "aws_vpc" "gagent" {
instance_tenancy = "default"
enable_dns_support = true
cidr_block = var.regional_vpc_cidr[var.region]
tags = merge(
var.extra_tags,
{
Name = "gagent"
}
)
instance_tenancy = "default"
enable_dns_support = true
cidr_block = var.regional_vpc_cidr[var.region]
tags = merge(
var.extra_tags,
{
Name = "gagent"
}
)
}

View file

@ -1,18 +1,18 @@
# main.tf
module "us-east-1" {
source = "./cluster"
region = "us-east-1"
provider_alias = us-west-2
providers = {
aws = "aws.us-east-1"
}
source = "./cluster"
region = "us-east-1"
provider_alias = us-west-2
providers = {
aws = "aws.us-east-1"
}
}
module "us-west-2" {
source = "./cluster"
region = "us-west-2"
provider_alias = us-west-2
providers = {
aws = "aws.us-west-2"
}
source = "./cluster"
region = "us-west-2"
provider_alias = us-west-2
providers = {
aws = "aws.us-west-2"
}
}

View file

@ -1,9 +1,9 @@
terraform {
required_version = ">= 0.15.3"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.42.0"
}
}
required_version = ">= 0.15.3"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.42.0"
}
}
}