Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gitea sync mirror workflow #135

Merged
merged 1 commit into from
Feb 9, 2023
Merged
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
42 changes: 42 additions & 0 deletions git-repo/gitea-sync-mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: tks-gitea-sync-mirror
namespace: argo
spec:
entrypoint: sync-mirror
arguments:
parameters:
- name: gitea_url
value: "http://gitea-http.gitea.svc:3000"
- name: target_repos
value: "decapod-base-yaml decapod-site"

templates:
- name: sync-mirror
activeDeadlineSeconds: 300
container:
name: 'curl'
image: curlimages/curl:latest
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -ecx
- |

for repo in $TARGET_REPOS;do
echo "===== $repo"
curl -X 'POST' \
$GITEA_URL'/api/v1/repos/'$USER'/'$repo'/mirror-sync?token='$TOKEN \
-H 'accept: application/json' \
-d ''
done

envFrom:
- secretRef:
name: "git-svc-token"
env:
- name: GITEA_URL
value: "{{workflow.parameters.gitea_url}}"
- name: TARGET_REPOS
value: "{{workflow.parameters.target_repos}}"