<commit_before>apiVersion: v1
kind: Template
metadata:
  name: nextcloud
  annotations:
    description: "Nextcloud - A safe home for all your data"
    tags: "fileshare,nextcloud"
    iconClass: fa-cloud-upload
    template.openshift.io/provider-display-name: "tobrunet"
    template.openshift.io/documentation-url: "https://github.com/tobru/nextcloud-openshift/blob/master/README.md"
    template.openshift.io/support-url: "https://github.com/tobru/nextcloud-openshift/issues"
parameters:
- name: NEXTCLOUD_HOST
  description: Application URL of Nextcloud (Route/host)
  required: true
- name: NEXTCLOUD_IMAGE
  description: Image to deploy
  value: docker.io/nextcloud
- name: NEXTCLOUD_IMAGE_TAG
  description: Tag of the Nextcloud Docker Image to deploy
  value: 12-fpm
- name: NGINX_DOCKERFILE_REPO
  description: Nginx Dockerfile source repository
  value: https://github.com/tobru/nextcloud-openshift.git
- name: PVC_SIZE
  description: PVC size for Apps, Config and Data
  value: 5Gi
objects:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: nextcloud-data
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: ${PVC_SIZE}
- apiVersion: v1
  kind: ImageStream
  metadata:
    labels:
      app: nextcloud
    name: nextcloud
  spec:
    tags:
    - annotations:
        openshift.io/imported-from: ${NEXTCLOUD_IMAGE}:${NEXTCLOUD_IMAGE_TAG}
      from:
        kind: DockerImage
        name: ${NEXTCLOUD_IMAGE}:${NEXTCLOUD_IMAGE_TAG}
      importPolicy:
        scheduled: true
      name: ${NEXTCLOUD_IMAGE_TAG}
      referencePolicy:
        type: Source
- apiVersion: v1
  kind: ImageStream
  metadata:
    labels:
      build: nginx
      app: nextcloud
    name: nginx
  spec:
    tags:
    - annotations: null
      from:
        kind: DockerImage
        name: nginx:latest
      generation: null
      importPolicy: {}
      name: latest
      referencePolicy:
        type: ""
- apiVersion: v1
  kind: BuildConfig
  metadata:
    creationTimestamp: null
    labels:
      build: nginx
      app: nextcloud
    name: nginx
  spec:
    nodeSelector: null
    output:
      to:
        kind: ImageStreamTag
        name: nginx:latest
    postCommit: {}
    resources: {}
    runPolicy: Serial
    source:
      git:
        uri: ${NGINX_DOCKERFILE_REPO}
      type: Git
    strategy:
      dockerStrategy:
        from:
          kind: DockerImage
          name: nginx:alpine
      type: Docker
    triggers:
    - type: ConfigChange
