# Example Techdocs Job

apiVersion: batch/v1
kind: Job
metadata:
  name: lighthouse-developer-portal-techdocs
spec:
  ttlSecondsAfterFinished: 100
  template:
    metadata:
      labels:
        app: lighthouse-developer-portal-techdocs
    spec:
      serviceAccountName: bandicoot-sa
      initContainers:
      - name: git-sync
        image: k8s.gcr.io/git-sync:v3.1.5
        args:
         - "--repo=https://github.com/department-of-veterans-affairs/lighthouse-developer-portal"
         - "--branch=main"
         - "--depth=1"
         - "--one-time"
        volumeMounts:
          - name: repo
            mountPath: /tmp/git
        resources:
          limits:
            cpu: 100m
            memory: 150Mi
      containers:
      - name: techdocs
        image: ghcr.io/department-of-veterans-affairs/lighthouse-developer-portal-deployment/techdocs:latest
        imagePullPolicy: Always
        command: ['/bin/sh']
        args:
        - -c
        - |
          cd /tmp/git/lighthouse-developer-portal
          techdocs-cli generate --source-dir /tmp/git/lighthouse-developer-portal --output-dir /tmp/git/techdocs/lighthouse-developer-portal --no-docker -v
          techdocs-cli publish --publisher-type awsS3 --storage-name embark-techdocs-storage --entity default/component/lighthouse-developer-portal-monorepo --directory /tmp/git/techdocs/lighthouse-developer-portal
          scuttle python -V
        volumeMounts:
          - name: repo
            mountPath: /tmp/git/
        env:
        - name: ENVOY_ADMIN_API
          value: "http://127.0.0.1:15000"
        - name: ISTIO_QUIT_API
          value: "http://127.0.0.1:15020"
        - name: SCUTTLE_LOGGING
          value: "true"
        resources:
          limits:
            cpu: 500m
            memory: 1024Mi
      imagePullSecrets:
        - name: "dockerconfigjson-ghcr"
      restartPolicy: Never
      volumes:
      - name: repo
        emptyDir: {}
