---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tripbot
spec:
  selector:
    matchLabels:
      app: tripbot
  template:
    spec:
      containers:

      - name: tripbot
        imagePullPolicy: Always
        command:
         - bash
        args:
         - -c
         - go run cmd/tripbot/tripbot.go 2>&1
        env:
         - name: ENV
           value: "stage"
         - name: CHANNEL_NAME
           value: "adanalife_staging"
         - name: BOT_USERNAME
           value: "adanalife_staging"
         - name: VLC_SERVER_HOST
           value: "http://localhost"

        volumeMounts:
        # mount stage-dotenv volume to /opt/tripbot
        - name: stage-dotenv
          mountPath: /opt/tripbot/.env.staging
          readOnly: true
          subPath: .env.staging

      volumes:
      - name: stage-dotenv
        configMap:
          name: stage-dotenv
          items:
            - key: stage-dotenv
              path: .env.staging
      - name: google-creds
        secret:
          secretName: stage-google-creds
