apiVersion: batch/v1
kind: Job
metadata:
  name: autobuilder-${COMMIT_SHA}
spec:
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: build
          image: quay.io/buildah/stable:latest
          command: ["bash"]
          args: ["/build_script.sh"]
          env:
            - name: IMAGE_TAG
              value: ${IMAGE_TAG}
          volumeMounts:
            - mountPath: /build_script.sh
              name: build-script
              subPath: build_script.sh
      volumes:
        - name: build-script
          configMap:
            name: build-script
            defaultMode: 0755
