From a8b3c691fe7d8945b1bed298348a118a40be2e05 Mon Sep 17 00:00:00 2001 From: Don Cote Date: Mon, 1 Jul 2019 09:25:16 -0400 Subject: [PATCH] cleanup --- .gitignore | 2 ++ Makefile | 64 ------------------------------------------------------ README.md | 25 +-------------------- 3 files changed, 3 insertions(+), 88 deletions(-) delete mode 100644 Makefile diff --git a/.gitignore b/.gitignore index f1c181e..08d2c4f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out + +*.DS_Store \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index ebcdd78..0000000 --- a/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -SERVICE ?= go-aws-config -REGISTRY ?= pbxx -COMMIT = $(shell git rev-parse --short HEAD 2>/dev/null) -LDFLAGS ?= -DOCKER_BUILD_ARGS ?= - -.PHONY: help -help: - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - -.PHONY: analyze -analyze: fmt lint vet test ## run fmt, lint, vet, and test - -.PHONY: build -build: build-linux ## run go build for linux - -.PHONY: build-linux -build-linux: - GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o bin/app src/main/*.go - -.PHONY: build-native -build-native: ## run go build for current OS - go build -ldflags "$(LDFLAGS)" -o bin/app src/main/*.go - -.PHONY: docker-build -docker-build: ## build docker image - docker build -t $(REGISTRY)/$(SERVICE):$(COMMIT) $(DOCKER_BUILD_ARGS) . - -.PHONY: fmt -fmt: ## verify all files have been `gofmt`ed. - @gofmt -s -l . | grep -v vendor | tee /dev/stderr - -.PHONY: generate -generate: ## runs go generate to create mocks or any other automatically generated code - go generate ./... - -.PHONY: lint -lint: ## verify `golint` passes. - @golint ./... | grep -v vendor | tee /dev/stderr - -.PHONY: test -test: ## run the go tests. - @go test -v -cover -race $(shell go list ./... | grep -v vendor) - -.PHONY: vendor -vendor: ## starts a docker container with a fresh env to run govendor in - docker run -v $(GOPATH)/src:/go/src/ --name govendor -it --rm govendor-build - -.PHONY: vendor-missing -vendor-missing: ## updates your project to get all missing dependencies - docker run -v $(GOPATH)/src:/go/src/ --name govendor --rm \ - -w /go/src/github.com/FlipsideCrypto/go-aws-config --entrypoint='govendor' \ - -it pbxx/govendor fetch +outside - -.PHONY: vet -vet: ## verify `go vet` passes. - @go vet $(shell go list ./... | grep -v vendor) | tee /dev/stderr - -.PHONY: run -run: ## run the CLI tool - @[ "${env}" ] || ( echo ">> env is not set"; exit 1 ) - @[ "${srv}" ] || ( echo ">> srv is not set"; exit 1 ) - @[ "${file}" ] || ( echo ">> file is not set"; exit 1 ) - @docker run -it -e AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) -e AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) -e AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) -e AWS_REGION=us-east-1 -v $(file):/config.json pbxx/go-aws-config:master-latest -file /config.json -env $(env) -service $(srv) diff --git a/README.md b/README.md index 2cce23c..12fad2c 100644 --- a/README.md +++ b/README.md @@ -30,27 +30,4 @@ someDuration := conf.MustGetDuration("SOME_DURATION") // Parses to time.Duration optionalValue, _ := conf.Get("OPTIONAL_VALUE") // ... -``` - -## CLI Usage - -The CLI allows you to import configuration from JSON to parameter store. You will need a JSON file of configuration. E.G. - -```JSON -{ - "config_key": "value", - "a_boolean_value": true, - "a_duration_value": "1m", - "complex_json": { - "more": "config", - "goes": "here" - } -} -``` - -The above file would result in 4 keys being upserted into parameter store within the `environment/serviceName/` namespace. - -```bash -# this command will load the config from example.json into the namespace for the local environment's example service -aws-vault exec pbxx-dev -- make run env=local srv=example file=$(pwd)/example.json -``` +``` \ No newline at end of file