Merge pull request #1905 from Poor12/add-script
Add package helm chart scripts
This commit is contained in:
commit
cc74a42322
4
Makefile
4
Makefile
|
@ -104,6 +104,10 @@ update:
|
|||
verify:
|
||||
hack/verify-all.sh
|
||||
|
||||
.PHONY: release-chart
|
||||
release-chart:
|
||||
hack/release-helm-chart.sh $(VERSION)
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test --race --v ./pkg/...
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${REPO_ROOT}"/hack/util.sh
|
||||
|
||||
version=$1
|
||||
|
||||
release_dir="${REPO_ROOT}/_output/release"
|
||||
tar_file="karmada-chart-${version}.tgz"
|
||||
mkdir -p "${release_dir}"
|
||||
|
||||
# install helm
|
||||
echo -n "Preparing: 'helm' existence check - "
|
||||
if util::cmd_exist helm; then
|
||||
echo "passed"
|
||||
else
|
||||
echo "installing helm"
|
||||
util::install_helm
|
||||
fi
|
||||
|
||||
echo "Starting to package into a Karmada chart archive"
|
||||
helm package ./charts --version "${version}" -d "${release_dir}"
|
||||
cd "${release_dir}"
|
||||
mv "karmada-${version}.tgz" ${tar_file}
|
||||
sha256sum "${tar_file}" > "${tar_file}.sha256"
|
|
@ -161,6 +161,11 @@ function util::install_kubectl {
|
|||
fi
|
||||
}
|
||||
|
||||
# util::install_helm will install the helm command
|
||||
function util::install_helm {
|
||||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
}
|
||||
|
||||
# util::create_signing_certkey creates a CA, args are sudo, dest-dir, ca-id, purpose
|
||||
function util::create_signing_certkey {
|
||||
local sudo=$1
|
||||
|
|
Loading…
Reference in New Issue