Skip to content

Commit

Permalink
Add CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
marcogschmidt committed Aug 13, 2019
1 parent 57df20f commit a747279
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 6 deletions.
30 changes: 27 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
#----------------------------------------------------------------------------------
# Compare dependencies against GlooE
#----------------------------------------------------------------------------------
GLOOE_VERSION=dev
# Export all variables to sub-makes
export

GLOOE_VERSION=0.18.6
BUILD_ID := $(BUILD_ID)
RELEASE := "true"
ifeq ($(TAGGED_VERSION),)
TAGGED_VERSION := v$(BUILD_ID)
RELEASE := "false"
endif
VERSION ?= $(shell echo $(TAGGED_VERSION) | cut -c 2-)

.PHONY: compare-deps
compare-deps: Gopkg.lock GlooE-Gopkg.lock
compare-deps: Gopkg.lock GlooE-Gopkg.lock print-info
go run scripts/compare_dependencies.go Gopkg.lock GlooE-Gopkg.lock

GlooE-Gopkg.lock:
curl -o GlooE-Gopkg.lock http://storage.googleapis.com/gloo-ee-dependencies/$(GLOOE_VERSION)/Gopkg.lock
curl -o GlooE-Gopkg.lock http://storage.googleapis.com/gloo-ee-dependencies/$(GLOOE_VERSION)/Gopkg.lock

# TODO: remove
.PHONY: print-info
print-info:
@echo BUILD_ID: $(BUILD_ID)
@echo TAGGED_VERSION: $(TAGGED_VERSION)
@echo VERSION: $(VERSION)
@echo RELEASE: $(RELEASE)

#----------------------------------------------------------------------------------
# Build and publish example plugin implementations
#----------------------------------------------------------------------------------
publish-example-plugins:
$(MAKE) -C examples
25 changes: 25 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
steps:
# Using dep container from github.com/solo-io/cloud-builders/dep
# This copies files into the proper workspace layout and so must be run before other tasks
# Subsequent steps should set GOPATH variable to avoid setting up unnecessary sym link
- name: 'gcr.io/$PROJECT_ID/dep'
args: ['ensure']
id: 'dep'
env:
- 'PROJECT_ROOT=github.com/solo-io/ext-auth-plugins'

- name: 'gcr.io/$PROJECT_ID/go-make:0.1.13' &make
args: ['compare-deps']
env: &envs
- 'PROJECT_ROOT=github.com/solo-io/ext-auth-plugins'
- 'GOPATH=/workspace/gopath'
- 'TAGGED_VERSION=$TAG_NAME'
- 'BUILD_ID=$BUILD_ID'
dir: './gopath/src/github.com/solo-io/ext-auth-plugins' &dir
id: 'compare-dependencies'

- name: *make
args: ['publish-example-plugins']
env: *envs
dir: *dir
id: 'publish-examples'
5 changes: 2 additions & 3 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
#----------------------------------------------------------------------------------
REPO_ROOT=./..
SOURCES=$(shell find . -name "*.go" | grep -v test)
TAG := test-plugin-1

.PHONY: publish-examples
publish-examples: test-examples
cd $(REPO_ROOT) && docker build -t quay.io/solo-io/ext-auth-plugins:$(TAG) .
docker push quay.io/solo-io/ext-auth-plugins:$(TAG)
cd $(REPO_ROOT) && docker build -t quay.io/solo-io/ext-auth-plugins:$(VERSION) .
docker push quay.io/solo-io/ext-auth-plugins:$(VERSION)

.PHONY: test-examples
test-examples: build-examples-for-tests
Expand Down
2 changes: 2 additions & 0 deletions solo-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gcloud:
projectId: solo-public

0 comments on commit a747279

Please sign in to comment.