Compare commits
	
		
			73 Commits
		
	
	
		
			d982d81d5f
			...
			v0.8.4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					f8252bfdc4 | ||
| 2daed4dd44 | |||
| 50d378185f | |||
| b49701b332 | |||
| 5ed9698019 | |||
| f6d3804907 | |||
| 81f7b7b669 | |||
| fcf3178611 | |||
| f77171358d | |||
| 4f359e4585 | |||
| b432068e82 | |||
| 16f1ff14ff | |||
| 15daa960c2 | |||
| 105bc71e9c | |||
| a6d6e91ffa | |||
| e8822fc8da | |||
| fa2c72cb68 | |||
| 2725f36017 | |||
| 0af8f2ac5e | |||
| 6270499efe | |||
| 44ac6b484d | |||
| 6f07cc8d87 | |||
| a5e3c79d10 | |||
| dcb3decbd3 | |||
| 3c141a2d40 | |||
| 0999fdf705 | |||
| 6c71c5f364 | |||
| c551a242c7 | |||
| ec36309d8d | |||
| 93ff24ac73 | |||
| 614fda9b7d | |||
| 78b8d6872a | |||
| d09d09e526 | |||
| 806757a913 | |||
| d40f35a2d6 | |||
| c61bc4fc8d | |||
| cbd981cf19 | |||
| f4457a1275 | |||
| 377885f802 | |||
| 2538247718 | |||
| 361a85592e | |||
| e83b98e116 | |||
| a4ced9e4b4 | |||
| cde06aae36 | |||
| f4ee0617cc | |||
| dce6d7fb1c | |||
| f09dfc99d2 | |||
| 396e2fe9b3 | |||
| 3501cd51f3 | |||
| 78cb46795f | |||
| 48e8b21c30 | |||
| b19a3f7391 | |||
| cde425809f | |||
| 6170a12b19 | |||
| a12ce0a9e9 | |||
| 2c749e2077 | |||
| 1f2081f05c | |||
| 1d791a3820 | |||
| 7f5242eedc | |||
| ec276c088d | |||
| 1ab1c10f37 | |||
| 4deac9ab13 | |||
| 2f6c7f7f91 | |||
| d24792b8c3 | |||
| 55afb79de5 | |||
| 0fa80669cd | |||
| 38eb4e9faa | |||
| c6815721df | |||
| ff42784426 | |||
| d6e01f3c23 | |||
| 878107623e | |||
| fa6e9ea3b7 | |||
| f19de98b4c | 
							
								
								
									
										188
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										188
									
								
								.drone.yml
									
									
									
									
									
								
							@@ -1,55 +1,155 @@
 | 
				
			|||||||
kind: pipeline
 | 
					kind: pipeline
 | 
				
			||||||
type: kubernetes
 | 
					type: kubernetes
 | 
				
			||||||
name: Container image
 | 
					name: Container & Helm chart
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					trigger:
 | 
				
			||||||
 | 
					  event:
 | 
				
			||||||
 | 
					    exclude:
 | 
				
			||||||
 | 
					    - tag
 | 
				
			||||||
 | 
					
 | 
				
			||||||
steps:
 | 
					steps:
 | 
				
			||||||
- name: Build & publish (Harbor)
 | 
					- name: Semantic Release (Dry-run)
 | 
				
			||||||
  depends_on:
 | 
					  image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
 | 
				
			||||||
  - clone
 | 
					  pull: always
 | 
				
			||||||
  image: plugins/docker
 | 
					 | 
				
			||||||
  context: .
 | 
					 | 
				
			||||||
  settings:
 | 
					 | 
				
			||||||
    repo: bv11-cr01.bessems.eu/library/json-server
 | 
					 | 
				
			||||||
    registry: bv11-cr01.bessems.eu
 | 
					 | 
				
			||||||
    tags: latest
 | 
					 | 
				
			||||||
    mtu: 1450
 | 
					 | 
				
			||||||
    username:
 | 
					 | 
				
			||||||
      from_secret: harbor_username
 | 
					 | 
				
			||||||
    password:
 | 
					 | 
				
			||||||
      from_secret: harbor_password
 | 
					 | 
				
			||||||
- name: Build & publish (Dockerhub)
 | 
					 | 
				
			||||||
  depends_on:
 | 
					 | 
				
			||||||
  - clone
 | 
					 | 
				
			||||||
  image: plugins/docker
 | 
					 | 
				
			||||||
  context: .
 | 
					 | 
				
			||||||
  settings:
 | 
					 | 
				
			||||||
    repo: djpbessems/json-server
 | 
					 | 
				
			||||||
    tags: latest
 | 
					 | 
				
			||||||
    mtu: 1450
 | 
					 | 
				
			||||||
    username:
 | 
					 | 
				
			||||||
      from_secret: docker_username
 | 
					 | 
				
			||||||
    password:
 | 
					 | 
				
			||||||
      from_secret: docker_password
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
---
 | 
					 | 
				
			||||||
