github.com/operator-framework/operator-lifecycle-manager@v0.30.0/scripts/package_quickstart.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  if [[ ${#@} -lt 3 ]]; then
     4      echo "Usage: $0 concatenate OLM's Kubernetes manifests into a single YAML stream and writes the result to a file"
     5      echo "* dir: the input directory that contains OLM's Kubernetes manifests"
     6      echo "* out: the output file for the combined OLM Kubernetes manifest"
     7      echo "* outcrds: the output file for the combined OLM CRD manifest"
     8      echo "* outscript: the output install script"
     9      exit 1
    10  fi
    11  
    12  dir=$1
    13  out=$2
    14  outcrds=$3
    15  outscript=$4
    16  
    17  rm -f ${out}
    18  rm -f ${outcrds}
    19  touch ${out}
    20  touch ${outcrds}
    21  
    22  for f in ${dir}/*.yaml
    23  do
    24      if [[ $f == *.crd.yaml ]]
    25      then
    26      	awk 'NR==1 && !/^---*/ {print "---"} !/^[[:space:]]*#/ {print}' $f >> ${outcrds}
    27      else
    28      	awk 'NR==1 && !/^---*/ {print "---"} !/^[[:space:]]*#/ {print}' $f >> ${out}
    29      fi
    30  done
    31  
    32  echo "Wrote manifests to ${out} and ${outcrds}"
    33  
    34  cp scripts/install.sh ${outscript}