- apiVersion: v1
  kind: DeploymentConfig
  metadata:
    labels:
      app: nextcloud
    name: nextcloud
  spec:
    replicas: 1
    selector:
      app: nextcloud
      deploymentconfig: nextcloud
    strategy:
      activeDeadlineSeconds: 21600
      resources: {}
      rollingParams:
        intervalSeconds: 1
        maxSurge: 25%
        maxUnavailable: 25%
        timeoutSeconds: 600
        updatePeriodSeconds: 1
      type: Rolling
    template:
      metadata:
        labels:
          app: nextcloud
          deploymentconfig: nextcloud
      spec:
        containers:
        - env:
          - name: NC_dbhost
            value: mariadb
          - name: NC_dbuser
            valueFrom:
              secretKeyRef:
                key: database-user
                name: mariadb
          - name: NC_dbpassword
            valueFrom:
              secretKeyRef:
                key: database-password
                name: mariadb
          - name: NC_dbname
            value: nextcloud
          image: nextcloud
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 9000
            timeoutSeconds: 5
          name: nextcloud
          ports:
          - containerPort: 9000
            protocol: TCP
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 9000
            timeoutSeconds: 5
          resources: {}
          terminationMessagePath: /dev/termination-log
          volumeMounts:
          - mountPath: /var/www/html
            name: nextcloud-source
          - mountPath: /var/www/html/data
            name: nextcloud-data
            subPath: data
          - mountPath: /var/www/html/config
            name: nextcloud-data
            subPath: config
          - mountPath: /var/www/html/custom_apps
            name: nextcloud-data
            subPath: apps
        - image: nginx
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 8080
            timeoutSeconds: 1
          name: nginx
          ports:
          - containerPort: 8080
            protocol: TCP
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 8080
            timeoutSeconds: 1
          resources: {}
          terminationMessagePath: /dev/termination-log
          volumeMounts:
          - mountPath: /var/www/html
            name: nextcloud-source
          - mountPath: /var/www/html/data
            name: nextcloud-data
            subPath: data
          - mountPath: /var/www/html/config
            name: nextcloud-data
            subPath: config
          - mountPath: /var/www/html/custom_apps
            name: nextcloud-data
            subPath: apps
        dnsPolicy: ClusterFirst
        restartPolicy: Always
        securityContext: {}
        terminationGracePeriodSeconds: 30
        volumes:
        - emptyDir: {}
          name: nextcloud-source
        - name: nextcloud-data
          persistentVolumeClaim:
            claimName: nextcloud-data
    test: false
    triggers:
    - imageChangeParams:
        automatic: true
        containerNames:
        - nextcloud
        from:
          kind: ImageStreamTag
          name: nextcloud:${NEXTCLOUD_IMAGE_TAG}
      type: ImageChange
    - imageChangeParams:
        automatic: true
        containerNames:
        - nginx
        from:
          kind: ImageStreamTag
          name: nginx:latest
      type: ImageChange
    - type: ConfigChange
- apiVersion: v1
  kind: Service
  metadata:
    labels:
      app: nextcloud
    name: nextcloud
  spec:
    ports:
    - name: 8080-tcp
      port: 8080
      protocol: TCP
      targetPort: 8080
    selector:
      app: nextcloud
      deploymentconfig: nextcloud
    sessionAffinity: None
    type: ClusterIP
- apiVersion: v1
  kind: Route
  metadata:
    name: nextcloud
  spec:
    host: ${NEXTCLOUD_HOST}
    port:
      targetPort: 8080-tcp
    to:
      kind: Service
      name: nextcloud
      weight: 100
    wildcardPolicy: None
- apiVersion: batch/v1beta1
  kind: CronJob
  metadata:
    name: nextcloud-cron
  spec:
    concurrencyPolicy: Replace
    jobTemplate:
      spec:
        activeDeadlineSeconds: 3600
        template:
          spec:
            containers:
            - args:
              - php
              - -f
              - /var/www/html/cron.php
              env:
              - name: NC_dbhost
                value: mariadb
              - name: NC_dbuser
                valueFrom:
                  secretKeyRef:
                    key: database-user
                    name: mariadb
              - name: NC_dbpassword
                valueFrom:
                  secretKeyRef:
                    key: database-password
                    name: <PASSWORD>
              - name: NC_dbname
                value: nextcloud
              image: nextcloud:${NEXTCLOUD_IMAGE_TAG}
              imagePullPolicy: Always
              name: nextcloud-cron
              resources: {}
              terminationMessagePath: /dev/termination-log
              volumeMounts:
              - mountPath: /var/www/html
                name: nextcloud-source
              - mountPath: /var/www/html/data
                name: nextcloud-data
                subPath: data
              - mountPath: /var/www/html/config
                name: nextcloud-data
                subPath: config
              - mountPath: /var/www/html/custom_apps
                name: nextcloud-data<commit_msg>Fix for the CRON job environment: run nextcloud installation<commit_after>apiVersion: v1