kind: pipeline
 | 
					 | 
				
			||||||
type: kubernetes
 | 
					 | 
				
			||||||
name: Helm chart (Gitea)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
steps:
 | 
					 | 
				
			||||||
- name: Package & publish
 | 
					 | 
				
			||||||
  image: bv11-cr01.bessems.eu/proxy/alpine/helm
 | 
					 | 
				
			||||||
  commands:
 | 
					  commands:
 | 
				
			||||||
  - |
 | 
					  - |
 | 
				
			||||||
    apk add yq
 | 
					    apt-get update
 | 
				
			||||||
  - |
 | 
					  - |
 | 
				
			||||||
    helm package ./charts/json-server
 | 
					    apt-get install -y --no-install-recommends \
 | 
				
			||||||
 | 
					      git-core \
 | 
				
			||||||
 | 
					      ca-certificates
 | 
				
			||||||
  - |
 | 
					  - |
 | 
				
			||||||
    CHART_VERSION=$(cat ./charts/json-server/Chart.yaml | yq '.version')
 | 
					    npm install \
 | 
				
			||||||
    curl \
 | 
					      semantic-release \
 | 
				
			||||||
      --header "Authorization: token $GIT_APIKEY" \
 | 
					      @semantic-release/commit-analyzer \
 | 
				
			||||||
      --upload-file json-server-$CHART_VERSION.tgz \
 | 
					      @semantic-release/exec \
 | 
				
			||||||
      https://code.spamasaurus.com/api/packages/$GIT_USERNAME/generic/json-server/$CHART_VERSION/json-server-$CHART_VERSION.tgz
 | 
					  - |
 | 
				
			||||||
 | 
					    export GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY}
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    npx semantic-release \
 | 
				
			||||||
 | 
					      --package @semantic-release/exec \
 | 
				
			||||||
 | 
					      --package semantic-release \
 | 
				
			||||||
 | 
					      --branches ${DRONE_BRANCH} \
 | 
				
			||||||
 | 
					      --tag-format "v\$${version}" \
 | 
				
			||||||
 | 
					      --dry-run \
 | 
				
			||||||
 | 
					      --plugins @semantic-release/commit-analyzer,@semantic-release/exec \
 | 
				
			||||||
 | 
					      --analyzeCommits @semantic-release/commit-analyzer \
 | 
				
			||||||
 | 
					      --verifyRelease @semantic-release/exec \
 | 
				
			||||||
 | 
					      --verifyReleaseCmd 'echo "$${nextRelease.version}" > .version'
 | 
				
			||||||
 | 
					  environment:
 | 
				
			||||||
 | 
					    GIT_APIKEY:
 | 
				
			||||||
 | 
					      from_secret: git_apikey
 | 
				
			||||||
 | 
					    GIT_USERNAME: djpbessems
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Container image (Harbor)
 | 
				
			||||||
 | 
					  depends_on:
 | 
				
			||||||
 | 
					  - Semantic Release (Dry-run)
 | 
				
			||||||
 | 
					  image: gcr.io/kaniko-project/executor:debug
 | 
				
			||||||
 | 
					  pull: always
 | 
				
			||||||
 | 
					  commands:
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    export VALID_TAG=$(cat .version 2> /dev/null) && [ -n "$VALID_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
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    /kaniko/executor \
 | 
				
			||||||
 | 
					      --dockerfile=Dockerfile \
 | 
				
			||||||
 | 
					      --context=dir://. \
 | 
				
			||||||
 | 
					      --destination=bv11-cr01.bessems.eu/library/json-server:latest \
 | 
				
			||||||
 | 
					      --destination=bv11-cr01.bessems.eu/library/json-server:$VALID_TAG
 | 
				
			||||||
 | 
					  environment:
 | 
				
			||||||
 | 
					    HARBOR_USERNAME:
 | 
				
			||||||
 | 
					      from_secret: harbor_username
 | 
				
			||||||
 | 
					    HARBOR_PASSWORD:
 | 
				
			||||||
 | 
					      from_secret: harbor_password
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Container image (docker.io)
 | 
				
			||||||
 | 
					  depends_on:
 | 
				
			||||||
 | 
					  - Semantic Release (Dry-run)
 | 
				
			||||||
 | 
					  image: gcr.io/kaniko-project/executor:debug
 | 
				
			||||||
 | 
					  pull: always
 | 
				
			||||||
 | 
					  commands:
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    export VALID_TAG=$(cat .version 2> /dev/null) && [ -n "$VALID_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://index.docker.io/v1/"].auth="'"$(echo -n $DOCKER_USERNAME':'$DOCKER_PASSWORD | base64)"'"' --null-input > /kaniko/.docker/config.json
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    /kaniko/executor \
 | 
				
			||||||
 | 
					      --dockerfile=Dockerfile \
 | 
				
			||||||
 | 
					      --context=dir://. \
 | 
				
			||||||
 | 
					      --destination=docker.io/djpbessems/json-server:latest \
 | 
				
			||||||
 | 
					      --destination=docker.io/djpbessems/json-server:$VALID_TAG
 | 
				
			||||||
 | 
					  environment:
 | 
				
			||||||
 | 
					    DOCKER_USERNAME:
 | 
				
			||||||
 | 
					      from_secret: docker_username
 | 
				
			||||||
 | 
					    DOCKER_PASSWORD:
 | 
				
			||||||
 | 
					      from_secret: docker_password
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Helm chart (Gitea)
 | 
				
			||||||
 | 
					  depends_on:
 | 
				
			||||||
 | 
					  - Semantic Release (Dry-run)
 | 
				
			||||||
 | 
					  image: bv11-cr01.bessems.eu/proxy/alpine/helm
 | 
				
			||||||
 | 
					  pull: always
 | 
				
			||||||
 | 
					  commands:
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    export VALID_TAG=$(cat .version 2> /dev/null) && [ -n "$VALID_TAG" ] || (echo 'No release tag - exiting'; exit 0)
 | 
				
			||||||
 | 
					    sed -i 's/{{ chart_version }}/'$VALID_TAG'/g' charts/json-server/Chart.yaml
 | 
				
			||||||
 | 
					    sed -i 's/{{ image_tag }}/'$VALID_TAG'/g' charts/json-server/values.yaml
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    helm package ./charts/json-server
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    helm plugin install https://github.com/chartmuseum/helm-push
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    helm repo add \
 | 
				
			||||||
 | 
					      --username $GIT_USERNAME \
 | 
				
			||||||
 | 
					      --password $GIT_APIKEY \
 | 
				
			||||||
 | 
					      spamasaurus \
 | 
				
			||||||
 | 
					      https://code.spamasaurus.com/api/packages/$GIT_USERNAME/helm
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    helm cm-push \
 | 
				
			||||||
 | 
					      json-server-*.tgz \
 | 
				
			||||||
 | 
					      spamasaurus
 | 
				
			||||||
 | 
					  environment:
 | 
				
			||||||
 | 
					    GIT_APIKEY:
 | 
				
			||||||
 | 
					      from_secret: git_apikey
 | 
				
			||||||
 | 
					    GIT_USERNAME: djpbessems
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Semantic Release
 | 
				
			||||||
 | 
					  depends_on:
 | 
				
			||||||
 | 
					  - Container image (Harbor)
 | 
				
			||||||
 | 
					  - Container image (docker.io)
 | 
				
			||||||
 | 
					  - Helm chart (Gitea)
 | 
				
			||||||
 | 
					  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
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    apt-get install -y --no-install-recommends \
 | 
				
			||||||
 | 
					      git-core \
 | 
				
			||||||
 | 
					      ca-certificates
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    npm install \
 | 
				
			||||||
 | 
					      semantic-release \
 | 
				
			||||||
 | 
					      @semantic-release/changelog \
 | 
				
			||||||
 | 
					      @semantic-release/commit-analyzer \
 | 
				
			||||||
 | 
					      @semantic-release/git \
 | 
				
			||||||
 | 
					      @semantic-release/release-notes-generator
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    export GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY}
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    npx semantic-release \
 | 
				
			||||||
 | 
					      --branches ${DRONE_BRANCH} \
 | 
				
			||||||
 | 
					      --tag-format "v\$${version}" \
 | 
				
			||||||
 | 
					      --plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/changelog,@semantic-release/git
 | 
				
			||||||
  environment:
 | 
					  environment:
 | 
				
			||||||
    GIT_APIKEY:
 | 
					    GIT_APIKEY:
 | 
				
			||||||
      from_secret: git_apikey
 | 
					      from_secret: git_apikey
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										157
									
								
								.gitea/workflows/actions.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								.gitea/workflows/actions.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,157 @@
 | 
				
			|||||||
 | 
					name: build-image
 | 
				
			||||||
 | 
					on: [push]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  semrel_dryrun:
 | 
				
			||||||
 | 
					    name: Semantic Release (Dry-run)
 | 
				
			||||||
 | 
					    runs-on: dind-rootless
 | 
				
			||||||
 | 
					    outputs:
 | 
				
			||||||
 | 
					      version: ${{ steps.sem_rel.outputs.version }}
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Check out repository code
 | 
				
			||||||
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
 | 
					      - name: Set up Node
 | 
				
			||||||
 | 
					        uses: actions/setup-node@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          node-version: 20
 | 
				
			||||||
 | 
					      - name: Install dependencies
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          npm install \
 | 
				
			||||||
 | 
					            semantic-release \
 | 
				
			||||||
 | 
					            @semantic-release/commit-analyzer \
 | 
				
			||||||
 | 
					            @semantic-release/exec
 | 
				
			||||||
 | 
					      - name: Semantic Release (dry-run)
 | 
				
			||||||
 | 
					        id: sem_rel
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          npx semantic-release \
 | 
				
			||||||
 | 
					            --package @semantic-release/exec \
 | 
				
			||||||
 | 
					            --package semantic-release \
 | 
				
			||||||
 | 
					            --branches ${{ gitea.refname }} \
 | 
				
			||||||
 | 
					            --tag-format 'v${version}' \
 | 
				
			||||||
 | 
					            --dry-run \
 | 
				
			||||||
 | 
					            --plugins @semantic-release/commit-analyzer,@semantic-release/exec \
 | 
				
			||||||
 | 
					            --analyzeCommits @semantic-release/commit-analyzer \
 | 
				
			||||||
 | 
					            --verifyRelease @semantic-release/exec \
 | 
				
			||||||
 | 
					            --verifyReleaseCmd 'echo "version=${nextRelease.version}" >> $GITHUB_OUTPUT'
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          GIT_CREDENTIALS: ${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_APIKEY }}
 | 
				
			||||||
 | 
					      - name: Assert semantic release output
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          [[ -z "${{ steps.sem_rel.outputs.version }}" ]] && {
 | 
				
			||||||
 | 
					            echo 'No release tag - exiting'; exit 1
 | 
				
			||||||
 | 
					          } || {
 | 
				
			||||||
 | 
					            echo 'Release tag set correctly: ${{ steps.sem_rel.outputs.version }}'; exit 0
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  build_container:
 | 
				
			||||||
 | 
					    name: Container image
 | 
				
			||||||
 | 
					    runs-on: dind
 | 
				
			||||||
 | 
					    needs: semrel_dryrun
 | 
				
			||||||
 | 
					    container: ghcr.io/catthehacker/ubuntu:act-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Check out repository code
 | 
				
			||||||
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
 | 
					      - name: Set up qemu
 | 
				
			||||||
 | 
					        # Will not work out of the box; instead using dind
 | 
				
			||||||
 | 
					        # uses: docker/setup-qemu-action@v3
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          sudo apt-get update
 | 
				
			||||||
 | 
					          sudo apt-get install -y qemu-user-static
 | 
				
			||||||
 | 
					      - name: Create builder context
 | 
				
			||||||
 | 
					        id: buildx-context
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          docker context create builders
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          DOCKER_HOST: tcp://docker:2376/
 | 
				
			||||||
 | 
					          DOCKER_TLS_CERTDIR: /certs
 | 
				
			||||||
 | 
					          DOCKER_TLS_VERIFY: 1
 | 
				
			||||||
 | 
					          DOCKER_CERT_PATH: "/certs/client"
 | 
				
			||||||
 | 
					      - name: Set up buildx
 | 
				
			||||||
 | 
					        id: buildx
 | 
				
			||||||
 | 
					        uses: docker/setup-buildx-action@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          # buildkitd-flags: --debug
 | 
				
			||||||
 | 
					          endpoint: builders
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          DOCKER_HOST: "tcp://docker:2376/"
 | 
				
			||||||
 | 
					          DOCKER_TLS_CERTDIR: "/certs"
 | 
				
			||||||
 | 
					          DOCKER_TLS_VERIFY: 1
 | 
				
			||||||
 | 
					          DOCKER_CERT_PATH: "/certs/client"
 | 
				
			||||||
 | 
					      - name: Login to target repository
 | 
				
			||||||
 | 
					        uses: docker/login-action@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          registry: code.spamasaurus.com
 | 
				
			||||||
 | 
					          username: ${{ secrets.GIT_USERNAME }}
 | 
				
			||||||
 | 
					          password: ${{ secrets.GIT_APIKEY }}
 | 
				
			||||||
 | 
					      - name: Build & push container image
 | 
				
			||||||
 | 
					        uses: docker/build-push-action@v5
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: .
 | 
				
			||||||
 | 
					          tags: code.spamasaurus.com/djpbessems/json-server:${{ needs.semrel_dryrun.outputs.version }}
 | 
				
			||||||
 | 
					          provenance: false
 | 
				
			||||||
 | 
					          push: true
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          DOCKER_HOST: "tcp://docker:2376/"
 | 
				
			||||||
 | 
					          DOCKER_TLS_CERTDIR: "/certs"
 | 
				
			||||||
 | 
					          DOCKER_TLS_VERIFY: 1
 | 
				
			||||||
 | 
					          DOCKER_CERT_PATH: "/certs/client"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  build_chart:
 | 
				
			||||||
 | 
					    name: Helm chart
 | 
				
			||||||
 | 
					    runs-on: dind-rootless
 | 
				
			||||||
 | 
					    needs: semrel_dryrun
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Check out repository code
 | 
				
			||||||
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
 | 
					      - name: Prepare build environment
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          apt-get update && apt-get install -y --no-install-recommends \
 | 
				
			||||||
 | 
					            jq
 | 
				
			||||||
 | 
					          curl -L https://api.github.com/repos/helm/helm/releases/latest | \
 | 
				
			||||||
 | 
					            jq -r '.tag_name' | \
 | 
				
			||||||
 | 
					            xargs -I {} curl -L -o /tmp/helm.tar.gz https://get.helm.sh/helm-{}-linux-amd64.tar.gz && \
 | 
				
			||||||
 | 
					          tar -xzf /tmp/helm.tar.gz --strip-components=1 -C /bin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          helm plugin install https://github.com/chartmuseum/helm-push
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          sed -i 's/{{ chart_version }}/${{ needs.semrel_dryrun.outputs.version }}/g' charts/json-server/Chart.yaml
 | 
				
			||||||
 | 
					          sed -i 's/{{ image_tag }}/${{ needs.semrel_dryrun.outputs.version }}/g' charts/json-server/values.yaml
 | 
				
			||||||
 | 
					      - name: Build & push helm chart
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          helm package ./charts/json-server
 | 
				
			||||||
 | 
					          helm repo add \
 | 
				
			||||||
 | 
					            --username ${{ secrets.GIT_USERNAME }} \
 | 
				
			||||||
 | 
					            --password ${{ secrets.GIT_APIKEY }} \
 | 
				
			||||||
 | 
					            spamasaurus \
 | 
				
			||||||
 | 
					            https://code.spamasaurus.com/api/packages/${{ secrets.GIT_USERNAME }}/helm
 | 
				
			||||||
 | 
					          helm cm-push \
 | 
				
			||||||
 | 
					            json-server-*.tgz \
 | 
				
			||||||
 | 
					            spamasaurus
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  semrel:
 | 
				
			||||||
 | 
					    name: Semantic Release
 | 
				
			||||||
 | 
					    runs-on: dind-rootless
 | 
				
			||||||
 | 
					    needs: [build_container,build_chart]
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Check out repository code
 | 
				
			||||||
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
 | 
					      - name: Set up Node
 | 
				
			||||||
 | 
					        uses: actions/setup-node@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          node-version: 20
 | 
				
			||||||
 | 
					      - name: Install dependencies
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          npm install \
 | 
				
			||||||
 | 
					            semantic-release \
 | 
				
			||||||
 | 
					            @semantic-release/changelog \
 | 
				
			||||||
 | 
					            @semantic-release/commit-analyzer \
 | 
				
			||||||
 | 
					            @semantic-release/git \
 | 
				
			||||||
 | 
					            @semantic-release/release-notes-generator
 | 
				
			||||||
 | 
					      - name: Semantic Release
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          npx semantic-release \
 | 
				
			||||||
 | 
					            --branches ${{ gitea.refname }} \
 | 
				
			||||||
 | 
					            --tag-format 'v${version}' \
 | 
				
			||||||
 | 
					            --plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/changelog,@semantic-release/git
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          GIT_CREDENTIALS: ${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_APIKEY }}
 | 
				
			||||||
							
								
								
									
										72
									
								
								CHANGELOG.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								CHANGELOG.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,72 @@
 | 
				
			|||||||
 | 
					## [0.8.4](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.JSONServer/compare/v0.8.3...v0.8.4) (2024-06-07)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Replace default registry FQDN ([f771713](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.JSONServer/commit/f77171358dd9a00a04b0223b7c878550324420c3))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [0.8.3](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.2...v0.8.3) (2023-07-16)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Filter redundant release fields ([16f1ff1](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/16f1ff14ff4616b28462715ce2d6fd6490254b10))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [0.8.2](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.1...v0.8.2) (2023-07-16)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Remove race condition when testing target url ([105bc71](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/105bc71e9c16ebf9afa5a4027d1131f311a76c5e))
 | 
				
			||||||
 | 
					* Set filemode per key ([a6d6e91](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/a6d6e91ffadd13650c0ce44d0c43e96dea3c6711))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [0.8.1](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.0...v0.8.1) (2023-07-14)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Add missing dependency ([6270499](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/6270499efecb8ae1474f1ce29c8f4003da3916df))
 | 
				
			||||||
 | 
					* Fix linebreak ([fa2c72c](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/fa2c72cb68254dd0e27f12220f8056b9223223ed))
 | 
				
			||||||
 | 
					* Refactor update script for bash interpreter ([2725f36](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/2725f360179b3dab1d77d5f429b2f60d4aabcd4a))
 | 
				
			||||||
 | 
					* Workaround for set locale warning ([0af8f2a](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/0af8f2ac5ea0f8453fdb7120aeb7eff15aa88e42))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# [0.8.0](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.7.3...v0.8.0) (2023-07-14)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fix linebreak ([6f07cc8](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/6f07cc8d876d49be0a798772b62f93b09efba110))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Features
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Continuous helm polling to update database ([a5e3c79](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/a5e3c79d10a378336e5a6af267f7d28997cd9a8c))
 | 
				
			||||||
 | 
					* Rebase sidecar container image ([dcb3dec](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/dcb3decbd3d4e1507aba351f11cd4a148822b06b))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [0.7.3](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.7.2...v0.7.3) (2023-07-14)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Missing period in chart template ([0999fdf](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/0999fdf7051d6e8a2161333980bd1aedd9f180ef))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [0.7.2](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.7.1...v0.7.2) (2023-07-14)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Adhere to naming convention in templates ([c551a24](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/c551a242c7a49a445da68ba6e1e5966eeb5ce7d7))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [0.7.1](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.7.0...v0.7.1) (2023-07-14)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Bug Fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Adhere to naming convention in values.yaml ([614fda9](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/614fda9b7d284862bd84a1eab62ba8144f798199))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# [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))
 | 
				
			||||||
							
								
								
									
										29
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,6 +1,31 @@
 | 
				
			|||||||
