Skip to content

Commit

Permalink
Merge pull request #28 from GSA/tag_and_release
Browse files Browse the repository at this point in the history
Tag & Release
  • Loading branch information
Brian Fitzwater - IDI-C authored Dec 12, 2019
2 parents 3bbd818 + 52cb4b8 commit 960c647
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ jobs:
- run:
name: Run Unit Tests
command: make test_handler
release_handler:
docker:
- image: circleci/golang:latest
working_directory: /go/src/github.com/GSA/grace-inventory
steps:
- checkout
- run:
name: Release handler
command: make release_handler

workflows:
version: 2
Expand All @@ -53,3 +62,9 @@ workflows:
- validate_terraform
- lint_handler
- test_handler
- release_handler:
filters:
tags:
only: /^v.*/
branches:
only: master
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ download the binary release from Github or compile the handler locally.
```bash
mkdir -p release
cd release
curl -L https://github.com/GSA/grace-inventory/releases/download/v0.1.2/grace-inventory-lambda.zip -o grace-inventory-lambda.zip
curl -L https://github.com/GSA/grace-inventory/releases/download/v0.1.3/grace-inventory-lambda.zip -o grace-inventory-lambda.zip
cd ..
```

Expand Down Expand Up @@ -146,7 +146,7 @@ include the following in your root terraform module:

```
module "example_self" {
source = "github.com/GSA/grace-inventory?ref=v0.1.2"
source = "github.com/GSA/grace-inventory?ref=v0.1.3"
source_file = "../../release/grace-inventory-lambda.zip"
appenv = "environment"
project_name = "your-project"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-master.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// list all accounts and inventory each one using the OrganizationAccessRole
// if accounts_info = ""
module "example_master" {
source = "github.com/GSA/grace-inventory?ref=v0.1.2"
source = "github.com/GSA/grace-inventory?ref=v0.1.3"
accounts_info = ""
source_file = "../../release/grace-inventory-lambda.zip"
appenv = "development"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-mgmt-all.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// if accounts_info = "" and master_account_id and master_role_name are set
// and the roles are assumable by the Lambda function's IAM role
module "example_mgmt_all" {
source = "github.com/GSA/grace-inventory?ref=v0.1.2"
source = "github.com/GSA/grace-inventory?ref=v0.1.3"
accounts_info = ""
master_account_id = "111111111111"
master_role_name = "AssumableRole"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-self.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The default behavior is to inventory only the account the lambda function
// is installed in (i.e. accounts_info = "self"
module "example_self" {
source = "github.com/GSA/grace-inventory?ref=v0.1.2"
source = "github.com/GSA/grace-inventory?ref=v0.1.3"
source_file = "../../release/grace-inventory-lambda.zip"
appenv = "development"
project_name = "grace"
Expand Down
5 changes: 1 addition & 4 deletions handler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ ifeq ($(strip $(GITHUB_TOKEN)),)
else ifeq ($(strip $(CIRCLE_TAG)),)
@echo "CIRCLE_TAG must be set"
@exit 0
else ifeq ($(shell echo $(CIRCLE_TAG) | egrep '^v\d+\.\d+\.\d+'),)
@echo "CIRCLE_TAG must match version pattern (i.e. v.1.2.3)"
@exit 0
else
ghr -t $(GITHUB_TOKEN) -u $(CIRCLE_PROJECT_USERNAME) -r $(CIRCLE_PROJECT_REPONAME) -c $(CIRCLE_SHA1) -delete $(CIRCLE_TAG) $(RELEASEDIR)
ghr -u $(CIRCLE_PROJECT_USERNAME) -r $(CIRCLE_PROJECT_REPONAME) -c $(CIRCLE_SHA1) -delete $(CIRCLE_TAG) $(RELEASEDIR)
endif

clean:
Expand Down

0 comments on commit 960c647

Please sign in to comment.