Compare commits

...

8 Commits

Author SHA1 Message Date
Danny Bessems 78b8d6872a chore(release): 0.7.0 [skip ci]
# [0.7.0](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.6.0...v0.7.0) (2023-07-14)

### Features

* Add sidecar for continuous polling ([806757a](806757a913))
2023-07-14 08:24:10 +00:00
Danny Bessems d09d09e526 build: Group shell commands to avoid unintended exit
continuous-integration/drone/push Build is passing Details
2023-07-14 10:22:06 +02:00
Danny Bessems 806757a913 feat: Add sidecar for continuous polling
continuous-integration/drone/push Build is passing Details
2023-07-14 10:15:55 +02:00
Danny Bessems d40f35a2d6 build: Debug exit behaviour #2
continuous-integration/drone/push Build is passing Details
2023-07-13 10:45:25 +02:00
Danny Bessems c61bc4fc8d build: Debug exit behaviour
continuous-integration/drone/push Build encountered an error Details
2023-07-13 10:42:53 +02:00
Danny Bessems cbd981cf19 build: Revert using `export` and refactor to gracefully exit on an empty value
continuous-integration/drone/push Build encountered an error Details
2023-07-13 10:33:33 +02:00
Danny Bessems f4457a1275 build: Add graceful exit if semantic release does not create a new version
continuous-integration/drone/push Build is failing Details
2023-07-13 09:17:42 +02:00
Danny Bessems 377885f802 build: Create and upload changelog file
continuous-integration/drone/push Build is failing Details
2023-07-12 12:22:42 +02:00
9 changed files with 86 additions and 20 deletions

View File

@ -47,13 +47,13 @@ steps:
image: gcr.io/kaniko-project/executor:debug
pull: always
commands:
- |
export IMAGE_TAG=$(cat .version 2> /dev/null) && [ -n "$IMAGE_TAG" ] || (echo 'No release tag - exiting'; exit 0)
- |
wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -qO /bin/jq
chmod +x /bin/jq
- |
/bin/jq '.auths["https://bv11-cr01.bessems.eu/v2/"].auth="'"$(echo -n $HARBOR_USERNAME':'$HARBOR_PASSWORD | base64)"'"' --null-input > /kaniko/.docker/config.json
- |
export IMAGE_TAG=$(cat .version)
- |
/kaniko/executor \
--dockerfile=Dockerfile \
@ -72,11 +72,11 @@ steps:
image: gcr.io/kaniko-project/executor:debug
pull: always
commands:
- |
export IMAGE_TAG=$(cat .version 2> /dev/null) && [ -n "$IMAGE_TAG" ] || (echo 'No release tag - exiting'; exit 0)
- |
wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -qO /bin/jq
chmod +x /bin/jq
- |
export IMAGE_TAG=$(cat .version)
- |
/bin/jq '.auths["https://index.docker.io/v1/"].auth="'"$(echo -n $DOCKER_USERNAME':'$DOCKER_PASSWORD | base64)"'"' --null-input > /kaniko/.docker/config.json
- |
@ -98,7 +98,7 @@ steps:
pull: always
commands:
- |
export CHART_VERSION=$(cat .version)
export CHART_VERSION=$(cat .version 2> /dev/null) && [ -n "$CHART_VERSION" ] || (echo 'No release tag - exiting'; exit 0)
sed -i 's/{{ chart_version }}/'$CHART_VERSION'/g' charts/json-server/Chart.yaml
sed -i 's/tag: latest/tag: '$CHART_VERSION'/g' charts/json-server/values.yaml
- |
@ -128,6 +128,8 @@ steps:
image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
pull: always
commands:
- |
export VALID_TAG=$(cat .version 2> /dev/null) && [ -n "$VALID_TAG" ] || (echo 'No release tag - exiting'; exit 0)
- |
apt-get update
- |
@ -137,6 +139,7 @@ steps:
- |
npm install \
semantic-release \
@semantic-release/changelog \
@semantic-release/commit-analyzer \
@semantic-release/git \
@semantic-release/release-notes-generator
@ -146,7 +149,7 @@ steps:
npx semantic-release \
--branches ${DRONE_BRANCH} \
--tag-format "v\$${version}" \
--plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/git
--plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/changelog,@semantic-release/git
environment:
GIT_APIKEY:
from_secret: git_apikey

6
CHANGELOG.md Normal file
View File

@ -0,0 +1,6 @@
# [0.7.0](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.6.0...v0.7.0) (2023-07-14)
### Features
* Add sidecar for continuous polling ([806757a](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/806757a9135341d919b31d4183a84e3870c24f3f))

View File

@ -0,0 +1,8 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-clusterrole
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]

View File

@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-clusterrolebinding
subjects:
- kind: ServiceAccount
name: {{ include "json-server.serviceAccountName" . }}
namespace: {{ Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Name }}-clusterrole
apiGroup: rbac.authorization.k8s.io

View File

@ -1,4 +1,4 @@
{{- if not .Values.seedData.existingConfigMap }}
{{- if not .Values.json-server.seedData.existingConfigMap }}
apiVersion: v1
kind: ConfigMap
metadata:
@ -55,5 +55,5 @@ data:
</body>
</html>
db.json: |
{{ include "common.tplvalues.render" ( dict "value" .Values.seedData.configInline "context" $) | indent 4 }}
{{ include "common.tplvalues.render" ( dict "value" .Values.json-server.seedData.configInline "context" $) | indent 4 }}
{{- end -}}

View File

@ -29,8 +29,8 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.json-server.image.repository }}:{{ .Values.json-server.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.json-server.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
@ -52,6 +52,17 @@ spec:
- name: {{ .Release.Name }}-configmap
mountPath: /usr/local/lib/node_modules/json-server/public/index.html
subPath: index.html
- name: {{ .Chart.Name }}-sidecar
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
command:
- /bin/sh
- -c
- sleep infinity
volumes:
- name: {{ .Release.Name }}-configmap
configMap:

View File

@ -1,18 +1,25 @@
# Default values for json-server.
seedData:
# Not implemented yet
# existingConfigMap: ""
configInline: {}
json-server:
seedData:
# Not implemented yet
# existingConfigMap: ""
configInline: {}
image:
repository: bv11-cr01.bessems.eu/library/json-server
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: latest
sidecar:
image:
repository: alpine/helm
pullPolicy: IfNotPresent
tag: 3.12.1
replicaCount: 1
image:
repository: bv11-cr01.bessems.eu/library/json-server
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: latest
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

18
package-lock.json generated
View File

@ -5,6 +5,7 @@
"packages": {
"": {
"dependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
@ -287,6 +288,23 @@
"node": ">=12"
}
},
"node_modules/@semantic-release/changelog": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz",
"integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==",
"dependencies": {
"@semantic-release/error": "^3.0.0",
"aggregate-error": "^3.0.0",
"fs-extra": "^11.0.0",
"lodash": "^4.17.4"
},
"engines": {
"node": ">=14.17"
},
"peerDependencies": {
"semantic-release": ">=18.0.0"
}
},
"node_modules/@semantic-release/commit-analyzer": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-10.0.1.tgz",

View File

@ -1,5 +1,6 @@
{
"dependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",