---
apiVersion: batch/v1
kind: Job
metadata:
  name: reload-configurable-resources
  namespace: lodestar-argo-cd
  annotations:
    argocd.argoproj.io/hook: PostSync
    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
spec:
  template:
    spec:
      containers:
      - name: reload-configurable-resources
        image: "quay.io/openshift/origin-cli"
        command:
        - "/bin/bash"
        - "-c"
        - |
          oc rollout latest dc/lodestar-backend -n lodestar-frontend || echo "deployment config lodestar-backend does not exist"
          oc rollout latest dc/lodestar-git-api -n lodestar-frontend || echo "deployment config lodestar-git-api does not exist"
          oc rollout latest dc/lodestar-status -n lodestar-frontend  || echo "deployment config lodestar-status does not exist"
          oc rollout latest dc/lodestar-activity -n lodestar-frontend  || echo "deployment config lodestar-activity does not exist"
          oc rollout latest dc/lodestar-participants -n lodestar-frontend  || echo "deployment config lodestar-participants does not exist"
          oc rollout latest dc/lodestar-artifacts -n lodestar-frontend  || echo "deployment config lodestar-artifacts does not exist"
          oc rollout latest dc/resource-dispatcher -n lodestar-argo-cd || echo "deployment config resource-dispatcher does not exist"
      restartPolicy: Never
      terminationGracePeriodSeconds: 30
      activeDeadlineSeconds: 500
      dnsPolicy: ClusterFirst
      serviceAccountName: argocd-application-controller
      serviceAccount: argocd-application-controller
