From 2f57e9f1feb845a6161226d7a2bd2f8d8a79bdd8 Mon Sep 17 00:00:00 2001 From: kianjones4 <45982651+kianjones4@users.noreply.github.com> Date: Tue, 20 Aug 2019 15:18:03 -0700 Subject: [PATCH 1/5] Add semaphore.yml --- .semaphore/semaphore.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .semaphore/semaphore.yml diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml new file mode 100644 index 00000000..47c6a842 --- /dev/null +++ b/.semaphore/semaphore.yml @@ -0,0 +1,18 @@ +# For more Go information and examples, see +# https://docs.semaphoreci.com/article/86-language-golang +version: v1.0 +name: Hello Semaphore +agent: + machine: + type: e1-standard-2 + os_image: ubuntu1804 +blocks: + - name: Golang example + task: + jobs: + - name: Run Go + commands: + - go version + # Uncomment the following line to pull your code, + # then proceed by adding your custom commands: + #- checkout From c2d4314a356d08dcd080873082d8313affcc1487 Mon Sep 17 00:00:00 2001 From: kjones16 Date: Tue, 20 Aug 2019 16:07:02 -0700 Subject: [PATCH 2/5] build --- .semaphore/semaphore.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 47c6a842..d8f6ae43 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -15,4 +15,5 @@ blocks: - go version # Uncomment the following line to pull your code, # then proceed by adding your custom commands: - #- checkout + - checkout + - ls From 0fefd87dbdeda1464755ba9de70818d064891df6 Mon Sep 17 00:00:00 2001 From: kjones16 Date: Tue, 20 Aug 2019 16:12:54 -0700 Subject: [PATCH 3/5] build --- .semaphore/semaphore.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index d8f6ae43..d002d6f9 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -9,11 +9,15 @@ agent: blocks: - name: Golang example task: + prologue: + commands: + - checkout jobs: - - name: Run Go - commands: - - go version - # Uncomment the following line to pull your code, - # then proceed by adding your custom commands: - - checkout - - ls + # - name: Run Go + # commands: + # - go version + # # Uncomment the following line to pull your code, + # # then proceed by adding your custom commands: + # - checkout + # - ls + - make docker-test From f6c63c1fa1d4994b2deae69ebf0ec316f3ca0517 Mon Sep 17 00:00:00 2001 From: kjones16 Date: Tue, 27 Aug 2019 12:03:24 -0700 Subject: [PATCH 4/5] squashed commits --- .semaphore/semaphore.yml | 43 ++++++++++++++++++++++++++++++---------- .semaphore/setup.sh | 13 ++++++++++++ Makefile | 3 +++ README.md | 1 + 4 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 .semaphore/setup.sh diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index d002d6f9..2ea9d47b 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -1,23 +1,44 @@ # For more Go information and examples, see # https://docs.semaphoreci.com/article/86-language-golang version: v1.0 -name: Hello Semaphore +name: Upgrade Manager agent: machine: type: e1-standard-2 - os_image: ubuntu1804 + # os_image: ubuntu1804 + containers: + - name: main + image: semaphoreci/golang:1.12.9 blocks: - - name: Golang example + - name: Setup + task: + jobs: + - name: Setup + commands: + - checkout + - source .semaphore/setup.sh + - ls -l /packages + + - name: Build task: prologue: commands: + - cache restore $SEMAPHORE_PROJECT_NAME-dep + - ls -l /packages + - pushd /packages + - sudo tar -xvf go1.12.7.linux-amd64.tar.gz + - sudo cp go/bin/go /usr/local/bin + - sudo rm -rf /usr/local/go + - sudo mv go /usr/local + - export os=$(go env GOOS) + - export arch=$(go env GOARCH) + - tar -xzvf kubebuilder_master_${os}_${arch}.tar.gz + - sudo mv kubebuilder_master_${os}_${arch} /usr/local/kubebuilder + - ls /usr/local/kubebuilder + - export PATH=$PATH:/usr/local/kubebuilder/bin + - popd - checkout jobs: - # - name: Run Go - # commands: - # - go version - # # Uncomment the following line to pull your code, - # # then proceed by adding your custom commands: - # - checkout - # - ls - - make docker-test + - name: Docker Build + commands: + - make docker-build diff --git a/.semaphore/setup.sh b/.semaphore/setup.sh new file mode 100644 index 00000000..38e9efb0 --- /dev/null +++ b/.semaphore/setup.sh @@ -0,0 +1,13 @@ +cache restore $SEMAPHORE_PROJECT_NAME-dep + +if [ ! -d '/packages' ]; then + sudo mkdir -p /packages + wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz + sudo mv go1.12.7.linux-amd64.tar.gz /packages + export os=$(go env GOOS) + export arch=$(go env GOARCH) + curl -sL https://go.kubebuilder.io/dl/latest/${os}/${arch} -o kubebuilder_master_${os}_${arch}.tar.gz + sudo mv kubebuilder_master_${os}_${arch}.tar.gz /packages + ls -l /packages + cache store $SEMAPHORE_PROJECT_NAME-dep /packages +fi diff --git a/Makefile b/Makefile index da44ddbc..2e23febf 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ vet: # Generate code generate: controller-gen + $(CONTROLLER_GEN) --help $(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/... # Build the docker image @@ -59,6 +60,8 @@ docker-push: # download controller-gen if necessary controller-gen: ifeq (, $(shell which controller-gen)) + export GO111MODULE=off # https://stackoverflow.com/questions/54415733/getting-gopath-error-go-cannot-use-pathversion-syntax-in-gopath-mode-in-ubun + go clean -modcache go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0-beta.2 CONTROLLER_GEN=$(shell go env GOPATH)/bin/controller-gen else diff --git a/README.md b/README.md index 6f4385e1..b85f157c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # RollingUpgrades +[![Build Status](https://semaphoreci.com/api/v1/kianjones4/upgrade-manager/branches/master/badge.svg)](https://semaphoreci.com/kianjones4/upgrade-manager) > Reliable, extensible rolling-upgrades of Autoscaling groups in Kubernetes RollingUpgrades provides a Kubernetes native mechanism for doing rolling-updates of instances in an AutoScaling group using a CRD and a controller. From 5019188887786addc05db02be271455f4510318b Mon Sep 17 00:00:00 2001 From: kjones16 Date: Fri, 30 Aug 2019 10:26:16 -0700 Subject: [PATCH 5/5] remove badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ffdb1827..7b282ce2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # RollingUpgrades -[![Build Status](https://semaphoreci.com/api/v1/kianjones4/upgrade-manager/branches/master/badge.svg)](https://semaphoreci.com/kianjones4/upgrade-manager) > Reliable, extensible rolling-upgrades of Autoscaling groups in Kubernetes RollingUpgrades provides a Kubernetes native mechanism for doing rolling-updates of instances in an AutoScaling group using a CRD and a controller.