Compare commits
4 Commits
99fd37bfd8
...
20c9d2eaf4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20c9d2eaf4 | ||
|
|
a379b26808 | ||
|
|
f9d529ac87 | ||
|
|
fb396ac71a |
@@ -79,68 +79,3 @@ jobs:
|
|||||||
labels: ${{ steps.meta-api.outputs.labels }}
|
labels: ${{ steps.meta-api.outputs.labels }}
|
||||||
cache-from: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:buildcache
|
cache-from: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:buildcache
|
||||||
cache-to: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:buildcache,mode=max
|
cache-to: type=registry,ref=${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:buildcache,mode=max
|
||||||
|
|
||||||
build-helm:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [build-web, build-api]
|
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Fetch all history for proper versioning
|
|
||||||
|
|
||||||
- name: Install Helm
|
|
||||||
uses: azure/setup-helm@v3
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
|
|
||||||
- name: Update Chart dependencies
|
|
||||||
run: |
|
|
||||||
cd helm/api7ee
|
|
||||||
helm dependency update
|
|
||||||
|
|
||||||
- name: Lint Helm chart
|
|
||||||
run: |
|
|
||||||
helm lint helm/api7ee/
|
|
||||||
|
|
||||||
- name: Package Helm chart
|
|
||||||
run: |
|
|
||||||
# Get version from Chart.yaml
|
|
||||||
CHART_VERSION=$(grep '^version:' helm/api7ee/Chart.yaml | awk '{print $2}')
|
|
||||||
|
|
||||||
# Update image registry and repository in values.yaml to match Gitea
|
|
||||||
sed -i "s|registry: gitea.server_url|registry: ${{ gitea.server_url }}|g" helm/api7ee/values.yaml
|
|
||||||
sed -i "s|repository: gitea.repository/|repository: ${{ gitea.repository }}/|g" helm/api7ee/values.yaml
|
|
||||||
|
|
||||||
# Package the chart
|
|
||||||
helm package helm/api7ee/ --version ${CHART_VERSION}
|
|
||||||
|
|
||||||
# Store chart filename for later use
|
|
||||||
echo "CHART_FILE=api7ee-${CHART_VERSION}.tgz" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Push Helm chart to Gitea Package Registry
|
|
||||||
run: |
|
|
||||||
# Upload Helm chart to Gitea package registry
|
|
||||||
# Format: https://{gitea-server}/api/packages/{owner}/helm/api/charts
|
|
||||||
curl --fail-with-body \
|
|
||||||
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
|
||||||
-X POST \
|
|
||||||
-F "chart=@${CHART_FILE}" \
|
|
||||||
https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm/api/charts
|
|
||||||
|
|
||||||
echo "✅ Helm chart pushed successfully to Gitea Package Registry"
|
|
||||||
echo "📦 Chart: ${CHART_FILE}"
|
|
||||||
echo "🔗 Registry URL: https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm"
|
|
||||||
|
|
||||||
- name: Create Helm index
|
|
||||||
if: success()
|
|
||||||
run: |
|
|
||||||
# Create or update the Helm repository index
|
|
||||||
echo "📝 Helm chart repository information:"
|
|
||||||
echo "To add this repository:"
|
|
||||||
echo " helm repo add api7ee https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm"
|
|
||||||
echo " helm repo update"
|
|
||||||
echo ""
|
|
||||||
echo "To install the chart:"
|
|
||||||
echo " helm install my-api7ee api7ee/api7ee"
|
|
||||||
|
|||||||
@@ -1,20 +1,29 @@
|
|||||||
name: Helm Chart Release
|
name: Helm Chart Build and Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*' # Trigger release if tag matches Chart.yaml version
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Expected Chart.yaml version (for validation only)'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-helm:
|
build-and-release-helm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Only run on main branch pushes or tags (not on PRs)
|
||||||
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0 # Fetch all history for proper versioning
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v3
|
uses: azure/setup-helm@v3
|
||||||
@@ -24,48 +33,99 @@ jobs:
|
|||||||
- name: Determine version
|
- name: Determine version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
# Always get version from Chart.yaml
|
||||||
VERSION="${{ github.event.inputs.version }}"
|
VERSION=$(grep '^version:' helm/api7ee-demo-k8s/Chart.yaml | awk '{print $2}')
|
||||||
|
|
||||||
|
# Determine if this is a release based on triggers
|
||||||
|
IS_RELEASE="false"
|
||||||
|
|
||||||
|
# Check if this is a tag push that matches the chart version
|
||||||
|
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||||
|
TAG_VERSION=${GITEA_REF_NAME#v}
|
||||||
|
if [ "$TAG_VERSION" = "$VERSION" ]; then
|
||||||
|
IS_RELEASE="true"
|
||||||
|
echo "📌 Release version (tag matches Chart.yaml): ${VERSION}"
|
||||||
|
else
|
||||||
|
echo "⚠️ Warning: Tag version ($TAG_VERSION) doesn't match Chart.yaml version ($VERSION)"
|
||||||
|
echo "📌 Using Chart.yaml version: ${VERSION}"
|
||||||
|
fi
|
||||||
|
elif [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then
|
||||||
|
# Manual trigger with version - treat as release if version matches
|
||||||
|
INPUT_VERSION="${{ github.event.inputs.version }}"
|
||||||
|
if [ "$INPUT_VERSION" = "$VERSION" ]; then
|
||||||
|
IS_RELEASE="true"
|
||||||
|
echo "📌 Manual release for version: ${VERSION}"
|
||||||
|
else
|
||||||
|
echo "⚠️ Warning: Input version ($INPUT_VERSION) doesn't match Chart.yaml version ($VERSION)"
|
||||||
|
echo "📌 Using Chart.yaml version: ${VERSION}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# Extract version from tag (remove 'v' prefix)
|
echo "📌 Development build with version: ${VERSION}"
|
||||||
VERSION=${GITEA_REF_NAME#v}
|
|
||||||
fi
|
fi
|
||||||
echo "VERSION=${VERSION}"
|
|
||||||
# Export for subsequent steps
|
|
||||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||||
echo "📌 Chart version: ${VERSION}"
|
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_ENV
|
||||||
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
- name: Update Chart version
|
echo "is_release=${IS_RELEASE}" >> $GITHUB_OUTPUT
|
||||||
run: |
|
|
||||||
# Update Chart.yaml with the new version
|
|
||||||
sed -i "s/^version:.*/version: ${VERSION}/" helm/api7ee/Chart.yaml
|
|
||||||
|
|
||||||
# Update appVersion to match
|
|
||||||
sed -i "s/^appVersion:.*/appVersion: \"${VERSION}\"/" helm/api7ee/Chart.yaml
|
|
||||||
|
|
||||||
# Update image tags in values.yaml to use this version
|
|
||||||
sed -i "s|tag: \"main\"|tag: \"v${VERSION}\"|g" helm/api7ee/values.yaml
|
|
||||||
|
|
||||||
# Update registry and repository to Gitea values
|
|
||||||
sed -i "s|registry: gitea.server_url|registry: ${{ gitea.server_url }}|g" helm/api7ee/values.yaml
|
|
||||||
sed -i "s|repository: gitea.repository/|repository: ${{ gitea.repository }}/|g" helm/api7ee/values.yaml
|
|
||||||
|
|
||||||
echo "📝 Updated Chart.yaml and values.yaml with version ${VERSION}"
|
|
||||||
|
|
||||||
- name: Lint Helm chart
|
- name: Lint Helm chart
|
||||||
run: |
|
run: |
|
||||||
helm lint helm/api7ee/
|
helm lint helm/api7ee-demo-k8s/
|
||||||
|
|
||||||
|
- name: Prepare Helm chart for packaging
|
||||||
|
run: |
|
||||||
|
# Create a temporary copy of the chart for packaging
|
||||||
|
cp -r helm/api7ee-demo-k8s /tmp/api7ee-demo-k8s-chart
|
||||||
|
|
||||||
|
# Update image registry and repository to match Gitea
|
||||||
|
sed -i "s|registry: gitea.server_url|registry: ${{ gitea.server_url }}|g" /tmp/api7ee-demo-k8s-chart/values.yaml
|
||||||
|
sed -i "s|repository: gitea.repository/|repository: ${{ gitea.repository }}/|g" /tmp/api7ee-demo-k8s-chart/values.yaml
|
||||||
|
|
||||||
|
# For releases, update image tags to use the version tag
|
||||||
|
if [ "${IS_RELEASE}" = "true" ]; then
|
||||||
|
# Update image tags to use the release version
|
||||||
|
sed -i "s|tag: \"main\"|tag: \"v${VERSION}\"|g" /tmp/api7ee-demo-k8s-chart/values.yaml
|
||||||
|
echo "📝 Chart prepared for release with version ${VERSION}"
|
||||||
|
else
|
||||||
|
# Keep main tag for development builds
|
||||||
|
echo "📝 Chart prepared for development with version ${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Package Helm chart
|
- name: Package Helm chart
|
||||||
run: |
|
run: |
|
||||||
helm package helm/api7ee/ --version ${VERSION}
|
# Package using the version from Chart.yaml
|
||||||
echo "CHART_FILE=api7ee-${VERSION}.tgz" >> $GITHUB_ENV
|
helm package /tmp/api7ee-demo-k8s-chart
|
||||||
|
|
||||||
# Generate chart README with installation instructions
|
# Store chart filename for later use
|
||||||
cat > CHART_README.md << EOF
|
echo "CHART_FILE=api7ee-demo-k8s-${VERSION}.tgz" >> $GITHUB_ENV
|
||||||
# API7 Enterprise Edition Helm Chart v${VERSION}
|
|
||||||
|
|
||||||
## Installation
|
echo "📦 Packaged chart: api7ee-demo-k8s-${VERSION}.tgz"
|
||||||
|
|
||||||
|
- name: Push Helm chart to Gitea Package Registry
|
||||||
|
run: |
|
||||||
|
# Upload Helm chart to Gitea package registry
|
||||||
|
echo "📤 Uploading chart to Gitea Package Registry..."
|
||||||
|
|
||||||
|
curl --fail-with-body \
|
||||||
|
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
||||||
|
-X POST \
|
||||||
|
-F "chart=@${CHART_FILE}" \
|
||||||
|
https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm/api/charts
|
||||||
|
|
||||||
|
echo "✅ Helm chart pushed successfully to Gitea Package Registry"
|
||||||
|
echo "📦 Chart: ${CHART_FILE}"
|
||||||
|
echo "🔗 Registry URL: https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm"
|
||||||
|
|
||||||
|
- name: Create Release (for tagged versions only)
|
||||||
|
if: env.IS_RELEASE == 'true'
|
||||||
|
run: |
|
||||||
|
echo "🎉 Creating release for version ${VERSION}"
|
||||||
|
|
||||||
|
# Generate release notes
|
||||||
|
cat > RELEASE_NOTES.md << EOF
|
||||||
|
## Helm Chart Release v${VERSION}
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
\`\`\`bash
|
\`\`\`bash
|
||||||
# Add the Helm repository
|
# Add the Helm repository
|
||||||
@@ -73,54 +133,46 @@ jobs:
|
|||||||
helm repo update
|
helm repo update
|
||||||
|
|
||||||
# Install the chart
|
# Install the chart
|
||||||
helm install my-api7ee api7ee/api7ee --version ${VERSION}
|
helm install my-api7ee api7ee/api7ee-demo-k8s --version ${VERSION}
|
||||||
|
|
||||||
# Install with custom values
|
# Install with custom values
|
||||||
helm install my-api7ee api7ee/api7ee --version ${VERSION} -f values.yaml
|
helm install my-api7ee api7ee/api7ee-demo-k8s --version ${VERSION} -f values.yaml
|
||||||
\`\`\`
|
\`\`\`
|
||||||
|
|
||||||
## Upgrade
|
### Upgrade
|
||||||
|
|
||||||
\`\`\`bash
|
\`\`\`bash
|
||||||
helm upgrade my-api7ee api7ee/api7ee --version ${VERSION}
|
helm upgrade my-api7ee api7ee/api7ee-demo-k8s --version ${VERSION}
|
||||||
\`\`\`
|
\`\`\`
|
||||||
|
|
||||||
## Docker Images
|
### Docker Images
|
||||||
|
|
||||||
This chart uses the following Docker images:
|
This chart uses the following Docker images:
|
||||||
- Web: \`${{ gitea.server_url }}/${{ gitea.repository }}/web:v${VERSION}\`
|
- Web: \`${{ gitea.server_url }}/${{ gitea.repository }}/web:v${VERSION}\`
|
||||||
- API: \`${{ gitea.server_url }}/${{ gitea.repository }}/api:v${VERSION}\`
|
- API: \`${{ gitea.server_url }}/${{ gitea.repository }}/api:v${VERSION}\`
|
||||||
|
|
||||||
|
### Chart Download
|
||||||
|
|
||||||
|
Direct download: [api7ee-demo-k8s-${VERSION}.tgz](https://${{ gitea.server_url }}/${{ gitea.repository }}/releases/download/v${VERSION}/api7ee-demo-k8s-${VERSION}.tgz)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Push Helm chart to Gitea Package Registry
|
|
||||||
run: |
|
|
||||||
# Upload versioned Helm chart
|
|
||||||
curl --fail-with-body \
|
|
||||||
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
|
||||||
-X POST \
|
|
||||||
-F "chart=@${CHART_FILE}" \
|
|
||||||
https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm/api/charts
|
|
||||||
|
|
||||||
echo "✅ Helm chart v${VERSION} pushed to Gitea Package Registry"
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
run: |
|
|
||||||
# Create release using Gitea API
|
# Create release using Gitea API
|
||||||
RELEASE_DATA=$(cat <<EOF
|
RELEASE_DATA=$(jq -n \
|
||||||
{
|
--arg tag "v${VERSION}" \
|
||||||
"tag_name": "v${VERSION}",
|
--arg name "v${VERSION}" \
|
||||||
"target_commitish": "${{ gitea.sha }}",
|
--arg body "$(cat RELEASE_NOTES.md)" \
|
||||||
"name": "v${VERSION}",
|
--arg target "${{ gitea.sha }}" \
|
||||||
"body": "## Helm Chart Release v${VERSION}\n\n### Installation\n\`\`\`bash\nhelm repo add api7ee https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm\nhelm repo update\nhelm install my-api7ee api7ee/api7ee --version ${VERSION}\n\`\`\`\n\n### Docker Images\n- Web: \`${{ gitea.server_url }}/${{ gitea.repository }}/web:v${VERSION}\`\n- API: \`${{ gitea.server_url }}/${{ gitea.repository }}/api:v${VERSION}\`\n\n### Chart Package\n- Download: [api7ee-${VERSION}.tgz](https://${{ gitea.server_url }}/${{ gitea.repository }}/releases/download/v${VERSION}/api7ee-${VERSION}.tgz)",
|
'{
|
||||||
"draft": false,
|
tag_name: $tag,
|
||||||
"prerelease": false
|
target_commitish: $target,
|
||||||
}
|
name: $name,
|
||||||
EOF
|
body: $body,
|
||||||
)
|
draft: false,
|
||||||
|
prerelease: false
|
||||||
|
}')
|
||||||
|
|
||||||
# Create the release
|
# Create the release
|
||||||
RELEASE_RESPONSE=$(curl -X POST \
|
RELEASE_RESPONSE=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "${RELEASE_DATA}" \
|
-d "${RELEASE_DATA}" \
|
||||||
@@ -137,14 +189,14 @@ jobs:
|
|||||||
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
||||||
-H "Content-Type: application/gzip" \
|
-H "Content-Type: application/gzip" \
|
||||||
--data-binary "@${CHART_FILE}" \
|
--data-binary "@${CHART_FILE}" \
|
||||||
"https://${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=api7ee-${VERSION}.tgz"
|
"https://${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=api7ee-demo-k8s-${VERSION}.tgz"
|
||||||
|
|
||||||
# Upload README as release asset
|
# Upload release notes as asset
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.PACKAGES_PUSH_TOKEN }}" \
|
||||||
-H "Content-Type: text/markdown" \
|
-H "Content-Type: text/markdown" \
|
||||||
--data-binary "@CHART_README.md" \
|
--data-binary "@RELEASE_NOTES.md" \
|
||||||
"https://${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=CHART_README.md"
|
"https://${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=RELEASE_NOTES.md"
|
||||||
|
|
||||||
echo "✅ Release assets uploaded successfully"
|
echo "✅ Release assets uploaded successfully"
|
||||||
else
|
else
|
||||||
@@ -154,9 +206,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
run: |
|
run: |
|
||||||
echo "## 🎉 Helm Chart Release Summary"
|
echo "## 🎉 Helm Chart Build Summary"
|
||||||
echo ""
|
echo ""
|
||||||
echo "- **Version:** v${VERSION}"
|
echo "- **Version:** ${VERSION}"
|
||||||
|
echo "- **Type:** $([ "${IS_RELEASE}" = "true" ] && echo "Release" || echo "Development Build")"
|
||||||
|
echo "- **Source:** Chart.yaml version (not modified)"
|
||||||
echo "- **Chart:** ${CHART_FILE}"
|
echo "- **Chart:** ${CHART_FILE}"
|
||||||
echo "- **Registry:** https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm"
|
echo "- **Registry:** https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -164,5 +218,24 @@ jobs:
|
|||||||
echo '```bash'
|
echo '```bash'
|
||||||
echo "helm repo add api7ee https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm"
|
echo "helm repo add api7ee https://${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/helm"
|
||||||
echo "helm repo update"
|
echo "helm repo update"
|
||||||
echo "helm install my-api7ee api7ee/api7ee --version ${VERSION}"
|
echo "helm install my-api7ee api7ee/api7ee-demo-k8s --version ${VERSION}"
|
||||||
echo '```'
|
echo '```'
|
||||||
|
|
||||||
|
lint-only:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Only run on PRs
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Helm
|
||||||
|
uses: azure/setup-helm@v3
|
||||||
|
with:
|
||||||
|
version: "latest"
|
||||||
|
|
||||||
|
- name: Lint Helm chart
|
||||||
|
run: |
|
||||||
|
echo "🔍 Linting Helm chart for PR..."
|
||||||
|
helm lint helm/api7ee-demo-k8s/
|
||||||
|
echo "✅ Helm chart linting passed"
|
||||||
22
README.md
22
README.md
@@ -89,12 +89,20 @@ docker run -p 8001:8000 api-app
|
|||||||
|
|
||||||
### Automated Pipeline
|
### Automated Pipeline
|
||||||
|
|
||||||
The `.gitea/workflows/build.yml` pipeline automatically:
|
The CI/CD workflows automatically:
|
||||||
|
|
||||||
|
**`.gitea/workflows/build.yml`**:
|
||||||
1. Builds Docker images for both applications
|
1. Builds Docker images for both applications
|
||||||
2. Pushes to Gitea container registry
|
2. Pushes to Gitea container registry
|
||||||
3. Tags images with branch name
|
3. Tags images with branch name
|
||||||
4. Packages and publishes Helm chart
|
4. Implements layer caching for faster builds
|
||||||
5. Implements layer caching for faster builds
|
|
||||||
|
**`.gitea/workflows/helm-release.yml`**:
|
||||||
|
1. Packages Helm charts on every main branch push
|
||||||
|
2. Creates development versions for main branch builds
|
||||||
|
3. Creates release versions for tags (v*.*.*)
|
||||||
|
4. Publishes charts to Gitea Helm registry
|
||||||
|
5. Creates GitHub releases for tagged versions
|
||||||
|
|
||||||
**Triggers:**
|
**Triggers:**
|
||||||
- Any branch push (Docker images)
|
- Any branch push (Docker images)
|
||||||
@@ -149,13 +157,13 @@ helm repo update
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install with default values
|
# Install with default values
|
||||||
helm install my-api7ee api7ee/api7ee --namespace api7ee --create-namespace
|
helm install my-api7ee api7ee/api7ee-demo-k8s --namespace api7ee --create-namespace
|
||||||
|
|
||||||
# Install with custom values
|
# Install with custom values
|
||||||
helm install my-api7ee api7ee/api7ee -f custom-values.yaml --namespace api7ee
|
helm install my-api7ee api7ee/api7ee-demo-k8s -f custom-values.yaml --namespace api7ee
|
||||||
|
|
||||||
# Install with specific image tags
|
# Install with specific image tags
|
||||||
helm install my-api7ee api7ee/api7ee \
|
helm install my-api7ee api7ee/api7ee-demo-k8s \
|
||||||
--set web.image.tag=v1.0.0 \
|
--set web.image.tag=v1.0.0 \
|
||||||
--set api.image.tag=v1.0.0 \
|
--set api.image.tag=v1.0.0 \
|
||||||
--namespace api7ee
|
--namespace api7ee
|
||||||
@@ -178,7 +186,7 @@ Key Helm values:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Upgrade the release
|
# Upgrade the release
|
||||||
helm upgrade my-api7ee api7ee/api7ee --namespace api7ee
|
helm upgrade my-api7ee api7ee/api7ee-demo-k8s --namespace api7ee
|
||||||
|
|
||||||
# Uninstall
|
# Uninstall
|
||||||
helm uninstall my-api7ee --namespace api7ee
|
helm uninstall my-api7ee --namespace api7ee
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: api7ee
|
name: api7ee-demo-k8s
|
||||||
description: A Helm chart for API7 Enterprise Edition demo application
|
description: A Helm chart for API7 Enterprise Edition demo application
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
@@ -22,13 +22,13 @@ helm repo update
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install with default values
|
# Install with default values
|
||||||
helm install my-api7ee ./helm/api7ee
|
helm install my-api7ee ./helm/api7ee-demo-k8s-demo-k8s
|
||||||
|
|
||||||
# Install in a specific namespace
|
# Install in a specific namespace
|
||||||
helm install my-api7ee ./helm/api7ee --namespace api7ee --create-namespace
|
helm install my-api7ee ./helm/api7ee-demo-k8s-demo-k8s --namespace api7ee --create-namespace
|
||||||
|
|
||||||
# Install with custom values file
|
# Install with custom values file
|
||||||
helm install my-api7ee ./helm/api7ee -f custom-values.yaml
|
helm install my-api7ee ./helm/api7ee-demo-k8s-demo-k8s -f custom-values.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
@@ -131,10 +131,10 @@ api:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Upgrade to a new version
|
# Upgrade to a new version
|
||||||
helm upgrade my-api7ee ./helm/api7ee
|
helm upgrade my-api7ee ./helm/api7ee-demo-k8s-demo-k8s
|
||||||
|
|
||||||
# Upgrade with new values
|
# Upgrade with new values
|
||||||
helm upgrade my-api7ee ./helm/api7ee --set web.replicaCount=3
|
helm upgrade my-api7ee ./helm/api7ee-demo-k8s-demo-k8s --set web.replicaCount=3
|
||||||
```
|
```
|
||||||
|
|
||||||
## Uninstallation
|
## Uninstallation
|
||||||
Reference in New Issue
Block a user