Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b9de1da855 | |||
| 9f9af398cc | |||
| bc6bb78973 |
@@ -3,19 +3,18 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- feature/gitops
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
load-config:
|
||||
name: Load example-gitea-env.conf to pipeline env
|
||||
name: Config load
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
config_path: .gitea/workflows/example-gitea-env.conf
|
||||
|
||||
check-version:
|
||||
name: Check existing artifact
|
||||
name: Latest versio
|
||||
needs: [load-config]
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/check-version.yml@main
|
||||
secrets: inherit
|
||||
@@ -50,19 +49,9 @@ jobs:
|
||||
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||
version: ${{ needs.check-version.outputs.version }}
|
||||
|
||||
helm-build-push:
|
||||
name: Build & Push Helm
|
||||
needs: [load-config, check-version, bats, cucumber]
|
||||
if: needs.check-version.outputs.artifact_exists != 'true'
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/helm-build-push.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||
version: ${{ needs.check-version.outputs.version }}
|
||||
|
||||
docker-gitops:
|
||||
name: Update docker
|
||||
needs: [docker-build-push]
|
||||
name: GitOps
|
||||
needs: [docker-build-push, load-config, check-version]
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
@@ -85,7 +74,7 @@ jobs:
|
||||
|
||||
tag-maintenance:
|
||||
name: Move provider version tag
|
||||
needs: [docker-build-push, helm-build-push]
|
||||
needs: [docker-gitops]
|
||||
if: success()
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/tag-maintenance.yml@main
|
||||
secrets: inherit
|
||||
|
||||
@@ -10,14 +10,14 @@ on:
|
||||
|
||||
jobs:
|
||||
load-config:
|
||||
name: Load git-pages.gitea-env.conf to pipeline env
|
||||
name: Config load
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
config_path: .gitea/workflows/git-pages.gitea-env.conf
|
||||
|
||||
check-version:
|
||||
name: Check existing artifact
|
||||
name: Latest version
|
||||
needs: [load-config]
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/check-version.yml@main
|
||||
secrets: inherit
|
||||
@@ -36,9 +36,9 @@ jobs:
|
||||
chart_path: git-pages
|
||||
|
||||
chart-gitops:
|
||||
name: Update chart to the cluster
|
||||
needs: [helm-push]
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml
|
||||
name: GitOps
|
||||
needs: [helm-push, load-config, check-version]
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
|
||||
report-summary:
|
||||
name: Report Summary
|
||||
needs: [load-config, helm-push, chart-gitops]
|
||||
needs: [load-config, check-version, helm-push, chart-gitops]
|
||||
if: always()
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/report-summary.yml@main
|
||||
with:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "gitops-dispatch: validating env vars..."
|
||||
: "${GITOPS_FILE:?}"
|
||||
: "${GITOPS_YQ_TPL:?}"
|
||||
: "${GITOPS_VERSION:?}"
|
||||
@@ -11,8 +12,7 @@ set -euo pipefail
|
||||
: "${GITEA_API_URL:?}"
|
||||
: "${GITEA_TOKEN:?}"
|
||||
|
||||
TIMEOUT="${GITOPS_DISPATCH_TIMEOUT:-30}"
|
||||
|
||||
echo "gitops-dispatch: constructing inputs..."
|
||||
INPUTS=$(jq -nc \
|
||||
--arg file "$GITOPS_FILE" \
|
||||
--arg yq_tpl "$GITOPS_YQ_TPL" \
|
||||
@@ -23,6 +23,7 @@ INPUTS=$(jq -nc \
|
||||
'{file: $file, yq_tpl: $yq_tpl, version: $version, source_repo: $source_repo, source_commit: $source_commit, git_tag_prefix: $git_tag_prefix}')
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
echo "gitops-dispatch: dispatching to $GITOPS_REPO/$GITOPS_WORKFLOW..."
|
||||
set +e
|
||||
OUTPUT=$(bash "$DIR/dispatch-workflow.sh" \
|
||||
"$GITOPS_REPO" "$GITOPS_WORKFLOW" "main" \
|
||||
@@ -30,7 +31,9 @@ OUTPUT=$(bash "$DIR/dispatch-workflow.sh" \
|
||||
EXIT=$?
|
||||
set -e
|
||||
|
||||
echo "=== DISPATCH OUTPUT (exit=$EXIT) ==="
|
||||
echo "$OUTPUT"
|
||||
echo "=== END DISPATCH ==="
|
||||
|
||||
STATUS="failure"
|
||||
GITOPS_SHA=""
|
||||
|
||||
Reference in New Issue
Block a user