Skip to content

Upgrade deployment api #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/groovy
@Library('github.com/stakater/fabric8-pipeline-library@v2.10.8')
#!/usr/bin/env groovy
@Library('github.com/stakater/stakater-pipeline-library@v2.16.15') _

def dummy

goBuildAndRelease {
goBuildViaGoReleaser {
publicChartRepositoryURL = 'https://stakater.github.io/stakater-charts'
publicChartGitURL = '[email protected]:stakater/stakater-charts.git'
}
}
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ VERSION=$(shell cat .version)
BUILD=

GOCMD = go
GLIDECMD = glide
GOFLAGS ?= $(GOFLAGS:)
LDFLAGS =

default: build test

install:
"$(GLIDECMD)" install
"$(GOCMD)" mod download

build:
"$(GOCMD)" build ${GOFLAGS} ${LDFLAGS} -o "${BINARY}"
Expand Down Expand Up @@ -49,4 +48,4 @@ push: ## push the latest Docker image to DockerHub
apply:
kubectl apply -f deployments/manifests/

deploy: binary-image push apply
deploy: binary-image push apply
4 changes: 2 additions & 2 deletions build/package/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM stakater/go-glide:1.9.3
FROM golang:1.13.1-alpine
MAINTAINER "Stakater Team"

RUN apk update
Expand All @@ -11,7 +11,7 @@ RUN apk -v --update \
ADD . "$GOPATH/src/github.com/stakater/GitWebhookProxy"

RUN cd "$GOPATH/src/github.com/stakater/GitWebhookProxy" && \
glide update && \
go mod download && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a --installsuffix cgo --ldflags="-s" -o /GitWebhookProxy

COPY build/package/Dockerfile.run /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,14 @@ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
{{- end -}}

{{/*
Return the appropriate apiVersion for deployment.
*/}}
{{- define "deployment.apiVersion" -}}
{{- if semverCompare ">=1.9-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "apps/v1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: {{ template "deployment.apiVersion" . }}
kind: Deployment
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion deployments/kubernetes/manifests/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Source: gitwebhookproxy/templates/deployment.yaml
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
Expand Down
10 changes: 0 additions & 10 deletions glide.lock

This file was deleted.

8 changes: 0 additions & 8 deletions glide.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/stakater/GitWebhookProxy

go 1.13

require (
github.com/jarcoal/httpmock v1.0.4
github.com/julienschmidt/httprouter v1.3.0
github.com/namsral/flag v1.7.4-pre
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/jarcoal/httpmock v1.0.4 h1:jp+dy/+nonJE4g4xbVtl9QdrUNbn6/3hDT5R4nDIZnA=
github.com/jarcoal/httpmock v1.0.4/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/namsral/flag v1.7.4-pre h1:b2ScHhoCUkbsq0d2C15Mv+VU8bl8hAXV8arnWiOHNZs=
github.com/namsral/flag v1.7.4-pre/go.mod h1:OXldTctbM6SWH1K899kPZcf65KxJiD7MsceFUpB5yDo=
2 changes: 1 addition & 1 deletion pkg/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"reflect"
"testing"

httpmock "github.com/jarcoal/httpmock"
"github.com/julienschmidt/httprouter"
"github.com/stakater/GitWebhookProxy/pkg/providers"
httpmock "gopkg.in/jarcoal/httpmock.v1"
)

const (
Expand Down