Skip to content

Commit

Permalink
Merge pull request #29 from nicholasjackson/dev
Browse files Browse the repository at this point in the history
fix release
  • Loading branch information
nicholasjackson authored Feb 9, 2022
2 parents e801796 + 6356bfc commit d431168
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 29 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ jobs:
release:
name: Build production Docker image and release Helm chart
runs-on: ubuntu-latest
needs:
- build
- functional_tests
#needs:
# - build
# - functional_tests
if: ${{ github.ref == 'refs/heads/main' }}

steps:
Expand Down Expand Up @@ -175,19 +175,19 @@ jobs:
run: |
make build_docker
env:
VERSION_ENV: ${{ steps.next_version.outputs.new_version }}
VERSION_ENV: ${{ steps.tag_version.outputs.new_version }}

- name: Generate the Helm release
run: |
make generate_helm
env:
VERSION_ENV: ${{ steps.next_version.outputs.new_version }}
VERSION_ENV: ${{ steps.tag_version.outputs.new_version }}

- name: Commit changes
uses: EndBug/add-and-commit@v8
with:
default_author: github_actions
message: 'Update helm chart to version ${{ steps.next_version.outputs.new_version }}'
message: 'Update helm chart to version ${{ steps.tag_version.outputs.new_version }}'
add: '*.yaml'

- name: Bump version and push tag
Expand All @@ -200,10 +200,10 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.next_version.outputs.new_tag }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
token: ${{ secrets.GH_TOKEN }}
files: |
./consul-release-controller-${{ steps.next_version.outputs.new_version }}.tgz
./consul-release-controller-${{ steps.tag_version.outputs.new_version }}.tgz
- name: Deploy Github pages
uses: JamesIves/github-pages-deploy-action@v4.2.3
Expand All @@ -216,4 +216,4 @@ jobs:
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: "Built new Docker image"
description: "Built new Docker image"
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ SHELL := /bin/bash
UNAME := $(shell uname)

ifeq "$(VERSION_ENV)" ""
VERSION = $(shell git log --pretty=format:'%h' -n 1)
VERSION=$(shell git log --pretty=format:'%h' -n 1)
HELM_VERSION=0.0.1-dev
else
VERSION = $(VERSION_ENV)
VERSION=$(VERSION_ENV)
HELM_VERSION=$(VERSION_ENV)
endif

# Build and push the Arm64 and x64 images to the Docker registry
Expand Down Expand Up @@ -75,9 +77,14 @@ generate_helm:
kustomize build ./kubernetes/controller/config/helm -o ./deploy/kubernetes/charts/consul-release-controller/templates

# Set the version in the chart

cp ./deploy/kubernetes/charts/consul-release-controller/Chart.tpl ./deploy/kubernetes/charts/consul-release-controller/Chart.yaml
sedi=(-i) && [ "$(UNAME)" == "Darwin" ] && sedi=(-i '') ; \
sed "$${sedi[@]}" -e 's/##VERSION##/${VERSION}/' ./deploy/kubernetes/charts/consul-release-controller/Chart.yaml
sed "$${sedi[@]}" -e 's/##VERSION##/${HELM_VERSION}/' ./deploy/kubernetes/charts/consul-release-controller/Chart.yaml

cp ./deploy/kubernetes/charts/consul-release-controller/values.tpl ./deploy/kubernetes/charts/consul-release-controller/values.yaml
sedi=(-i) && [ "$(UNAME)" == "Darwin" ] && sedi=(-i '') ; \
sed "$${sedi[@]}" -e 's/##VERSION##/${VERSION}/' ./deploy/kubernetes/charts/consul-release-controller/values.yaml

# Now package the Helm chart into a tarball
helm package ./deploy/kubernetes/charts/consul-release-controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: ##VERSION##
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
appVersion: "##VERSION##"
4 changes: 2 additions & 2 deletions deploy/kubernetes/charts/consul-release-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3568545
version: 3.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. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
appVersion: "3.2.2"
158 changes: 158 additions & 0 deletions deploy/kubernetes/charts/consul-release-controller/values.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
# Default values for consul-canary
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

controller:
enabled: "true"

container_config:
image:
repository: nicholasjackson/consul-release-controller
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "##VERSION##"

env:
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: CONSUL_HTTP_ADDR
value: https://$(HOST_IP):8501
- name: CONSUL_CAPATH
value: /consul/tls/client/ca/tls.crt
- name: CONSUL_HTTP_TOKEN
valueFrom:
secretKeyRef:
name: consul-controller-acl-token
key: token
# Additional environment variables to add to the controller
# deployment
# - name: MYENV
# value: myvalue

volumeMounts:
- mountPath: /consul/tls/client/ca
name: consul-auto-encrypt-ca-cert
# Additional volume mounts to add to the container can be used to
# mount configuration or certificates needed by the specific controller implementation.
# - name: consul-ca
# mountPath: /tmp/consul/ca

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

additional_volumes:
- name: consul-server-ca
secret:
secretName: consul-server-cert
- name: consul-auto-encrypt-ca-cert
emptyDir:
medium: Memory
# Additional volumes to add to the controller pod
# - name: consul-ca
# secret:
# secretName: consul-ca-cert

additional_init_containers:
- command:
- /bin/sh
- -ec
- |
consul-k8s get-consul-client-ca \
-output-file=/consul/tls/client/ca/tls.crt \
-server-addr=consul-server \
-server-port=8501 \
-ca-file=/consul/tls/ca/tls.crt
image: hashicorp/consul-k8s:0.25.0
imagePullPolicy: IfNotPresent
name: get-auto-encrypt-client-ca
resources:
limits:
cpu: 50m
memory: 50Mi
requests:
cpu: 50m
memory: 50Mi
volumeMounts:
- mountPath: /consul/tls/ca
name: consul-server-ca
- mountPath: /consul/tls/client/ca
name: consul-auto-encrypt-ca-cert
# Add additional init containers to the controller pod
# - command:
# - /bin/sh
# - -ec
# - |
# consul-k8s get-consul-client-ca \
# -output-file=/consul/tls/client/ca/tls.crt \
# -server-addr=consul-server \
# -server-port=8501 \
# -ca-file=/consul/tls/ca/tls.crt
# image: hashicorp/consul-k8s:0.25.0
# imagePullPolicy: IfNotPresent
# name: get-auto-encrypt-client-ca

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}

webhook:
enabled: "false"
type: ClusterIP
port: 443
service: consul-release-controller-webhook
namespaceOverride: ""

# Allows adding additional DNS Names to the cert generated
# for the webhook
additionalDNSNames: []

failurePolicy: Fail

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ controller:
repository: nicholasjackson/consul-release-controller
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "0.0.1"
tag: "3.2.2"

env:
- name: HOST_IP
Expand Down
15 changes: 2 additions & 13 deletions docs/index.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
apiVersion: v1
entries:
consul-release-controller:
- apiVersion: v2
appVersion: 1.16.0
created: "2022-02-09T06:22:40.19745639Z"
description: A Helm chart for installing the Consul release controller
digest: 6d3e762a5049bad6756548bcf7833f1f30aa654f53300376f941124b8f02c94e
name: consul-release-controller
type: application
urls:
- https://github.com/nicholasjackson/consul-release-controller/releases/download/3568545/consul-release-controller-3568545.tgz
version: "3568545"
generated: "2022-02-09T06:22:40.196736351Z"
entries: {}
generated: "2022-02-09T20:32:37.029261923Z"

0 comments on commit d431168

Please sign in to comment.