Compare commits
3 Commits
93afe8b187
...
auto-updat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee3fe94de6 | ||
| 860f83445a | |||
| 8e1e20f478 |
@@ -72,12 +72,9 @@ jobs:
|
|||||||
echo "🌿 Creating branch: $BRANCH_NAME"
|
echo "🌿 Creating branch: $BRANCH_NAME"
|
||||||
git checkout -b "$BRANCH_NAME"
|
git checkout -b "$BRANCH_NAME"
|
||||||
git add README.md
|
git add README.md
|
||||||
git commit -m "Auto-update README with current k8s applications
|
git commit -m "Auto-update README with current k8s applications" \
|
||||||
|
-m "Generated by CI/CD workflow on $(date +%Y-%m-%d\ %H:%M:%S)" \
|
||||||
Generated by CI/CD workflow on $(date +%Y-%m-%d\ %H:%M:%S)
|
-m "This PR updates the README.md file with the current list of applications found in the k8s/ directory structure."
|
||||||
|
|
||||||
This PR updates the README.md file with the current list of applications
|
|
||||||
found in the k8s/ directory structure."
|
|
||||||
|
|
||||||
# Push branch to remote
|
# Push branch to remote
|
||||||
echo "📤 Pushing branch to remote..."
|
echo "📤 Pushing branch to remote..."
|
||||||
@@ -87,35 +84,39 @@ found in the k8s/ directory structure."
|
|||||||
echo "🔀 Creating Pull Request..."
|
echo "🔀 Creating Pull Request..."
|
||||||
|
|
||||||
PR_TITLE="Auto-update README with k8s applications"
|
PR_TITLE="Auto-update README with k8s applications"
|
||||||
PR_BODY="This PR automatically updates README.md based on the current k8s/ directory structure.
|
|
||||||
|
|
||||||
## Changes
|
# Create PR body
|
||||||
- Updated application list in README.md
|
cat > /tmp/pr_body.json <<EOF
|
||||||
- Applications are now synced with k8s/ folders
|
{
|
||||||
|
"title": "$PR_TITLE",
|
||||||
## Review
|
"body": "This PR automatically updates README.md based on the current k8s/ directory structure.\n\n## Changes\n- Updated application list in README.md\n- Applications are now synced with k8s/ folders\n\n## Review\nPlease review and merge if everything looks correct.\n\n---\n🤖 This PR was automatically generated by CI/CD workflow\n⏰ Generated at: $(date '+%Y-%m-%d %H:%M:%S')",
|
||||||
Please review and merge if everything looks correct.
|
"head": "$BRANCH_NAME",
|
||||||
|
"base": "main"
|
||||||
---
|
}
|
||||||
🤖 This PR was automatically generated by CI/CD workflow
|
EOF
|
||||||
⏰ Generated at: $(date +%Y-%m-%d\ %H:%M:%S)"
|
|
||||||
|
|
||||||
# Create PR via API
|
# Create PR via API
|
||||||
RESPONSE=$(curl -s -X POST \
|
echo "Making API request to: $GITEA_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/pulls"
|
||||||
|
echo "Request body:"
|
||||||
|
cat /tmp/pr_body.json
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{
|
-d @/tmp/pr_body.json \
|
||||||
\"title\": \"$PR_TITLE\",
|
|
||||||
\"body\": \"$PR_BODY\",
|
|
||||||
\"head\": \"$BRANCH_NAME\",
|
|
||||||
\"base\": \"main\"
|
|
||||||
}" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/pulls")
|
"$GITEA_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/pulls")
|
||||||
|
|
||||||
# Extract PR number and URL from response
|
# Extract HTTP code and response body
|
||||||
PR_NUMBER=$(echo "$RESPONSE" | grep -o '"number":[0-9]*' | head -1 | cut -d':' -f2)
|
HTTP_CODE=$(echo "$RESPONSE" | grep "HTTP_CODE:" | cut -d':' -f2)
|
||||||
|
RESPONSE_BODY=$(echo "$RESPONSE" | sed '/HTTP_CODE:/d')
|
||||||
|
|
||||||
if [ -n "$PR_NUMBER" ]; then
|
echo "API Response (HTTP $HTTP_CODE):"
|
||||||
|
echo "$RESPONSE_BODY"
|
||||||
|
|
||||||
|
# Extract PR number and URL from response
|
||||||
|
PR_NUMBER=$(echo "$RESPONSE_BODY" | grep -o '"number":[0-9]*' | head -1 | cut -d':' -f2)
|
||||||
|
|
||||||
|
if [ -n "$PR_NUMBER" ] && [ "$HTTP_CODE" = "201" ]; then
|
||||||
echo "✅ Pull Request created successfully!"
|
echo "✅ Pull Request created successfully!"
|
||||||
echo "📝 PR #$PR_NUMBER"
|
echo "📝 PR #$PR_NUMBER"
|
||||||
echo "🔗 URL: $GITEA_URL/$GITEA_OWNER/$GITEA_REPO/pulls/$PR_NUMBER"
|
echo "🔗 URL: $GITEA_URL/$GITEA_OWNER/$GITEA_REPO/pulls/$PR_NUMBER"
|
||||||
@@ -124,8 +125,15 @@ Please review and merge if everything looks correct.
|
|||||||
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
|
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
|
||||||
echo "pr_url=$GITEA_URL/$GITEA_OWNER/$GITEA_REPO/pulls/$PR_NUMBER" >> $GITHUB_OUTPUT
|
echo "pr_url=$GITEA_URL/$GITEA_OWNER/$GITEA_REPO/pulls/$PR_NUMBER" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "⚠️ Failed to create Pull Request"
|
echo "⚠️ Failed to create Pull Request (HTTP $HTTP_CODE)"
|
||||||
echo "Response: $RESPONSE"
|
echo "Response: $RESPONSE_BODY"
|
||||||
|
|
||||||
|
# Check if PR already exists
|
||||||
|
if echo "$RESPONSE_BODY" | grep -q "already exists"; then
|
||||||
|
echo "ℹ️ PR already exists for this branch"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -16,16 +16,17 @@ ArgoCD homelab project
|
|||||||
| **authentik** | [](https://ag.hexor.cy/applications/argocd/authentik) |
|
| **authentik** | [](https://ag.hexor.cy/applications/argocd/authentik) |
|
||||||
| **cert-manager** | [](https://ag.hexor.cy/applications/argocd/cert-manager) |
|
| **cert-manager** | [](https://ag.hexor.cy/applications/argocd/cert-manager) |
|
||||||
| **external-secrets** | [](https://ag.hexor.cy/applications/argocd/external-secrets) |
|
| **external-secrets** | [](https://ag.hexor.cy/applications/argocd/external-secrets) |
|
||||||
| **k3s-system-upgrade** | [](https://ag.hexor.cy/applications/argocd/k3s-system-upgrade) |
|
|
||||||
| **kube-system-custom** | [](https://ag.hexor.cy/applications/argocd/kube-system-custom) |
|
| **kube-system-custom** | [](https://ag.hexor.cy/applications/argocd/kube-system-custom) |
|
||||||
| **kubernetes-dashboard** | [](https://ag.hexor.cy/applications/argocd/kubernetes-dashboard) |
|
| **kubernetes-dashboard** | [](https://ag.hexor.cy/applications/argocd/kubernetes-dashboard) |
|
||||||
| **postgresql** | [](https://ag.hexor.cy/applications/argocd/postgresql) |
|
| **postgresql** | [](https://ag.hexor.cy/applications/argocd/postgresql) |
|
||||||
| **prom-stack** | [](https://ag.hexor.cy/applications/argocd/prom-stack) |
|
| **prometheus** | [](https://ag.hexor.cy/applications/argocd/prometheus) |
|
||||||
|
| **system-upgrade** | [](https://ag.hexor.cy/applications/argocd/system-upgrade) |
|
||||||
|
|
||||||
### Games
|
### Games
|
||||||
|
|
||||||
| Application | Status |
|
| Application | Status |
|
||||||
| :--- | :---: |
|
| :--- | :---: |
|
||||||
|
| **beam-ng** | [](https://ag.hexor.cy/applications/argocd/beam-ng) |
|
||||||
| **counter-strike-16** | [](https://ag.hexor.cy/applications/argocd/counter-strike-16) |
|
| **counter-strike-16** | [](https://ag.hexor.cy/applications/argocd/counter-strike-16) |
|
||||||
| **minecraft** | [](https://ag.hexor.cy/applications/argocd/minecraft) |
|
| **minecraft** | [](https://ag.hexor.cy/applications/argocd/minecraft) |
|
||||||
</td>
|
</td>
|
||||||
@@ -36,6 +37,7 @@ ArgoCD homelab project
|
|||||||
| Application | Status |
|
| Application | Status |
|
||||||
| :--- | :---: |
|
| :--- | :---: |
|
||||||
| **gitea** | [](https://ag.hexor.cy/applications/argocd/gitea) |
|
| **gitea** | [](https://ag.hexor.cy/applications/argocd/gitea) |
|
||||||
|
| **greece-notifier** | [](https://ag.hexor.cy/applications/argocd/greece-notifier) |
|
||||||
| **hexound** | [](https://ag.hexor.cy/applications/argocd/hexound) |
|
| **hexound** | [](https://ag.hexor.cy/applications/argocd/hexound) |
|
||||||
| **immich** | [](https://ag.hexor.cy/applications/argocd/immich) |
|
| **immich** | [](https://ag.hexor.cy/applications/argocd/immich) |
|
||||||
| **jellyfin** | [](https://ag.hexor.cy/applications/argocd/jellyfin) |
|
| **jellyfin** | [](https://ag.hexor.cy/applications/argocd/jellyfin) |
|
||||||
@@ -45,6 +47,8 @@ ArgoCD homelab project
|
|||||||
| **pasarguard** | [](https://ag.hexor.cy/applications/argocd/pasarguard) |
|
| **pasarguard** | [](https://ag.hexor.cy/applications/argocd/pasarguard) |
|
||||||
| **qbittorent-nas** | [](https://ag.hexor.cy/applications/argocd/qbittorent-nas) |
|
| **qbittorent-nas** | [](https://ag.hexor.cy/applications/argocd/qbittorent-nas) |
|
||||||
| **rustdesk** | [](https://ag.hexor.cy/applications/argocd/rustdesk) |
|
| **rustdesk** | [](https://ag.hexor.cy/applications/argocd/rustdesk) |
|
||||||
|
| **sonarr-stack** | [](https://ag.hexor.cy/applications/argocd/sonarr-stack) |
|
||||||
|
| **stirling-pdf** | [](https://ag.hexor.cy/applications/argocd/stirling-pdf) |
|
||||||
| **syncthing** | [](https://ag.hexor.cy/applications/argocd/syncthing) |
|
| **syncthing** | [](https://ag.hexor.cy/applications/argocd/syncthing) |
|
||||||
| **tg-bots** | [](https://ag.hexor.cy/applications/argocd/tg-bots) |
|
| **tg-bots** | [](https://ag.hexor.cy/applications/argocd/tg-bots) |
|
||||||
| **vaultwarden** | [](https://ag.hexor.cy/applications/argocd/vaultwarden) |
|
| **vaultwarden** | [](https://ag.hexor.cy/applications/argocd/vaultwarden) |
|
||||||
@@ -52,4 +56,4 @@ ArgoCD homelab project
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user