diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 1a8077fd6..000000000 --- a/.dockerignore +++ /dev/null @@ -1,13 +0,0 @@ -draft.toml -target/classes -target/generated-sources -target/generated-test-sources -target/maven-archiver -target/maven-status -target/surefire-reports -target/test-classes -target/*.original -charts/ -NOTICE -LICENSE -README.md \ No newline at end of file diff --git a/.helmignore b/.helmignore deleted file mode 100644 index 747e6e94a..000000000 --- a/.helmignore +++ /dev/null @@ -1,27 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -*.png - -# known compile time folders -target/ -node_modules/ -vendor/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index f96718806..000000000 --- a/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM scratch -EXPOSE 8080 -ENTRYPOINT ["/go-demo-6"] -COPY ./bin/ / \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 5dfe2b386..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,78 +0,0 @@ -pipeline { - agent { - label "jenkins-go" - } - environment { - ORG = 'vfarcic' - APP_NAME = 'go-demo-6' - CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum') - } - stages { - stage('CI Build and push snapshot') { - when { - branch 'PR-*' - } - environment { - PREVIEW_VERSION = "0.0.0-SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER" - PREVIEW_NAMESPACE = "$APP_NAME-$BRANCH_NAME".toLowerCase() - HELM_RELEASE = "$PREVIEW_NAMESPACE".toLowerCase() - } - steps { - container('go') { - dir('/home/jenkins/go/src/github.com/vfarcic/go-demo-6') { - checkout scm - sh "make linux" - sh "export VERSION=$PREVIEW_VERSION && skaffold build -f skaffold.yaml" - sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:$PREVIEW_VERSION" - } - dir('/home/jenkins/go/src/github.com/vfarcic/go-demo-6/charts/preview') { - sh "make preview" - sh "jx preview --app $APP_NAME --dir ../.." - } - } - } - } - stage('Build Release') { - when { - branch 'master' - } - steps { - container('go') { - dir('/home/jenkins/go/src/github.com/vfarcic/go-demo-6') { - checkout scm - - // ensure we're not on a detached head - sh "git checkout master" - sh "git config --global credential.helper store" - sh "jx step git credentials" - - // so we can retrieve the version in later steps - sh "echo \$(jx-release-version) > VERSION" - sh "jx step tag --version \$(cat VERSION)" - sh "make build" - sh "export VERSION=`cat VERSION` && skaffold build -f skaffold.yaml" - sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION)" - } - } - } - } - stage('Promote to Environments') { - when { - branch 'master' - } - steps { - container('go') { - dir('/home/jenkins/go/src/github.com/vfarcic/go-demo-6/charts/go-demo-6') { - sh "jx step changelog --version v\$(cat ../../VERSION)" - - // release the helm chart - sh "jx step helm release" - - // promote through all 'Auto' promotion Environments - sh "jx promote -b --all-auto --timeout 1h --version \$(cat ../../VERSION)" - } - } - } - } - } -} diff --git a/Makefile b/Makefile deleted file mode 100644 index 37b34fe23..000000000 --- a/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -SHELL := /bin/bash -GO := GO15VENDOREXPERIMENT=1 go -NAME := go-demo-6 -OS := $(shell uname) -MAIN_GO := main.go -ROOT_PACKAGE := $(GIT_PROVIDER)/vfarcic/$(NAME) -GO_VERSION := $(shell $(GO) version | sed -e 's/^[^0-9.]*\([0-9.]*\).*/\1/') -PACKAGE_DIRS := $(shell $(GO) list ./... | grep -v /vendor/) -PKGS := $(shell go list ./... | grep -v /vendor | grep -v generated) -BUILDFLAGS := '' -CGO_ENABLED = 0 -VENDOR_DIR=vendor - -all: build - -check: fmt build test - -build: - CGO_ENABLED=$(CGO_ENABLED) $(GO) build -ldflags $(BUILDFLAGS) -o bin/$(NAME) $(MAIN_GO) - -test: - CGO_ENABLED=$(CGO_ENABLED) $(GO) test $(PACKAGE_DIRS) -test.v - -full: $(PKGS) - -install: - GOBIN=${GOPATH}/bin $(GO) install -ldflags $(BUILDFLAGS) $(MAIN_GO) - -fmt: - @FORMATTED=`$(GO) fmt $(PACKAGE_DIRS)` - @([[ ! -z "$(FORMATTED)" ]] && printf "Fixed unformatted files:\n$(FORMATTED)") || true - -clean: - rm -rf build release - -linux: - CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 $(GO) build -ldflags $(BUILDFLAGS) -o bin/$(NAME) $(MAIN_GO) - -.PHONY: release clean - -FGT := $(GOPATH)/bin/fgt -$(FGT): - go get github.com/GeertJohan/fgt - -GOLINT := $(GOPATH)/bin/golint -$(GOLINT): - go get github.com/golang/lint/golint - -$(PKGS): $(GOLINT) $(FGT) - @echo "LINTING" - @$(FGT) $(GOLINT) $(GOPATH)/src/$@/*.go - @echo "VETTING" - @go vet -v $@ - @echo "TESTING" - @go test -v $@ - -.PHONY: lint -lint: vendor | $(PKGS) $(GOLINT) # ❷ - @cd $(BASE) && ret=0 && for pkg in $(PKGS); do \ - test -z "$$($(GOLINT) $$pkg | tee /dev/stderr)" || ret=1 ; \ - done ; exit $$ret - diff --git a/OWNERS b/OWNERS deleted file mode 100644 index 11fd3dc6f..000000000 --- a/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -approvers: -- vfarcic -reviewers: -- vfarcic diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES deleted file mode 100644 index c8deecb16..000000000 --- a/OWNERS_ALIASES +++ /dev/null @@ -1,6 +0,0 @@ -aliases: -- vfarcic -best-approvers: -- vfarcic -best-reviewers: -- vfarcic diff --git a/charts/go-demo-6/.helmignore b/charts/go-demo-6/.helmignore deleted file mode 100755 index f0c131944..000000000 --- a/charts/go-demo-6/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/charts/go-demo-6/Chart.yaml b/charts/go-demo-6/Chart.yaml deleted file mode 100644 index 238ed7b12..000000000 --- a/charts/go-demo-6/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -description: A Helm chart for Kubernetes -icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/d273e09/images/go.png -name: go-demo-6 -version: 0.1.0-SNAPSHOT diff --git a/charts/go-demo-6/Makefile b/charts/go-demo-6/Makefile deleted file mode 100755 index b1537ee85..000000000 --- a/charts/go-demo-6/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -CHART_REPO := http://jenkins-x-chartmuseum:8080 -CURRENT=$(pwd) -NAME := go-demo-6 -OS := $(shell uname) -VERSION := $(shell cat ../../VERSION) - -build: clean - rm -rf requirements.lock - helm dependency build - helm lint - -install: clean build - helm install . --name ${NAME} - -upgrade: clean build - helm upgrade ${NAME} . - -delete: - helm delete --purge ${NAME} - -clean: - rm -rf charts - rm -rf ${NAME}*.tgz - -release: clean - helm dependency build - helm lint - helm init --client-only - helm package . - curl --fail -u $(CHARTMUSEUM_CREDS_USR):$(CHARTMUSEUM_CREDS_PSW) --data-binary "@$(NAME)-$(shell sed -n 's/^version: //p' Chart.yaml).tgz" $(CHART_REPO)/api/charts - rm -rf ${NAME}*.tgz% - -tag: -ifeq ($(OS),Darwin) - sed -i "" -e "s/version:.*/version: $(VERSION)/" Chart.yaml - sed -i "" -e "s/tag: .*/tag: $(VERSION)/" values.yaml -else ifeq ($(OS),Linux) - sed -i -e "s/version:.*/version: $(VERSION)/" Chart.yaml - sed -i -e "s|repository: .*|repository: $(DOCKER_REGISTRY)\/vfarcic\/$(NAME)|" values.yaml - sed -i -e "s/tag: .*/tag: $(VERSION)/" values.yaml -else - echo "platfrom $(OS) not supported to tag with" - exit -1 -endif - git add --all - git commit -m "release $(VERSION)" --allow-empty # if first release then no verion update is performed - git tag -fa v$(VERSION) -m "Release version $(VERSION)" - git push origin v$(VERSION) \ No newline at end of file diff --git a/charts/go-demo-6/README.md b/charts/go-demo-6/README.md deleted file mode 100755 index 627fc3ddf..000000000 --- a/charts/go-demo-6/README.md +++ /dev/null @@ -1 +0,0 @@ -# golang application \ No newline at end of file diff --git a/charts/go-demo-6/templates/NOTES.txt b/charts/go-demo-6/templates/NOTES.txt deleted file mode 100755 index 97823be26..000000000 --- a/charts/go-demo-6/templates/NOTES.txt +++ /dev/null @@ -1,4 +0,0 @@ - -Get the application URL by running these commands: - -kubectl get ingress {{ template "fullname" . }} diff --git a/charts/go-demo-6/templates/_helpers.tpl b/charts/go-demo-6/templates/_helpers.tpl deleted file mode 100755 index f0d83d2ed..000000000 --- a/charts/go-demo-6/templates/_helpers.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/charts/go-demo-6/templates/deployment.yaml b/charts/go-demo-6/templates/deployment.yaml deleted file mode 100755 index a9b19a9f2..000000000 --- a/charts/go-demo-6/templates/deployment.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "fullname" . }} - labels: - draft: {{ default "draft-app" .Values.draft }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" -spec: - replicas: {{ .Values.replicaCount }} - template: - metadata: - labels: - draft: {{ default "draft-app" .Values.draft }} - app: {{ template "fullname" . }} -{{- if .Values.podAnnotations }} - annotations: -{{ toYaml .Values.podAnnotations | indent 8 }} -{{- end }} - spec: - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - containerPort: {{ .Values.service.internalPort }} - livenessProbe: - httpGet: - path: {{ .Values.probePath }} - port: {{ .Values.service.internalPort }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - readinessProbe: - httpGet: - path: {{ .Values.probePath }} - port: {{ .Values.service.internalPort }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - resources: -{{ toYaml .Values.resources | indent 12 }} - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} diff --git a/charts/go-demo-6/templates/service.yaml b/charts/go-demo-6/templates/service.yaml deleted file mode 100755 index 8d2738948..000000000 --- a/charts/go-demo-6/templates/service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: -{{- if .Values.service.name }} - name: {{ .Values.service.name }} -{{- else }} - name: {{ template "fullname" . }} -{{- end }} - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" -{{- if .Values.service.annotations }} - annotations: -{{ toYaml .Values.service.annotations | indent 4 }} -{{- end }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.externalPort }} - targetPort: {{ .Values.service.internalPort }} - protocol: TCP - name: http - selector: - app: {{ template "fullname" . }} diff --git a/charts/go-demo-6/values.yaml b/charts/go-demo-6/values.yaml deleted file mode 100755 index bbfc2ba2b..000000000 --- a/charts/go-demo-6/values.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Default values for Go projects. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -image: - repository: draft - tag: dev - pullPolicy: IfNotPresent -service: - name: go-demo-6 - type: ClusterIP - externalPort: 80 - internalPort: 8080 - annotations: - fabric8.io/expose: "true" - fabric8.io/ingress.annotations: "kubernetes.io/ingress.class: nginx" -resources: - limits: - cpu: 100m - memory: 256Mi - requests: - cpu: 80m - memory: 128Mi -probePath: / -livenessProbe: - initialDelaySeconds: 60 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 -readinessProbe: - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 -terminationGracePeriodSeconds: 10 diff --git a/charts/preview/Chart.yaml b/charts/preview/Chart.yaml deleted file mode 100644 index d5b379cf2..000000000 --- a/charts/preview/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -description: A Helm chart for Kubernetes -icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/master/images/go.png -name: preview -version: 0.1.0-SNAPSHOT diff --git a/charts/preview/Makefile b/charts/preview/Makefile deleted file mode 100755 index 0f148d0d6..000000000 --- a/charts/preview/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -OS := $(shell uname) - -preview: -ifeq ($(OS),Darwin) - sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml - sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml - sed -i "" -e "s/tag: .*/tag: $(PREVIEW_VERSION)/" values.yaml -else ifeq ($(OS),Linux) - sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml - sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml - sed -i -e "s|repository: .*|repository: $(DOCKER_REGISTRY)\/vfarcic\/go-demo-6|" values.yaml - sed -i -e "s/tag: .*/tag: $(PREVIEW_VERSION)/" values.yaml -else - echo "platfrom $(OS) not supported to release from" - exit -1 -endif - echo " version: $(PREVIEW_VERSION)" >> requirements.yaml - jx step helm build diff --git a/charts/preview/requirements.yaml b/charts/preview/requirements.yaml deleted file mode 100755 index 391c28160..000000000 --- a/charts/preview/requirements.yaml +++ /dev/null @@ -1,13 +0,0 @@ - -dependencies: -- alias: expose - name: exposecontroller - repository: https://chartmuseum.build.cd.jenkins-x.io - version: 2.3.56 -- alias: cleanup - name: exposecontroller - repository: https://chartmuseum.build.cd.jenkins-x.io - version: 2.3.56 -- alias: preview - name: go-demo-6 - repository: file://../go-demo-6 diff --git a/charts/preview/values.yaml b/charts/preview/values.yaml deleted file mode 100755 index b53ceaa57..000000000 --- a/charts/preview/values.yaml +++ /dev/null @@ -1,22 +0,0 @@ - -expose: - Annotations: - helm.sh/hook: post-install,post-upgrade - helm.sh/hook-delete-policy: hook-succeeded - config: - exposer: Ingress - http: true - tlsacme: false - -cleanup: - Args: - - --cleanup - Annotations: - helm.sh/hook: pre-delete - helm.sh/hook-delete-policy: hook-succeeded - -preview: - image: - repository: - tag: - pullPolicy: IfNotPresent \ No newline at end of file diff --git a/skaffold.yaml b/skaffold.yaml deleted file mode 100644 index eaa744206..000000000 --- a/skaffold.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: skaffold/v1alpha2 -kind: Config -build: - tagPolicy: - envTemplate: - template: "{{.DOCKER_REGISTRY}}/vfarcic/go-demo-6:{{.VERSION}}" - artifacts: - - imageName: changeme - workspace: . - docker: {} - local: {} -deploy: - kubectl: - manifests: -profiles: -- name: dev - build: - tagPolicy: - envTemplate: - template: "{{.DOCKER_REGISTRY}}/vfarcic/go-demo-6:{{.DIGEST_HEX}}" - artifacts: - - docker: {} - local: {} - deploy: - helm: - releases: - - name: go-demo-6 - chartPath: charts/go-demo-6 - setValueTemplates: - image.repository: "{{.DOCKER_REGISTRY}}/vfarcic/go-demo-6" - image.tag: "{{.DIGEST_HEX}}" diff --git a/watch.sh b/watch.sh deleted file mode 100644 index 172b77658..000000000 --- a/watch.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# watch the java files and continously deploy the service -make linux -skaffold run -p dev -reflex -r "\.go$" -- bash -c 'make linux && skaffold run -p dev'