apiVersion: apps/v1
kind: Deployment
metadata:
  name: fontbakery-manifest-main
spec:
  replicas: 1
  selector:
    matchLabels:
      component: fontbakery-manifest-main
  template:
    metadata:
      labels:
        component: fontbakery-manifest-main
        role: manifest
    spec:
      containers:
      - name: fontbakery-manifest-main
        image: fontbakery/base-javascript:1
        env:
          - name: FONTBAKERY_LOG_LEVEL
            value: "DEBUG"
          - name: RETHINKDB_PASSWORD
            valueFrom:
              secretKeyRef:
                name: external-resources
                key: rethinkdb-password
        workingDir: /var/javascript
        command: ["node", "node/ManifestMain.js"]
      # depends directly on rabbitmq/amqp
      # wait until rabbitmq can be reached before starting the actual container
      initContainers:
        - name: init-wait-for-rabbitmq
          image: busybox
          command:
          - sh
          - "-c"
          - >
            until wget -q -O -
            http://guest:guest@$RABBITMQ_MANAGEMENT_SERVICE_HOST:$RABBITMQ_MANAGEMENT_SERVICE_PORT/api/aliveness-test/%2F;
            do echo [`date`] waiting for rabbitmq: 10s;
            sleep 10;
            done;
