Skip to content

Commit

Permalink
Add gradle-build-cache chart
Browse files Browse the repository at this point in the history
  • Loading branch information
EugenMayer committed Nov 4, 2024
1 parent dc15beb commit 31bdff8
Show file tree
Hide file tree
Showing 14 changed files with 173 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ package-all:
cr package charts/longhorn-backup-config
cr package charts/iobroker
cr package charts/network-tools
cr package charts/gradle-build-cache

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ So it is not a 'how to learn to run rundeck' kind of project. Thank you for resp
- [ioBroker](charts/iobroker): Home automation ioBroker
- [longhorn-backup-config](charts/longhorn-backup-config): Longhorn backup configuration (CRD)
- [network-tools](charts/network-tools): Multi-Pod network debugging tools
- [gradle-build-cache](charts/gradle-build-cache) Remote and centralized gradle build cache server
- [nist-data-mirror (deprecated)](charts/nist-data-mirror)

## Releasing
Expand Down
6 changes: 6 additions & 0 deletions charts/gradle-build-cache/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: oci://tccr.io/truecharts
version: 25.1.5
digest: sha256:5f5fa138644171c40fa54ed35f2a9d068215ed673116eea07e9a42fc35f2795b
generated: "2024-11-04T14:17:42.593063108+01:00"
24 changes: 24 additions & 0 deletions charts/gradle-build-cache/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
kubeVersion: ">=1.24.0-0"
apiVersion: v2
name: gradle-build-cache
version: 0.0.1
appVersion: 20.0
description: Hosts the official gradle build cache node
home: https://github.com/EugenMayer/helm-charts/tree/main/charts/gradle-build-cache
deprecated: false
keywords:
- network
- tools
- development
sources:
- https://github.com/EugenMayer/helm-charts/tree/main/charts/gradle-build-cache
dependencies:
- name: common
# https://github.com/truecharts/public/blob/master/charts/library/common/Chart.yaml
version: 25.1.5
repository: oci://tccr.io/truecharts
condition: ""
alias: ""
tags: []
import-values: []
type: application
2 changes: 2 additions & 0 deletions charts/gradle-build-cache/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
update:
helm dependency update
29 changes: 29 additions & 0 deletions charts/gradle-build-cache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# WAT

Lets you host the gradle build cache on your k8s cluster - uses the official [docker container](https://hub.docker.com/r/gradle/build-cache-node/).

### Config

If you want to provide a config, you need to deploy a secret with the key `config.yaml`, holding the configuration as
a base64 encoded string. See the (official docs)(https://docs.gradle.com/build-cache-node/#editing_the_file).
You will then need to enable it in the `persistence.config-secret`, and if you used a custom name,
override `objectName`

```yaml
persistence:
config-secret:
enabled: true
objectName: 'gradle-cache-config'
```
### Volumes / PVC
By default the cached mirror data is persistence, see persistence in [values.yml](./values.yaml)
### Values
Check the [values.yml](./values.yaml) file
# Credits
All the credits to [gradles build cache](https://docs.gradle.com/build-cache-node/) doing the actual work.
Binary file not shown.
1 change: 1 addition & 0 deletions charts/gradle-build-cache/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}
1 change: 1 addition & 0 deletions charts/gradle-build-cache/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tc.v1.common.loader.all" . }}
103 changes: 103 additions & 0 deletions charts/gradle-build-cache/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
image:
repository: gradle/build-cache-node
tag: "20.0"
pullPolicy: Always

service:
main:
ports:
main:
port: 5071
targetPort: 5071

workload:
main:
replicas: 1
strategy: Recreate
type: Deployment
podSpec:
initContainers:
init-config:
enabled: true
type: init
imageSelector: image
# we need to copy the config since mounting the secret would make the file read only
# which crashes the build cache server (required rw). So we jump through hoops
command:
- /bin/sh
- -ce
args:
- |
echo "Copying config.yaml file..."
if [ -f /tmp/conf/config.yaml ]; then
cp /tmp/conf/config.yaml /data/conf/config.yaml
echo "...done"
else
echo 'config.yaml does not exist'
fi
containers:
main:
args:
- start
probes:
startup:
enabled: true
port: 5071
type: tcp
spec:
initialDelaySeconds: 5
periodSeconds: 3
failureThreshold: 6
readiness:
enabled: true
port: 5071
type: tcp
spec:
initialDelaySeconds: 5
periodSeconds: 3
failureThreshold: 6
liveness:
enabled: true
type: tcp
port: 5071
spec:
initialDelaySeconds: 1
periodSeconds: 5
failureThreshold: 3

securityContext:
container:
readOnlyRootFilesystem: false
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0

persistence:
cache:
enabled: true
size: 1Gi
mountPath: "/data/system"
config:
enabled: true
size: 1Mi
mountPath: "/data/conf"
targetSelectAll: all
type: emptyDir
config-secret:
# Enable if you want to preseed a config
enabled: false
type: secret
objectName: 'gradle-cache-config'
expandObjectName: false
targetSelector:
main:
init-config:
# this secret needs to have a property called 'config.yaml' that is the base64 encoded gradle-cache config
# see https://docs.gradle.com/build-cache-node/#editing_the_file
mountPath: "/tmp/conf/config.yaml"
subPath: 'config.yaml'

portal:
open:
enabled: false

2 changes: 1 addition & 1 deletion charts/postgres-pgdump-backup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sources:
home: https://github.com/EugenMayer/helm-charts/tree/main/charts/postgres-pgdump-backup
dependencies:
- name: common
# https://github.com/truecharts/library-charts/blob/main/library/common/Chart.yaml
# https://github.com/truecharts/public/blob/master/charts/library/common/Chart.yaml
version: 25.0.0
repository: oci://tccr.io/truecharts
condition: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/vulnz-nvd-mirror/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sources:
- https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz
dependencies:
- name: common
# https://github.com/truecharts/library-charts/blob/main/library/common/Chart.yaml
# https://github.com/truecharts/public/blob/master/charts/library/common/Chart.yaml
version: 25.0.0
repository: oci://tccr.io/truecharts
condition: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/whatsmyip/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sources:
- https://github.com/jeremylong/Open-Vulnerability-Project/vulnz
dependencies:
- name: common
# https://github.com/truecharts/library-charts/blob/main/library/common/Chart.yaml
# https://github.com/truecharts/public/blob/master/charts/library/common/Chart.yaml
version: 25.0.0
repository: oci://tccr.io/truecharts
condition: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/whoami/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sources:
- https://github.com/jeremylong/Open-Vulnerability-Project/vulnz
dependencies:
- name: common
# https://github.com/truecharts/library-charts/blob/main/library/common/Chart.yaml
# https://github.com/truecharts/public/blob/master/charts/library/common/Chart.yaml
version: 25.0.0
repository: oci://tccr.io/truecharts
condition: ''
Expand Down

0 comments on commit 31bdff8

Please sign in to comment.