diff --git a/.circleci/config.yml b/.circleci/config.yml index 4cedf98..0adfcb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: - build: - working_directory: /go/src/github.com/CircleCI-Public/iap_auth + test: + working_directory: /go/src/github.com/gojekfarm/iap_auth docker: - image: circleci/golang:1.11 steps: @@ -26,6 +26,32 @@ jobs: command: | env GO111MODULE=on go mod verify env GO111MODULE=on CGO_ENABLED=0 make + release: + working_directory: /go/src/github.com/gojekfarm/iap_auth + docker: + - image: circleci/golang:1.11 + steps: + - checkout + - setup_remote_docker: + docker_layer_caching: true + - restore_cache: + keys: + - vendor-pkg-{{ checksum "go.sum" }} + - vendor-pkg- + - run: + name: Install Dependencies + command: | + make setup + - save_cache: + paths: + - ./vendor + - "/go/pkg" + key: vendor-pkg-{{ checksum "go.sum" }} + - run: + name: Release go binary + command: | + env GO111MODULE=on CGO_ENABLED=0 make + curl -sL https://git.io/goreleaser | bash - run: name: Docker Build command: | @@ -37,3 +63,12 @@ jobs: TAG=0.1.0-$CIRCLE_SHA1 docker login -u $DOCKER_USER -p $DOCKER_PASS docker push gojektech/iap-auth:$TAG +workflows: + version: 2 + build_and_test: + jobs: + - test + - release: + requires: + - test + diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..487af6d --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,24 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +builds: +- env: + - CGO_ENABLED=0 + - GO111MODULE=on +archive: + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + diff --git a/README.md b/README.md index 448e1b3..82e7157 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # IAP Auth [![CircleCI](https://circleci.com/gh/gojekfarm/iap_auth.svg?style=svg)](https://circleci.com/gh/gojekfarm/iap_auth) ## IAP Enabled Google Load Balancer -IAP: [Identity Aware Proxy] (https://cloud.google.com/iap/) -Read more about IAP here https://cloud.google.com/blog/products/identity-security/protecting-your-cloud-vms-with-cloud-iap-context-aware-access-controls + +IAP: [Identity Aware Proxy](https://cloud.google.com/iap/) + +Read more about IAP [here](https://cloud.google.com/blog/products/identity-security/protecting-your-cloud-vms-with-cloud-iap-context-aware-access-controls) ### TLDR; + 1. Setup an https Google load balancer 2. Enable IAP (Security > Identity Aware Proxy) All eligible proxies will be listed here. IAP toggle will enable Oauth Bearer token based auth.