FROM node:latest
 | 
					FROM alpine:latest AS download
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN npm install -g json-server
 | 
					RUN apk --update add --no-cache \
 | 
				
			||||||
 | 
					       curl \
 | 
				
			||||||
 | 
					       jq && \
 | 
				
			||||||
 | 
					     curl -L https://api.github.com/repos/helm/helm/releases/latest | \
 | 
				
			||||||
 | 
					       jq -r '.tag_name' | \
 | 
				
			||||||
 | 
					       xargs -I {} curl -L -o /tmp/helm.tar.gz https://get.helm.sh/helm-{}-linux-amd64.tar.gz && \
 | 
				
			||||||
 | 
					     tar -xzf /tmp/helm.tar.gz --strip-components=1 -C /tmp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FROM node:lts-slim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY --from=download /tmp/helm /usr/bin/helm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENV LANG en_US.UTF-8
 | 
				
			||||||
 | 
					ENV LANGUAGE en_US:en
 | 
				
			||||||
 | 
					ENV LC_ALL en_US.UTF-8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
 | 
				
			||||||
 | 
					      curl \
 | 
				
			||||||
 | 
					      jq \
 | 
				
			||||||
 | 
					      locales && \
 | 
				
			||||||
 | 
					    sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
 | 
				
			||||||
 | 
					    locale-gen && \
 | 
				
			||||||
 | 
					    npm install -g --omit=optional --omit=dev \
 | 
				
			||||||
 | 
					      json-server && \
 | 
				
			||||||
 | 
					    npm cache clean --force && \
 | 
				
			||||||
 | 
					    rm -rf /var/lib/apt/lists/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY init/entrypoint.sh /opt/entrypoint.sh
 | 
					COPY init/entrypoint.sh /opt/entrypoint.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,10 +6,10 @@ type: application
 | 
				
			|||||||
