[Build] Publish charts to apache/pulsar-site branch asf-site-next (#232)

- also use shallow cloning
This commit is contained in:
Lari Hotari 2022-02-17 07:46:45 +02:00 committed by GitHub
parent 9613ee0292
commit 5b90c5195c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,8 @@ CHARTS_REPO=${CHARTS_REPO:-"https://pulsar.apache.org/charts/"}
OWNER=${OWNER:-apache}
REPO=${REPO:-pulsar-helm-chart}
PUBLISH_CHARTS=${PUBLISH_CHARTS:-"false"}
PULSAR_SITE_REPO_SLUG=${PULSAR_SITE_REPO_SLUG:-"apache/pulsar-site"}
PULSAR_SITE_BRANCH=${PULSAR_SITE_BRANCH:-"asf-site-next"}
# hack/common.sh need this variable to be set
PULSAR_CHART_HOME=${CHARTS_HOME}
@ -71,16 +73,15 @@ function release::git_setup() {
function release::publish_charts() {
release::git_setup
git clone https://${GITHUB_TOKEN}@github.com/apache/pulsar
cd pulsar
git checkout asf-site
git clone -b "$PULSAR_SITE_BRANCH" --depth 1 "https://${GITHUB_TOKEN}@github.com/${PULSAR_SITE_REPO_SLUG}" pulsar-site
cd pulsar-site
mkdir -p content/charts
cp --force ${CHARTS_INDEX}/index.yaml content/charts/index.yaml
git add content/charts/index.yaml
ls content/charts
git commit --message="Publish new charts to ${CHARTS_REPO}" --signoff
if [[ "x${PUBLISH_CHARTS}" == "xtrue" ]]; then
git push --set-upstream origin asf-site
git push --set-upstream origin "$PULSAR_SITE_BRANCH"
else
echo "Skipping publishing charts"
fi