diff --git a/computingservices/OpenInfoServices/Dockerfile.enqueueforpublish.local b/computingservices/OpenInfoServices/Dockerfile.enqueueforpublish.local deleted file mode 100644 index 4fd4f50f..00000000 --- a/computingservices/OpenInfoServices/Dockerfile.enqueueforpublish.local +++ /dev/null @@ -1,14 +0,0 @@ -FROM golang:1.23-alpine AS builder -WORKDIR /app -COPY go.mod go.sum ./ -RUN go mod download -COPY . . -RUN go build -o main . - -# Use a minimal base image to run the application -FROM alpine:latest -WORKDIR /app -COPY --from=builder /app/main . -COPY --from=builder /app/templates/ ./templates/. -ENTRYPOINT ["./main"] -CMD ["enqueueforpublish"] diff --git a/computingservices/OpenInfoServices/Dockerfile.enqueueforunpublish.local b/computingservices/OpenInfoServices/Dockerfile.enqueueforunpublish.local deleted file mode 100644 index e434c37f..00000000 --- a/computingservices/OpenInfoServices/Dockerfile.enqueueforunpublish.local +++ /dev/null @@ -1,14 +0,0 @@ -FROM golang:1.23-alpine AS builder -WORKDIR /app -COPY go.mod go.sum ./ -RUN go mod download -COPY . . -RUN go build -o main . - -# Use a minimal base image to run the application -FROM alpine:latest -WORKDIR /app -COPY --from=builder /app/main . -COPY --from=builder /app/templates/ ./templates/. -ENTRYPOINT ["./main"] -CMD ["enqueueforunpublish"] diff --git a/computingservices/OpenInfoServices/Dockerfile.local b/computingservices/OpenInfoServices/Dockerfile.local index 820d739a..bd095274 100644 --- a/computingservices/OpenInfoServices/Dockerfile.local +++ b/computingservices/OpenInfoServices/Dockerfile.local @@ -11,4 +11,3 @@ WORKDIR /app COPY --from=builder /app/main . COPY --from=builder /app/templates/ ./templates/. ENTRYPOINT ["./main"] -CMD ["dequeue"] diff --git a/computingservices/OpenInfoServices/Dockerfile.sitemap.local b/computingservices/OpenInfoServices/Dockerfile.sitemap.local deleted file mode 100644 index 1a619215..00000000 --- a/computingservices/OpenInfoServices/Dockerfile.sitemap.local +++ /dev/null @@ -1,14 +0,0 @@ -FROM golang:1.23-alpine AS builder -WORKDIR /app -COPY go.mod go.sum ./ -RUN go mod download -COPY . . -RUN go build -o main . - -# Use a minimal base image to run the application -FROM alpine:latest -WORKDIR /app -COPY --from=builder /app/main . -COPY --from=builder /app/templates/ ./templates/. -ENTRYPOINT ["./main"] -CMD ["sitemap"] diff --git a/openshift/templates/openinfoservice/openinfoservice-cronjobs-publish.yaml b/openshift/templates/openinfoservice/openinfoservice-cronjobs-publish.yaml new file mode 100644 index 00000000..065b912a --- /dev/null +++ b/openshift/templates/openinfoservice/openinfoservice-cronjobs-publish.yaml @@ -0,0 +1,20 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: openinfo-publish-rook +spec: + schedule: "*/30 * * * *" # Runs every 30 minutes + timeZone: America/Vancouver + jobTemplate: + spec: + template: + spec: + containers: + - name: openinfo-publish-job-rook + image: d106d6-tools/reviewer-openinfoservice:dev-rook + args: ["enqueueforpublish"] + envFrom: + - secretRef: + name: openinfo-secret-rook # Reference to the secret containing env variables + imagePullPolicy: Always + restartPolicy: OnFailure diff --git a/openshift/templates/openinfoservice/openinfoservice-cronjobs-sitemap.yaml b/openshift/templates/openinfoservice/openinfoservice-cronjobs-sitemap.yaml new file mode 100644 index 00000000..2514c36e --- /dev/null +++ b/openshift/templates/openinfoservice/openinfoservice-cronjobs-sitemap.yaml @@ -0,0 +1,20 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: openinfo-sitemap-rook +spec: + schedule: "*/30 * * * *" # Runs every 30 minutes + timeZone: America/Vancouver + jobTemplate: + spec: + template: + spec: + containers: + - name: openinfo-sitemap-job-rook + image: d106d6-tools/reviewer-openinfoservice:dev-rook + args: ["sitemap"] + envFrom: + - secretRef: + name: openinfo-secret-rook # Reference to the secret containing env variables + imagePullPolicy: Always + restartPolicy: OnFailure diff --git a/openshift/templates/openinfoservice/openinfoservice-cronjobs-unpublish.yaml b/openshift/templates/openinfoservice/openinfoservice-cronjobs-unpublish.yaml new file mode 100644 index 00000000..12b18dbe --- /dev/null +++ b/openshift/templates/openinfoservice/openinfoservice-cronjobs-unpublish.yaml @@ -0,0 +1,20 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: openinfo-unpublish-rook +spec: + schedule: "*/30 * * * *" # Runs every 30 minutes + timeZone: America/Vancouver + jobTemplate: + spec: + template: + spec: + containers: + - name: openinfo-unpublish-job-rook + image: d106d6-tools/reviewer-openinfoservice:dev-rook + args: ["enqueueforunpublish"] + envFrom: + - secretRef: + name: openinfo-secret-rook # Reference to the secret containing env variables + imagePullPolicy: Always + restartPolicy: OnFailure diff --git a/openshift/templates/openinfoservice/openinfoservice-deploy.yaml b/openshift/templates/openinfoservice/openinfoservice-deploy.yaml index 1987fae1..846e1d51 100644 --- a/openshift/templates/openinfoservice/openinfoservice-deploy.yaml +++ b/openshift/templates/openinfoservice/openinfoservice-deploy.yaml @@ -52,6 +52,7 @@ objects: - name: "${APP_NAME}" image: "${APP_NAME}" imagePullPolicy: Always + args: ["dequeue"] env: - name: FOI_DB_USER valueFrom: @@ -188,9 +189,9 @@ parameters: displayName: Environment TAG name description: The TAG name for this environment, e.g., dev, test, prod required: true - value: dev + value: dev-rook - name: SECRETS displayName: OpenInfo Secrets description: Name of secrets for all openinfoservice values required: true - value: openinfoservice-secret + value: openinfo-secret-rook diff --git a/openshift/templates/openinfoservice/openinfoservice-enqueueforpublish-build.yaml b/openshift/templates/openinfoservice/openinfoservice-enqueueforpublish-build.yaml deleted file mode 100644 index 075b0d9b..00000000 --- a/openshift/templates/openinfoservice/openinfoservice-enqueueforpublish-build.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -kind: Template -apiVersion: template.openshift.io/v1 -metadata: - name: "${APP_NAME}-build-template" - creationTimestamp: -objects: -- kind: ImageStream - apiVersion: v1 - metadata: - name: "${APP_NAME}" -- kind: BuildConfig - apiVersion: v1 - metadata: - name: "${APP_NAME}-build" - labels: - app: "${APP_NAME}-build" - spec: - runPolicy: Serial - source: - type: Git - git: - uri: "${GIT_REPO_URL}" - ref: "${GIT_REF}" - contextDir: "${SOURCE_CONTEXT_DIR}" - strategy: - type: Docker - dockerStrategy: - dockerfilePath: "${DOCKER_FILE_PATH}" - pullSecret: - name: artifacts-pull-default-jmhvkc - output: - to: - kind: ImageStreamTag - name: "${APP_NAME}:latest" -parameters: -- name: APP_NAME - displayName: Name - description: The name assigned to all of the resources defined in this template. - required: true - value: reviewer-openinfoservice -- name: GIT_REPO_URL - displayName: Git Repo URL - description: The URL to your GIT repo. - required: true - value: https://github.com/bcgov/foi-docreviewer -- name: GIT_REF - displayName: Git Reference - description: The git reference or branch. - required: true - value: main -- name: SOURCE_CONTEXT_DIR - displayName: Source Context Directory - description: The source context directory. - required: false - value: computingservices/openinfoservice -- name: DOCKER_FILE_PATH - displayName: Docker File Path - description: The path to the docker file defining the build. - required: false - value: "Dockerfile.enqueueforpublish.local" \ No newline at end of file diff --git a/openshift/templates/openinfoservice/openinfoservice-enqueueforunpublish-build.yaml b/openshift/templates/openinfoservice/openinfoservice-enqueueforunpublish-build.yaml deleted file mode 100644 index 988708bc..00000000 --- a/openshift/templates/openinfoservice/openinfoservice-enqueueforunpublish-build.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -kind: Template -apiVersion: template.openshift.io/v1 -metadata: - name: "${APP_NAME}-build-template" - creationTimestamp: -objects: -- kind: ImageStream - apiVersion: v1 - metadata: - name: "${APP_NAME}" -- kind: BuildConfig - apiVersion: v1 - metadata: - name: "${APP_NAME}-build" - labels: - app: "${APP_NAME}-build" - spec: - runPolicy: Serial - source: - type: Git - git: - uri: "${GIT_REPO_URL}" - ref: "${GIT_REF}" - contextDir: "${SOURCE_CONTEXT_DIR}" - strategy: - type: Docker - dockerStrategy: - dockerfilePath: "${DOCKER_FILE_PATH}" - pullSecret: - name: artifacts-pull-default-jmhvkc - output: - to: - kind: ImageStreamTag - name: "${APP_NAME}:latest" -parameters: -- name: APP_NAME - displayName: Name - description: The name assigned to all of the resources defined in this template. - required: true - value: reviewer-openinfoservice -- name: GIT_REPO_URL - displayName: Git Repo URL - description: The URL to your GIT repo. - required: true - value: https://github.com/bcgov/foi-docreviewer -- name: GIT_REF - displayName: Git Reference - description: The git reference or branch. - required: true - value: main -- name: SOURCE_CONTEXT_DIR - displayName: Source Context Directory - description: The source context directory. - required: false - value: computingservices/openinfoservice -- name: DOCKER_FILE_PATH - displayName: Docker File Path - description: The path to the docker file defining the build. - required: false - value: "Dockerfile.enqueueforunpublish.local" \ No newline at end of file diff --git a/openshift/templates/openinfoservice/openinfoservice-sitemap-build.yaml b/openshift/templates/openinfoservice/openinfoservice-sitemap-build.yaml deleted file mode 100644 index b3a3451a..00000000 --- a/openshift/templates/openinfoservice/openinfoservice-sitemap-build.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -kind: Template -apiVersion: template.openshift.io/v1 -metadata: - name: "${APP_NAME}-build-template" - creationTimestamp: -objects: -- kind: ImageStream - apiVersion: v1 - metadata: - name: "${APP_NAME}" -- kind: BuildConfig - apiVersion: v1 - metadata: - name: "${APP_NAME}-build" - labels: - app: "${APP_NAME}-build" - spec: - runPolicy: Serial - source: - type: Git - git: - uri: "${GIT_REPO_URL}" - ref: "${GIT_REF}" - contextDir: "${SOURCE_CONTEXT_DIR}" - strategy: - type: Docker - dockerStrategy: - dockerfilePath: "${DOCKER_FILE_PATH}" - pullSecret: - name: artifacts-pull-default-jmhvkc - output: - to: - kind: ImageStreamTag - name: "${APP_NAME}:latest" -parameters: -- name: APP_NAME - displayName: Name - description: The name assigned to all of the resources defined in this template. - required: true - value: reviewer-openinfoservice -- name: GIT_REPO_URL - displayName: Git Repo URL - description: The URL to your GIT repo. - required: true - value: https://github.com/bcgov/foi-docreviewer -- name: GIT_REF - displayName: Git Reference - description: The git reference or branch. - required: true - value: main -- name: SOURCE_CONTEXT_DIR - displayName: Source Context Directory - description: The source context directory. - required: false - value: computingservices/openinfoservice -- name: DOCKER_FILE_PATH - displayName: Docker File Path - description: The path to the docker file defining the build. - required: false - value: "Dockerfile.sitemap.local" \ No newline at end of file