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

     1  #!/usr/bin/env bash
     2  
     3  if [[ ${#@} -lt 3 ]]; then
     4      echo "Usage: $0 semver chart values"
     5      echo "* semver: semver-formatted version for this package"
     6      echo "* chart: the directory to output the chart"
     7      echo "* values: the values file"
     8      exit 1
     9  fi
    10  
    11  version=$1
    12  chartdir=$2
    13  values=$3
    14  
    15  source .bingo/variables.env
    16  
    17  charttmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t charttmpdir)
    18  
    19  charttmpdir=${charttmpdir}/chart
    20  
    21  cp -R deploy/chart/ "${charttmpdir}"
    22  
    23  # overwrite the destination Chart.yaml file with a modified copy containing the version
    24  sed "s/^[Vv]ersion:.*\$/version: ${version}/" deploy/chart/Chart.yaml > "${charttmpdir}/Chart.yaml"
    25  
    26  mkdir -p "${chartdir}"
    27  
    28  ${HELM} template -n olm -f "${values}" --include-crds --output-dir "${charttmpdir}" "${charttmpdir}"
    29  
    30  cp -R "${charttmpdir}"/olm/{templates,crds}/. "${chartdir}"