apiVersion: batch/v1
kind: CronJob
metadata:
  name: cronjob-curl-paddledetection
spec:
  schedule: "*/18 0 * * 2"          # UTC 18:00 CST 24:00
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: Never
          containers:
          - name: curl-container
            image: curlimages/curl
            env:
            - name: IMAGE_REGISTRY
              value: paddlecloud/paddledetection
            - name: TOOLKIT_NAME
              value: PaddleDetection
            - name: TOOLKIT_REVISION
              value: release/2.4
            - name: TOOLKIT_BASE_IMAGE_VERSION
              value: 2.2.2
            - name: DOCKER_REPO_URL
              value: https://github.com/freeliuzc/PaddleCloud.git
            - name: DOCKER_REVISION
              value: dev-tekton
            - name: DOCKERFILE_PATH
              value: tekton/dockerfiles/Dockerfile
            imagePullPolicy: IfNotPresent
            args: ["curl", "-X", "POST", "--data",
                   '{"image-registry": "$(IMAGE_REGISTRY)",
                   "toolkit-repo-name": "$(TOOLKIT_NAME)",
                   "toolkit-revision": "$(TOOLKIT_REVISION)",
                   "toolkit-base-image-version": "$(TOOLKIT_BASE_IMAGE_VERSION)",
                   "docker-repo-url": "$(DOCKER_REPO_URL)",
                   "docker-revision": "$(DOCKER_REVISION)",
                   "dockerfile-path": "$(DOCKERFILE_PATH)"}',
                   "el-cron-listener.default.svc.cluster.local:8080"]