diff --git a/Dockerfile b/Dockerfile index 115af12..1c07d4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ARG REPO=github.com/fydrah/loginapp RUN apk add --no-cache git build-base COPY . /go/src/${REPO} WORKDIR /go/src/${REPO} -RUN make go_build_static +RUN make FROM scratch ARG REPO=github.com/fydrah/loginapp diff --git a/Makefile b/Makefile index 8041a04..cdcabd8 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ # Dirs BUILDDIR := build CMDDIR := cmd +TESTDIR := test # Git GIT_REPOSITORY := github.com/fydrah/loginapp GIT_COMMIT_ID := $(shell git log -n 1 --pretty=format:%h) -GIT_TAG := $(shell git describe --tags) +GIT_TAG := $(shell git describe --tags --exclude="chart-*") # Go GOFLAGS := @@ -23,51 +24,58 @@ all: go_build .PHONY: go_packr2 go_packr2: - # Go: install packr2 + @echo "[Go] install packr2" @which packr2 >/dev/null || go install github.com/gobuffalo/packr/v2/packr2@$(PACKR_VERSION) @# packr2 still requires GO111MODULE var - # Go: run packr2 (embded assets) + @echo "[Go] run packr2 (embded assets)" @packr2 clean @GO111MODULE=on packr2 .PHONY: go_fmt go_fmt: - # Go: fmt + @echo "[Go] fmt" @go fmt ./... .PHONY: go_mod_vendor go_mod_vendor: - # Go: vendor + @echo "[Go] vendor" @go mod vendor .PHONY: go_build go_build: go_mod_vendor go_packr2 - # Go: build - CGO_ENABLED=0 go build -mod=vendor -o $(BUILDDIR)/loginapp $(GOFLAGS) -ldflags '$(LDFLAGS)' $(GIT_REPOSITORY) + @echo "[Go] build" + @CGO_ENABLED=0 go build -mod=vendor -o $(BUILDDIR)/loginapp $(GOFLAGS) -ldflags '$(LDFLAGS)' $(GIT_REPOSITORY) .PHONY: docker_build docker_build: - # Docker: build image + @echo "[Docker] build image" @$(DOCKER_BUILD) -t $(DOCKER_REPOSITORY):$(GIT_COMMIT_ID) .PHONY: docker_push docker_push: docker_build - # Docker: push image + @echo "[Docker] push image" @$(DOCKER_BIN) push $(DOCKER_REPOSITORY):$(GIT_COMMIT_ID) .PHONY: helm_doc helm_doc: - # Helm: doc + @echo "[Helm] doc" @chart-doc-gen -d docs/chart.yaml -v=helm/loginapp/values.yaml > ./helm/loginapp/README.md .PHONY: helm_package helm_package: helm_doc - # Helm: package chart + @echo "[Helm] package chart" @helm package -u helm/loginapp -d $(BUILDDIR) .PHONY: clean clean: - # Clean: binaries + @echo "[Clean] binaries" @rm -f $(BUILDDIR)/loginapp @rm -f $(BUILDDIR)/loginapp-*.tgz @rm -f $(BUILDDIR)/index.yaml + +.PHONY: clean_test +clean_test: + @echo "[Clean] dev env" + @rm -rf $(TESTDIR)/generated + @rm -rf $(TESTDIR)/kubernetes/generated + @rm -rf $(TESTDIR)/helm/generated diff --git a/docs/chart.yaml b/docs/chart.yaml index 94096ff..2579fe0 100644 --- a/docs/chart.yaml +++ b/docs/chart.yaml @@ -4,8 +4,8 @@ project: url: https://github.com/fydrah/loginapp description: OIDC authentication helper for Kubernetes repository: - url: https://charts.fydrah.com - name: fydrah-stable + url: https://loginapp-releases.storage.googleapis.com/charts/ + name: loginapp chart: name: loginapp values: "-- generate from values file --" diff --git a/helm/loginapp/Chart.yaml b/helm/loginapp/Chart.yaml index fce0351..fddad46 100644 --- a/helm/loginapp/Chart.yaml +++ b/helm/loginapp/Chart.yaml @@ -14,7 +14,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: v1.2.1 +version: v1.2.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/helm/loginapp/README.md b/helm/loginapp/README.md index f266eea..b8766df 100644 --- a/helm/loginapp/README.md +++ b/helm/loginapp/README.md @@ -5,9 +5,9 @@ ## TL;DR; ```console -$ helm repo add fydrah-stable https://charts.fydrah.com +$ helm repo add loginapp https://loginapp-releases.storage.googleapis.com/charts/ $ helm repo update -$ helm install loginapp fydrah-stable/loginapp -n auth +$ helm install loginapp loginapp/loginapp -n auth ``` ## Introduction @@ -28,7 +28,7 @@ This chart deploys on a [Kubernetes](http://kubernetes.io) cluster using the [H To install the chart with the release name `loginapp`: ```console -$ helm install loginapp fydrah-stable/loginapp -n auth +$ helm install loginapp loginapp/loginapp -n auth ``` The command deploys on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. @@ -98,12 +98,12 @@ The following table lists the configurable parameters of the `loginapp` chart an Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: ```console -$ helm install loginapp fydrah-stable/loginapp -n auth --set replicas=1 +$ helm install loginapp loginapp/loginapp -n auth --set replicas=1 ``` Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example: ```console -$ helm install loginapp fydrah-stable/loginapp -n auth --values values.yaml +$ helm install loginapp loginapp/loginapp -n auth --values values.yaml ```