apiVersion: apps/v1
kind: Deployment

metadata:
  namespace: singouins-dev
  name: sep-backend-angular
  labels:
    tier: sep-backend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: angular
      tier: sep-backend
  template:
    metadata:
      labels:
        app: angular
        tier: sep-backend
    spec:

      containers:
      - name: sep-backend-angular
        image: singouins/ng-cli:12
        command: ["/bin/sh"]
        args: ["-c", "while true; do sleep 10;done"]
        imagePullPolicy: Always
        resources:
          limits:
            memory: 2048Mi
            cpu: 1000m
          requests:
            memory: 128Mi
            cpu: 50m
        env:
          - name: BUILD_TYPE
            value: 'proto'
          - name: GIT_REPO
            valueFrom:
              secretKeyRef:
                name: sep-backend-angular-secret
                key: angular-git-repo
          - name: GIT_USER
            valueFrom:
              secretKeyRef:
                name: sep-backend-angular-secret
                key: angular-git-user
          - name: GIT_TOKEN
            valueFrom:
              secretKeyRef:
                name: sep-backend-angular-secret
                key: angular-git-token
          - name: QUIET
            valueFrom:
              secretKeyRef:
                name: sep-backend-angular-secret
                key: angular-build-quiet
          - name: OUTPUT_PATH
            valueFrom:
              secretKeyRef:
                name: sep-backend-angular-secret
                key: angular-output-path
          - name: OUTPUT_FOLDER
            valueFrom:
              secretKeyRef:
                name: sep-backend-angular-secret
                key: angular-output-folder
        volumeMounts:
         - name: websites
           mountPath: /websites

      volumes:
      - name: websites
        persistentVolumeClaim:
          claimName: sep-backend-code-websites