kind: Template
metadata:
  name: nextcloud
  annotations:
    description: "Nextcloud - A safe home for all your data"
    tags: "fileshare,nextcloud"
    iconClass: fa-cloud-upload
    template.openshift.io/provider-display-name: "tobrunet"
    template.openshift.io/documentation-url: "https://github.com/tobru/nextcloud-openshift/blob/master/README.md"
    template.openshift.io/support-url: "https://github.com/tobru/nextcloud-openshift/issues"
parameters:
- name: NEXTCLOUD_HOST
  description: Application URL of Nextcloud (Route/host)
  required: true
- name: NEXTCLOUD_IMAGE
  description: Image to deploy
  value: docker.io/nextcloud
- name: NEXTCLOUD_IMAGE_TAG
  description: Tag of the Nextcloud Docker Image to deploy
  value: 12-fpm
- name: NGINX_DOCKERFILE_REPO
  description: Nginx Dockerfile source repository
  value: https://github.com/tobru/nextcloud-openshift.git
- name: PVC_SIZE
  description: PVC size for Apps, Config and Data
  value: 5Gi
objects:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: nextcloud-data
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: ${PVC_SIZE}
- apiVersion: v1
  kind: ImageStream
  metadata:
    labels:
      app: nextcloud
    name: nextcloud
  spec:
    tags:
    - annotations:
        openshift.io/imported-from: ${NEXTCLOUD_IMAGE}:${NEXTCLOUD_IMAGE_TAG}
      from:
        kind: DockerImage
        name: ${NEXTCLOUD_IMAGE}:${NEXTCLOUD_IMAGE_TAG}
      importPolicy:
        scheduled: true
      name: ${NEXTCLOUD_IMAGE_TAG}
      referencePolicy:
        type: Source
- apiVersion: v1
  kind: ImageStream
  metadata:
    labels:
      build: nginx
      app: nextcloud
    name: nginx
  spec:
    tags:
    - annotations: null
      from:
        kind: DockerImage
        name: nginx:latest
      generation: null
      importPolicy: {}
      name: latest
      referencePolicy:
        type: ""
- apiVersion: v1
  kind: BuildConfig
  metadata:
    creationTimestamp: null
    labels:
      build: nginx
      app: nextcloud
    name: nginx
  spec:
    nodeSelector: null
    output:
      to:
        kind: ImageStreamTag
        name: nginx:latest
    postCommit: {}
    resources: {}
    runPolicy: Serial
    source:
      git:
        uri: ${NGINX_DOCKERFILE_REPO}
      type: Git
    strategy:
      dockerStrategy:
        from:
          kind: DockerImage
          name: nginx:alpine
      type: Docker
    triggers:
    - type: ConfigChange
