github.com/m3db/m3@v1.5.0/kube/scripts/build_bundle.sh (about)

     1  #!/bin/bash
     2  
     3  # Script to bundle the various YAMLs into a single file that can be used with
     4  # `kubectl apply`. This is somewhat hacky and will be replaced with either a
     5  # ksonnet-based build process, operator, or helm chart later on.
     6  
     7  
     8  function sep() {
     9      echo "---" >> "$TARGET"
    10  }
    11  
    12  set -euo pipefail
    13  
    14  DIR=$(dirname "$(dirname "${BASH_SOURCE[0]}")")
    15  TARGET="$DIR/bundle.yaml"
    16  
    17  rm -f "$TARGET"
    18  echo "# AUTOMATICALLY GENERATED (build_bundle.sh) - DO NOT EDIT" >> "$TARGET"
    19  sep
    20  # Ordering is important here (namespace must come first)
    21  for N in m3dbnode-namespace.yaml etcd.yaml m3dbnode-configmap.yaml m3dbnode-statefulset.yaml; do
    22      F="$DIR/$N"
    23      [[ -f "$F" ]] || exit 1
    24      cat "$F" >> "$TARGET"
    25      sep
    26  done