#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail

ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)

for dir in */ ; do
  kubectl create configmap oneconfig-$(basename "$dir") --namespace=${NAMESPACE} --dry-run=client --from-file=${dir} -oyaml | kubectl apply -f -
  kubectl annotate --overwrite configmap oneconfig-$(basename "$dir") --namespace=${NAMESPACE} oneconfig.tidbcloud.com/version=${GIT_COMMIT:-"local"}
done
