Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/chart-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,26 @@ jobs:
sed -i "s/^version: .*/version: ${PREVIEW_VERSION}/" chart/Chart.yaml
echo "PREVIEW_VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV

- name: Set registry owner
run: echo "REGISTRY_OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Package and push
run: |
helm package ./chart
helm push theia-shared-cache-${PREVIEW_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
helm push theia-shared-cache-${PREVIEW_VERSION}.tgz oci://ghcr.io/${{ env.REGISTRY_OWNER }}/charts

- name: Comment install instructions
uses: marocchino/sticky-pull-request-comment@v2
with:
header: chart-preview
message: |
## 📦 Chart Preview Ready
## Chart Preview Ready

```bash
helm install test oci://ghcr.io/${{ github.repository_owner }}/charts/theia-shared-cache --version ${{ env.PREVIEW_VERSION }}
helm install test oci://ghcr.io/${{ env.REGISTRY_OWNER }}/charts/theia-shared-cache --version ${{ env.PREVIEW_VERSION }}
```

_Updated: ${{ github.sha }}_
33 changes: 23 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,40 @@ jobs:
release:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"

- name: Install Helm
uses: azure/setup-helm@v4

- name: Update chart dependencies
run: helm dependency update ./chart

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Set registry owner
run: echo "REGISTRY_OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Extract chart version
id: chart
run: |
VERSION=$(grep '^version:' chart/Chart.yaml | awk '{print $2}')
echo "version=${VERSION}" >> $GITHUB_OUTPUT

- name: Package and push to OCI
run: |
helm package ./chart
helm push theia-shared-cache-${{ steps.chart.outputs.version }}.tgz oci://ghcr.io/${{ env.REGISTRY_OWNER }}/charts

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
charts_dir: "."
tag_name: theia-shared-cache-${{ steps.chart.outputs.version }}
name: theia-shared-cache ${{ steps.chart.outputs.version }}
generate_release_notes: true
16 changes: 4 additions & 12 deletions chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,21 @@ Gradle Build Cache has been deployed!
url = uri("$CACHE_URL/cache/")
{{- if .Values.auth.enabled }}
credentials {
username = "{{ .Values.auth.username }}"
username = "{{ .Values.auth.reader.username }}"
password = "<your-password>"
}
{{- end }}
isPush = true
}
}

5. MinIO console (for debugging):

kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }}-minio 9001:9001

Then open http://localhost:9001
Username: minioadmin
Password: minioadmin
{{- else }}
Gradle Build Cache is disabled (enabled: false).
No resources have been deployed.
{{- end }}

{{- if .Values.reposilite.enabled }}

6. Reposilite (Maven/Gradle Dependency Proxy):
5. Reposilite (Maven/Gradle Dependency Proxy):

Internal URL: http://{{ .Release.Name }}-reposilite:8080

Expand All @@ -57,10 +49,10 @@ No resources have been deployed.
Maven repository URL (for Gradle):
http://{{ .Release.Name }}-reposilite:8080/releases

7. Theia Pod Configuration:
6. Theia Pod Configuration:

Set these environment variables in your Theia pods:

GRADLE_CACHE_URL=http://{{ .Release.Name }}-cache:8080/cache/
GRADLE_REPO_URL=http://{{ .Release.Name }}-reposilite:8080/releases
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
app.kubernetes.io/component: cache-server
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/auth-secrets.yaml") . | sha256sum }}
spec:
initContainers:
- name: wait-for-redis
Expand Down