<commit_before>apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: db-config
  data:
    DB_NAME: "<<DB-NAME>>"
    DB_USER: "<<DB-USER>>"
    DB_PASS: "<<<PASSWORD>>>"
    DB_HOST: "<<DB-HOST>>"
    DB_PORT: "<<DB-PORT>>"
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: flyway-config
  data:
    FLYWAY_LOCATIONS: "<<FLYWAY-LOCATIONS>>"
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: ldap-config
  data:
    LDAP_HOST: "<<LDAP-HOST>>"
    LDAP_PORT: "<<LDAP-PORT>>"
    LDAP_PASS: "<<LDAP-<PASSWORD>>>"
    LDAP_DOMAIN: "<<LDAP-DOMAIN>>"
- apiVersion: batch/v1
  kind: Job
  metadata:
    name: dbreset
  spec:
    template:
      metadata:
        name: dbreset
      spec:
        containers:
        - name: dbreset
          image: innovateuk/dbreset:1.0-SNAPSHOT
          imagePullPolicy: Always
          command: [ "/bin/bash", "-exec" ]
          args:
          - |
            cat > flyway.conf <<EOF
            flyway.url=jdbc:mysql://${DB_HOST}:${DB_PORT}
            flyway.schemas=$DB_NAME
            flyway.locations=$FLYWAY_LOCATIONS
            flyway.user=$DB_USER
            flyway.password=$<PASSWORD>
            EOF
            flyway clean
            flyway migrate
            . /ldap-sync-from-ifs-db.sh
          env:
          - name: DB_HOST
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_HOST
          - name: DB_PORT
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_PORT
          - name: DB_NAME
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_NAME
          - name: DB_USER
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_USER
          - name: DB_PASS
            valueFrom:<commit_msg>reinstated flyway commands to reset container.<commit_after>apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: db-config
  data:
    DB_NAME: "<<DB-NAME>>"
    DB_USER: "<<DB-USER>>"
    DB_PASS: <PASSWORD>>>"
    DB_HOST: "<<DB-HOST>>"
    DB_PORT: "<<DB-PORT>>"
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: flyway-config
  data:
    FLYWAY_LOCATIONS: "<<FLYWAY-LOCATIONS>>"
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: ldap-config
  data:
    LDAP_HOST: "<<LDAP-HOST>>"
    LDAP_PORT: "<<LDAP-PORT>>"
    LDAP_PASS: "<<<PASSWORD>>>"
    LDAP_DOMAIN: "<<LDAP-DOMAIN>>"
- apiVersion: batch/v1
  kind: Job
  metadata:
    name: dbreset
  spec:
    template:
      metadata:
        name: dbreset
      spec:
        containers:
        - name: dbreset
          image: innovateuk/dbreset:1.0-SNAPSHOT
          imagePullPolicy: Always
          command: [ "/bin/bash", "-exec" ]
          args:
          - |
            cat > flyway.conf <<EOF
            flyway.url=jdbc:mysql://${DB_HOST}:${DB_PORT}
            flyway.schemas=$DB_NAME
            flyway.locations=$FLYWAY_LOCATIONS
            flyway.user=$DB_USER
            flyway.password=$<PASSWORD>
            EOF
            flyway clean
            flyway migrate
            flyway info
            flyway validate
            . /ldap-sync-from-ifs-db.sh
          env:
          - name: DB_HOST
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_HOST
          - name: DB_PORT
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_PORT
          - name: DB_NAME
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_NAME
          - name: DB_USER
            valueFrom:
              configMapKeyRef:
                name: db-config
                key: DB_USER
          - name: DB_PASS
            valueFrom:
{'fraction_non_alphanumeric': 0.1078954049251079, 'fraction_numerical': 0.003554201574003554, 'mean_word_length': 1.468671679197995, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '886231', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1255, 'n_words': 254}