when i run my ci/cd pipeline i encounter issue in the deployment stage with the environment setup before applying the config file. i use this template of k8s-review from to be continuous as u can see

`k8s-review:
  parallel: 
    matrix:
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/front/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/proxy/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/master-api/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/temperature_api/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/data_archiver/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/datashaper/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/ingestion/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/greenkeeper/deploy"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/cache"
      - K8S_SCRIPTS_DIR: "$CI_PROJECT_DIR/keycloak/deploy"
  needs: ["deploy-config_distributer-review"]
  rules:
    - if: '$REVIEW_DEPLOY == "true" && $K8S_SCRIPTS_DIR == "$CI_PROJECT_DIR/master-api/deploy" && $MASTER_API == "true"'
      when: always
    - if: '$REVIEW_DEPLOY == "true" && $K8S_SCRIPTS_DIR == "$CI_PROJECT_DIR/temperature_api/deploy" && $TEMPERATURE_API == "true"'
      when: always
    - if: '$REVIEW_DEPLOY == "true" && $K8S_SCRIPTS_DIR == "$CI_PROJECT_DIR/data_archiver/deploy" && $DATA_ARCHIVER == "true"'
      when: always
    - if: '$REVIEW_DEPLOY == "true" && $K8S_SCRIPTS_DIR == "$CI_PROJECT_DIR/datashaper/deploy" && $DATASHAPER == "true"'
      when: always
    - if: '$REVIEW_DEPLOY == "true" && $K8S_SCRIPTS_DIR == "$CI_PROJECT_DIR/ingestion/deploy" && $DATAREADER == "true"'
      when: always
    - if: '$REVIEW_DEPLOY == "true" && $K8S_SCRIPTS_DIR == "$CI_PROJECT_DIR/ingestion/deploy" && $DATALOADER == "true"'
      when: always
    - if: '$REVIEW_DEPLOY == "true" && $K8S_SCRIPTS_DIR == "$CI_PROJECT_DIR/greenkeeper/deploy" && $GREENKEEPER == "true"'
      when: always`

and this is the deployment script .yaml or manifest that deploys the app. the type of issue i'm encountering are like not finding a specific folder and failing to create it or smth so there's a necessity to do that manually but i want it to be automated. so having this deployment file can u generate a before script in the job i provided to setup anything that might create an issue later ? here's the deployment script

`apiVersion: v1
kind: PersistentVolume
metadata:
  labels:
    service: datashaper-volume-review
  name: datashaper-volume-review
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteMany
  hostPath:
    path: /DATA/DATA/
  capacity:
    storage: 1Gi
status: {}

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
    service: datashaper-claim0-review
  name: datashaper-claim0-review
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: manual
  resources:
    requests:
      storage: 1Gi
status: {}

---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: datashaper
  labels:
    service: datashaper
spec:
  selector:
    matchLabels:
      service: datashaper
  template:
    metadata:
      labels:
        service: datashaper
    spec:
      containers:
      - name: opentelemetry-collector
        image: git.pyxis.com.tn:5000/analytix/opentelemetry-collector:4.0.0
        ports:
        - containerPort: 8888
          name: metrics
          protocol: TCP
        - containerPort: 4317
          name: otlp-grpc
          protocol: TCP
        args:
        - --config=/conf/collector.yaml
        volumeMounts:
        - mountPath: /conf
          name: sidecar-conf
        resources: {}
      - name: datashaper
        image: "git.pyxis.com.tn:5000/analytix/datashaper:${SEMREL_INFO_NEXT_VERSION}"
        imagePullPolicy: Always
        envFrom:
        - configMapRef:
            name: data-shaper-env
        volumeMounts:
        - mountPath: /DATA/
          name: datashaper-claim0
      restartPolicy: Always
      volumes:
      - name: sidecar-conf
        configMap:
          name: sidecar-configmap
          items:
          - key: collector.yaml
            path: collector.yaml
      - name: datashaper-claim0
        persistentVolumeClaim:
          claimName: datashaper-claim0-review

---

apiVersion: v1
kind: ConfigMap
metadata:
  name: sidecar-configmap
data:
  collector.yaml: |
    receivers:
      otlp/tracesInput:
        protocols:
          grpc:
            endpoint: "0.0.0.0:4317"
      otlp/metricsInput:
        protocols:
          grpc:
            endpoint: "0.0.0.0:4318"

    exporters:
      otlp/tracesExport:
        endpoint: "197.26.19.241:4317"
        tls:
          insecure: true
      otlp/metricsExport:
        endpoint: "197.26.19.241:4318"
        tls:
          insecure: true
      logging:
        loglevel: debug

    service:
      pipelines:
        traces:
          receivers: [otlp/tracesInput]
          exporters: [otlp/tracesExport, logging]
        metrics:
          receivers: [otlp/metricsInput]
          exporters: [otlp/metricsExport, logging]

---

apiVersion: v1
kind: ConfigMap
metadata:
  name: data-shaper-env
data:
  URL: 197.13.9.211:8001
  DATA_SHAPER_ID: "0"
  WORKER_NAME: datashaper`