- apiVersion: v1
  kind: DeploymentConfig
  metadata:
    labels:
      app: nextcloud
    name: nextcloud
  spec:
    replicas: 1
    selector:
      app: nextcloud
      deploymentconfig: nextcloud
    strategy:
      activeDeadlineSeconds: 21600
      resources: {}
      rollingParams:
        intervalSeconds: 1
        maxSurge: 25%
        maxUnavailable: 25%
        timeoutSeconds: 600
        updatePeriodSeconds: 1
      type: Rolling
    template:
      metadata:
        labels:
          app: nextcloud
          deploymentconfig: nextcloud
      spec:
        containers:
        - env:
          - name: NC_dbhost
            value: mariadb
          - name: NC_dbuser
            valueFrom:
              secretKeyRef:
                key: database-user
                name: mariadb
          - name: NC_dbpassword
            valueFrom:
              secretKeyRef:
                key: database-password
                name: <PASSWORD>
          - name: NC_dbname
            value: nextcloud
          image: nextcloud
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 9000
            timeoutSeconds: 5
          name: nextcloud
          ports:
          - containerPort: 9000
            protocol: TCP
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 9000
            timeoutSeconds: 5
          resources: {}
          terminationMessagePath: /dev/termination-log
          volumeMounts:
          - mountPath: /var/www/html
            name: nextcloud-source
          - mountPath: /var/www/html/data
            name: nextcloud-data
            subPath: data
          - mountPath: /var/www/html/config
            name: nextcloud-data
            subPath: config
          - mountPath: /var/www/html/custom_apps
            name: nextcloud-data
            subPath: apps
        - image: nginx
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 8080
            timeoutSeconds: 1
          name: nginx
          ports:
          - containerPort: 8080
            protocol: TCP
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 8080
            timeoutSeconds: 1
          resources: {}
          terminationMessagePath: /dev/termination-log
          volumeMounts:
          - mountPath: /var/www/html
            name: nextcloud-source
          - mountPath: /var/www/html/data
            name: nextcloud-data
            subPath: data
          - mountPath: /var/www/html/config
            name: nextcloud-data
            subPath: config
          - mountPath: /var/www/html/custom_apps
            name: nextcloud-data
            subPath: apps
        dnsPolicy: ClusterFirst
        restartPolicy: Always
        securityContext: {}
        terminationGracePeriodSeconds: 30
        volumes:
        - emptyDir: {}
          name: nextcloud-source
        - name: nextcloud-data
          persistentVolumeClaim:
            claimName: nextcloud-data
    test: false
    triggers:
    - imageChangeParams:
        automatic: true
        containerNames:
        - nextcloud
        from:
          kind: ImageStreamTag
          name: nextcloud:${NEXTCLOUD_IMAGE_TAG}
      type: ImageChange
    - imageChangeParams:
        automatic: true
        containerNames:
        - nginx
        from:
          kind: ImageStreamTag
          name: nginx:latest
      type: ImageChange
    - type: ConfigChange
- apiVersion: v1
  kind: Service
  metadata:
    labels:
      app: nextcloud
    name: nextcloud
  spec:
    ports:
    - name: 8080-tcp
      port: 8080
      protocol: TCP
      targetPort: 8080
    selector:
      app: nextcloud
      deploymentconfig: nextcloud
    sessionAffinity: None
    type: ClusterIP
- apiVersion: v1
  kind: Route
  metadata:
    name: nextcloud
  spec:
    host: ${NEXTCLOUD_HOST}
    port:
      targetPort: 8080-tcp
    to:
      kind: Service
      name: nextcloud
      weight: 100
    wildcardPolicy: None
- apiVersion: batch/v1beta1
  kind: CronJob
  metadata:
    name: nextcloud-cron
  spec:
    concurrencyPolicy: Replace
    jobTemplate:
      spec:
        activeDeadlineSeconds: 3600
        template:
          spec:
            containers:
            - args:
              - php
              - -f
              - /var/www/html/cron.php
              env:
              - name: NEXTCLOUD_UPDATE
                value: "1"
              - name: NC_dbhost
                value: mariadb
              - name: NC_dbuser
                valueFrom:
                  secretKeyRef:
                    key: database-user
                    name: mariadb
              - name: NC_dbpassword
                valueFrom:
                  secretKeyRef:
                    key: database-password
                    name: mariadb
              - name: NC_dbname
                value: nextcloud
              image: nextcloud:${NEXTCLOUD_IMAGE_TAG}
              imagePullPolicy: Always
              name: nextcloud-cron
              resources: {}
              terminationMessagePath: /dev/termination-log
              volumeMounts:
              - mountPath: /var/www/html
                name: nextcloud-source
              - mountPath: /var/www/html/data
                name: nextcloud-data
                subPath: data
              - mountPath: /var/www/html/config
                name: nextcloud-data
                subPath: config
              - mountPath: /var/www/html/custom_apps
                name: nextcloud-data
{'fraction_non_alphanumeric': 0.06851948959972033, 'fraction_numerical': 0.011827769038046962, 'mean_word_length': 1.5560685033507073, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 26, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6292892', 'n_tokens_mistral': 4933, 'n_tokens_neox': 4696, 'n_words': 1145}