diff --git a/manifests/raw-resources-infra/renovate/cronjob.yaml b/manifests/raw-resources-infra/renovate/cronjob.yaml new file mode 100644 index 0000000..758ccbc --- /dev/null +++ b/manifests/raw-resources-infra/renovate/cronjob.yaml @@ -0,0 +1,118 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: renovate-config + namespace: infra +data: + config.js: | + module.exports = { + platform: "gitea", + endpoint: "https://git.dvirlabs.com/api/v1/", + gitAuthor: "Renovate Bot ", + + repositories: [ + "dvirlabs/dev-tools" + ], + + onboarding: false, + requireConfig: "required", + + dependencyDashboard: true, + + prHourlyLimit: 2, + prConcurrentLimit: 5, + + automerge: false, + + labels: ["renovate"], + + enabledManagers: [ + "dockerfile", + "docker-compose", + "helmv3", + "helm-values", + "kubernetes", + "npm", + "pip_requirements" + ], + + kubernetes: { + managerFilePatterns: [ + "/(^|/)manifests/.+\\.ya?ml$/", + "/(^|/)k8s/.+\\.ya?ml$/", + "/(^|/)apps/.+\\.ya?ml$/", + "/(^|/)charts/.+\\.ya?ml$/" + ] + }, + + packageRules: [ + { + matchDatasources: ["docker"], + addLabels: ["docker-image"] + }, + { + matchManagers: ["helmv3", "helm-values"], + addLabels: ["helm"] + }, + { + matchManagers: ["kubernetes"], + addLabels: ["kubernetes"] + }, + { + matchUpdateTypes: ["major"], + addLabels: ["major-update"] + }, + { + matchUpdateTypes: ["minor"], + addLabels: ["minor-update"] + }, + { + matchUpdateTypes: ["patch"], + addLabels: ["patch-update"] + } + ] + }; + +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: renovate + namespace: infra +spec: + schedule: "0 3 * * *" + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + jobTemplate: + spec: + backoffLimit: 1 + template: + spec: + restartPolicy: Never + containers: + - name: renovate + image: renovate/renovate:latest + imagePullPolicy: IfNotPresent + env: + - name: RENOVATE_CONFIG_FILE + value: /usr/src/app/config.js + + - name: RENOVATE_TOKEN + valueFrom: + secretKeyRef: + name: renovate-secret + key: RENOVATE_TOKEN + + - name: LOG_LEVEL + value: info + + volumeMounts: + - name: config + mountPath: /usr/src/app/config.js + subPath: config.js + + volumes: + - name: config + configMap: + name: renovate-config \ No newline at end of file