apiVersion: batch/v1
kind: Job
metadata:
  name: nuclei-BBS_PROJECT_CODE
  labels:
    app: nuclei-BBS_PROJECT_CODE
spec:
  ttlSecondsAfterFinished: 100
  template:
    metadata:
      labels:
        app: nuclei-BBS_PROJECT_CODE
    spec:
      volumes:
      - name: data-volume
        hostPath: 
          path: /mnt/volume_lon1_01
          type: Directory
      containers:
      - name: nuclei-BBS_PROJECT_CODE
        image: golang:rc-stretch
        volumeMounts:
        - name: data-volume
          mountPath: /optdata
        command: 
        - /bin/bash
        - -c
        - |
          echo nuclei v1
          echo Code: BBS_PROJECT_CODE
          echo Id: BBS_PROJECT_ID
          echo List: BBS_PROJECT_LIST
          cd /optdata/BBS
          
          
          GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei
          
          mkdir -p /optdata/BBS/output/project-data/BBS_PROJECT_CODE/data/scanner/nuclei/data/$HOSTNAME/

          nuclei -list /optdata/BBS/output/project-data/BBS_PROJECT_CODE/BBS_PROJECT_LIST -o /optdata/BBS/output/project-data/BBS_PROJECT_CODE/data/scanner/nuclei/data/$HOSTNAME/nuclei.txt
            
          cp /optdata/BBS/output/project-data/BBS_PROJECT_CODE/data/scanner/nuclei/data/$HOSTNAME/nuclei.txt /optdata/BBS/output/project-data/BBS_PROJECT_CODE/data/scanner/nuclei/nuclei.txt
                    
          echo all done
      restartPolicy: Never