# This is the chart version. This version number should be incremented each time you make changes
 | 
					# 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.
 | 
					# to the chart and its templates, including the app version.
 | 
				
			||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
 | 
					# Versions are expected to follow Semantic Versioning (https://semver.org/)
 | 
				
			||||||
version: v0.5.1
 | 
					version: v{{ chart_version }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This is the version number of the application being deployed. This version number should be
 | 
					# 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
 | 
					# 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.
 | 
					# follow Semantic Versioning. They should reflect the version the application is using.
 | 
				
			||||||
# It is recommended to use it with quotes.
 | 
					# It is recommended to use it with quotes.
 | 
				
			||||||
appVersion: "v0.5.1"
 | 
					appVersion: "v{{ chart_version }}"
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								charts/json-server/templates/clusterrole.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								charts/json-server/templates/clusterrole.yaml
									
									
									
									
									
										Normal 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"]
 | 
				
			||||||
							
								
								
									
										12
									
								
								charts/json-server/templates/clusterrolebinding.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								charts/json-server/templates/clusterrolebinding.yaml
									
									
									
									
									
										Normal 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
 | 
				
			||||||
@@ -1,9 +1,96 @@
 | 
				
			|||||||
{{- if not .Values.seedData.existingConfigMap }}
 | 
					{{- if not .Values.jsonServer.seedData.existingConfigMap }}
 | 
				
			||||||
apiVersion: v1
 | 
					apiVersion: v1
 | 
				
			||||||
kind: ConfigMap
 | 
					kind: ConfigMap
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
  name: {{ .Release.Name }}-configmap
 | 
					  name: {{ .Release.Name }}-configmap
 | 
				
			||||||
data:
 | 
					data:
 | 
				
			||||||
 | 
					  index.html: |
 | 
				
			||||||
 | 
					    <html>
 | 
				
			||||||
 | 
					      <head>
 | 
				
			||||||
 | 
					        <link
 | 
				
			||||||
 | 
					          rel="stylesheet"
 | 
				
			||||||
 | 
					          href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
 | 
				
			||||||
 | 
					          integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay"
 | 
				
			||||||
 | 
					          crossorigin="anonymous"
 | 
				
			||||||
 | 
					        />
 | 
				
			||||||
 | 
					        <link rel="stylesheet" href="style.css" />
 | 
				
			||||||
 | 
					        <title>JSON Server</title>
 | 
				
			||||||
 | 
					      </head>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <body>
 | 
				
			||||||
 | 
					        <header>
 | 
				
			||||||
 | 
					          <div class="container">
 | 
				
			||||||
 | 
					            <nav>
 | 
				
			||||||
 | 
					              <ul>
 | 
				
			||||||
 | 
					                <li class="title">
 | 
				
			||||||
 | 
					                  JSON Server
 | 
				
			||||||
 | 
					                </li>
 | 
				
			||||||
 | 
					              </ul>
 | 
				
			||||||
 | 
					            </nav>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </header>
 | 
				
			||||||
 | 
					        <main>
 | 
				
			||||||
 | 
					          <div class="container">
 | 
				
			||||||
 | 
					            <h1>Congrats!</h1>
 | 
				
			||||||
 | 
					            <p>
 | 
				
			||||||
 | 
					              You're successfully running JSON Server
 | 
				
			||||||
 | 
					              <br />
 | 
				
			||||||
 | 
					              ✧*。٩(ˊᗜˋ*)و✧*。
 | 
				
			||||||
 | 
					            </p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <div id="resources"></div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </main>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <footer>
 | 
				
			||||||
 | 
					          <div class="container">
 | 
				
			||||||
 | 
					            <p>
 | 
				
			||||||
 | 
					              Howdy mates!
 | 
				
			||||||
 | 
					            </p>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </footer>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <script src="script.js"></script>
 | 
				
			||||||
 | 
					      </body>
 | 
				
			||||||
 | 
					    </html>
 | 
				
			||||||
 | 
					  update.sh: |
 | 
				
			||||||
 | 
					    #!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    while getopts u: flag
 | 
				
			||||||
 | 
					    do
 | 
				
			||||||
 | 
					      case "${flag}" in
 | 
				
			||||||
 | 
					        u) URL=${OPTARG};;
 | 
				
			||||||
 | 
					      esac
 | 
				
			||||||
 | 
					    done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    [[ $(getent hosts $URL) ]] || {
 | 
				
			||||||
 | 
					      echo 'Could not resolve' $URL
 | 
				
			||||||
 | 
					      exit 1
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    echo '['$(date "+%Y-%m-%d %H:%M:%S")'] Started polling helm releases with 60 second interval'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    while sleep 60;
 | 
				
			||||||
 | 
					    do
 | 
				
			||||||
 | 
					      echo '['$(date "+%Y-%m-%d %H:%M:%S")']' $(curl -ks https://$URL/components | jq length) 'known releases in database'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      for entry in $(helm list --all-namespaces --output json | jq -r '.[] | @base64'); do
 | 
				
			||||||
 | 
					        RELEASE=$(echo $entry | base64 -d | jq -cS '.type="helm" | del(.namespace, .revision, .status)')
 | 
				
			||||||
 | 
					        APP_NAME=$(echo $RELEASE | jq -r '.name')
 | 
				
			||||||
 | 
					        APP_ID=$(curl -ks https://$URL/components?name=$APP_NAME | jq -r '.[0].id')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Release is not yet in database
 | 
				
			||||||
 | 
					        [ "$APP_ID" == null ] && {
 | 
				
			||||||
 | 
					          curl -ks -X POST https://$URL/components -H 'Content-Type: application/json' --data "$RELEASE" -o /dev/null
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        # Release is already in database
 | 
				
			||||||
 | 
					        [ "$APP_ID" != null ] && {
 | 
				
			||||||
 | 
					          curl -ks -X PATCH https://$URL/components/$APP_ID -H 'Content-Type: application/json' --data "$RELEASE" -o /dev/null
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    done
 | 
				
			||||||
  db.json: |
 | 
					  db.json: |
 | 
				
			||||||
{{ include "common.tplvalues.render" ( dict "value" .Values.seedData.configInline "context" $) | indent 4 }}
 | 
					{{ include "common.tplvalues.render" ( dict "value" .Values.jsonServer.seedData.configInline "context" $) | indent 4 }}
 | 
				
			||||||
{{- end -}}
 | 
					{{- end -}}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,8 +29,8 @@ spec:
 | 
				
			|||||||
        - name: {{ .Chart.Name }}
 | 
					        - name: {{ .Chart.Name }}
 | 
				
			||||||
          securityContext:
 | 
					          securityContext:
 | 
				
			||||||
            {{- toYaml .Values.securityContext | nindent 12 }}
 | 
					            {{- toYaml .Values.securityContext | nindent 12 }}
 | 
				
			||||||
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
 | 
					          image: "{{ .Values.jsonServer.image.repository }}:{{ .Values.jsonServer.image.tag | default .Chart.AppVersion }}"
 | 
				
			||||||
          imagePullPolicy: {{ .Values.image.pullPolicy }}
 | 
					          imagePullPolicy: {{ .Values.jsonServer.image.pullPolicy }}
 | 
				
			||||||
          ports:
 | 
					          ports:
 | 
				
			||||||
            - name: http
 | 
					            - name: http
 | 
				
			||||||
              containerPort: {{ .Values.service.port }}
 | 
					              containerPort: {{ .Values.service.port }}
 | 
				
			||||||
@@ -49,10 +49,36 @@ spec:
 | 
				
			|||||||
          - name: {{ .Release.Name }}-configmap
 | 
					          - name: {{ .Release.Name }}-configmap
 | 
				
			||||||
            mountPath: /data/db.json
 | 
					            mountPath: /data/db.json
 | 
				
			||||||
            subPath: db.json
 | 
					            subPath: db.json
 | 
				
			||||||
 | 
					          - 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/bash
 | 
				
			||||||
 | 
					          - -c
 | 
				
			||||||
 | 
					          - "/opt/update.sh -u {{ .Values.sidecar.targetUrl }}"
 | 
				
			||||||
 | 
					          volumeMounts:
 | 
				
			||||||
 | 
					          - name: {{ .Release.Name }}-configmap
 | 
				
			||||||
 | 
					            mountPath: /opt/update.sh
 | 
				
			||||||
 | 
					            subPath: update.sh
 | 
				
			||||||
      volumes:
 | 
					      volumes:
 | 
				
			||||||
      - name: {{ .Release.Name }}-configmap
 | 
					      - name: {{ .Release.Name }}-configmap
 | 
				
			||||||
        configMap:
 | 
					        configMap:
 | 
				
			||||||
          name: {{ .Release.Name }}-configmap
 | 
					          name: {{ .Release.Name }}-configmap
 | 
				
			||||||
 | 
					          items:
 | 
				
			||||||
 | 
					          - key: db.json
 | 
				
			||||||
 | 
					            path: db.json
 | 
				
			||||||
 | 
					          - key: index.html
 | 
				
			||||||
 | 
					            path: index.html
 | 
				
			||||||
 | 
					          - key: update.sh
 | 
				
			||||||
 | 
					            path: update.sh
 | 
				
			||||||
 | 
					            mode: 0744
 | 
				
			||||||
      {{- with .Values.nodeSelector }}
 | 
					      {{- with .Values.nodeSelector }}
 | 
				
			||||||
      nodeSelector:
 | 
					      nodeSelector:
 | 
				
			||||||
        {{- toYaml . | nindent 8 }}
 | 
					        {{- toYaml . | nindent 8 }}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,17 +1,26 @@
 | 
				
			|||||||
# Default values for json-server.
 | 
					# Default values for json-server.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jsonServer:
 | 
				
			||||||
  seedData:
 | 
					  seedData:
 | 
				
			||||||
    # Not implemented yet
 | 
					    # Not implemented yet
 | 
				
			||||||
    # existingConfigMap: ""
 | 
					    # existingConfigMap: ""
 | 
				
			||||||
    configInline: {}
 | 
					    configInline: {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
replicaCount: 1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  image:
 | 
					  image:
 | 
				
			||||||
  repository: bv11-cr01.bessems.eu/library/json-server
 | 
					    repository: code.spamasaurus.com/djpbessems/json-server
 | 
				
			||||||
    pullPolicy: IfNotPresent
 | 
					    pullPolicy: IfNotPresent
 | 
				
			||||||
    # Overrides the image tag whose default is the chart appVersion.
 | 
					    # Overrides the image tag whose default is the chart appVersion.
 | 
				
			||||||
  tag: latest
 | 
					    tag: {{ image_tag }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sidecar:
 | 
				
			||||||
 | 
					  targetUrl: metadata.example.org
 | 
				
			||||||
 | 
					  image:
 | 
				
			||||||
 | 
					    repository: code.spamasaurus.com/djpbessems/json-server
 | 
				
			||||||
 | 
					    pullPolicy: IfNotPresent
 | 
				
			||||||
 | 
					    # Overrides the image tag whose default is the chart appVersion.
 | 
				
			||||||
 | 
					    tag: {{ image_tag }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					replicaCount: 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
imagePullSecrets: []
 | 
					imagePullSecrets: []
 | 
				
			||||||
nameOverride: ""
 | 
					nameOverride: ""
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6973
									
								
								package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										6973
									
								
								package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										10
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					  "dependencies": {
 | 
				
			||||||
 | 
					    "@semantic-release/changelog": "^6.0.3",
 | 
				
			||||||
 | 
					    "@semantic-release/commit-analyzer": "^10.0.4",
 | 
				
			||||||
 | 
					    "@semantic-release/exec": "^6.0.3",
 | 
				
			||||||
 | 
					    "@semantic-release/git": "^10.0.1",
 | 
				
			||||||
 | 
					    "@semantic-release/release-notes-generator": "^11.0.7",
 | 
				
			||||||
 | 
					    "semantic-release": "^21.1.2"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user