Publish chart index to gh-pages branch (#3)
*Motivation* Release helm chart when new tags are created
This commit is contained in:
parent
47f05b7650
commit
0338d17b89
@ -81,9 +81,9 @@ function ci::install_pulsar_chart() {
|
||||
${CHARTS_HOME}/scripts/pulsar/upload_tls.sh -k ${CLUSTER} -d ${PULSAR_HOME}/.ci/tls
|
||||
sleep 10
|
||||
|
||||
echo ${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/pulsar
|
||||
${HELM} template --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/pulsar
|
||||
${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/pulsar
|
||||
echo ${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
|
||||
${HELM} template --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
|
||||
${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
|
||||
|
||||
echo "wait until broker is alive"
|
||||
WC=$(${KUBECTL} get pods -n ${NAMESPACE} --field-selector=status.phase=Running | grep ${CLUSTER}-broker | wc -l)
|
||||
|
||||
@ -22,13 +22,10 @@ BINDIR=`dirname "$0"`
|
||||
CHARTS_HOME=`cd ${BINDIR}/..;pwd`
|
||||
CHARTS_PKGS=${CHARTS_HOME}/.chart-packages
|
||||
CHARTS_INDEX=${CHARTS_HOME}/.chart-index
|
||||
CHARTS_REPO=${CHARTS_REPO:-"https://charts.streamnative.io"}
|
||||
OWNER=${OWNER:-streamnative}
|
||||
REPO=${REPO:-charts}
|
||||
GITHUB_TOKEN=${GITHUB_TOKEN:-"UNSET"}
|
||||
CHARTS_REPO=${CHARTS_REPO:-"https://pulsar.apache.org/charts/"}
|
||||
OWNER=${OWNER:-apache}
|
||||
REPO=${REPO:-pulsar-helm-chart}
|
||||
PUBLISH_CHARTS=${PUBLISH_CHARTS:-"false"}
|
||||
GITUSER=${GITUSER:-"UNSET"}
|
||||
GITEMAIL=${GITEMAIL:-"UNSET"}
|
||||
|
||||
# hack/common.sh need this variable to be set
|
||||
PULSAR_CHART_HOME=${CHARTS_HOME}
|
||||
@ -66,17 +63,30 @@ function release::update_chart_index() {
|
||||
${CR} index -o ${OWNER} -r ${REPO} -t "${GITHUB_TOKEN}" -c ${CHARTS_REPO} --index-path /cr/.chart-index --package-path /cr/.chart-packages
|
||||
}
|
||||
|
||||
function release::publish_charts() {
|
||||
git config user.email "${GITEMAIL}"
|
||||
git config user.name "${GITUSER}"
|
||||
function release::git_setup() {
|
||||
cat <<- EOF > $HOME/.netrc
|
||||
machine github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
machine api.github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
EOF
|
||||
chmod 600 $HOME/.netrc
|
||||
|
||||
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
git config --global user.name "$GITHUB_ACTOR"
|
||||
}
|
||||
|
||||
function release::publish_charts() {
|
||||
release::git_setup
|
||||
git remote update
|
||||
git fetch --all
|
||||
git checkout gh-pages
|
||||
cp --force ${CHARTS_INDEX}/index.yaml index.yaml
|
||||
git add index.yaml
|
||||
git commit --message="Publish new charts to ${CHARTS_REPO}" --signoff
|
||||
git remote -v
|
||||
git remote add sn https://${PULSARBOT_USER}:${GITHUB_TOKEN}@github.com/${OWNER}/${REPO}
|
||||
git push sn gh-pages
|
||||
git push --set-upstream origin gh-pages
|
||||
}
|
||||
|
||||
# install cr
|
||||
|
||||
2
.github/workflows/pulsar.yml
vendored
2
.github/workflows/pulsar.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_bk_tls.yml
vendored
2
.github/workflows/pulsar_bk_tls.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_broker_tls.yml
vendored
2
.github/workflows/pulsar_broker_tls.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_function.yml
vendored
2
.github/workflows/pulsar_function.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_image.yml
vendored
2
.github/workflows/pulsar_image.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_jwt_asymmetric.yml
vendored
2
.github/workflows/pulsar_jwt_asymmetric.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_jwt_symmetric.yml
vendored
2
.github/workflows/pulsar_jwt_symmetric.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_tls.yml
vendored
2
.github/workflows/pulsar_tls.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_zk_tls.yml
vendored
2
.github/workflows/pulsar_zk_tls.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/pulsar_zkbk_tls.yml
vendored
2
.github/workflows/pulsar_zkbk_tls.yml
vendored
@ -22,6 +22,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/pulsar/**'
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@ -23,7 +23,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
lint-test:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -31,11 +31,7 @@ jobs:
|
||||
|
||||
- name: Install chart
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PULSARBOT_TOKEN }}
|
||||
PULSARBOT_USER: ${{ secrets.PULSARBOT_USER }}
|
||||
CHARTS_REPO: ${{ secrets.CHARTS_REPO }}
|
||||
PUBLISH_CHARTS: ${{ secrets.PUBLISH_CHARTS }}
|
||||
GITUSER: ${{ secrets.GITUSER }}
|
||||
GITEMAIL: ${{ secrets.GITEMAIL }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PUBLISH_CHARTS: true
|
||||
run: |
|
||||
.ci/release.sh
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user