diff --git a/.ci/helm.sh b/.ci/helm.sh index b3fae8f..89f1fc8 100644 --- a/.ci/helm.sh +++ b/.ci/helm.sh @@ -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) diff --git a/.ci/release.sh b/.ci/release.sh index b2fc125..0e08c71 100755 --- a/.ci/release.sh +++ b/.ci/release.sh @@ -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 diff --git a/.github/workflows/pulsar.yml b/.github/workflows/pulsar.yml index 4d1eeca..f06764b 100644 --- a/.github/workflows/pulsar.yml +++ b/.github/workflows/pulsar.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_bk_tls.yml b/.github/workflows/pulsar_bk_tls.yml index 1c41b0a..85cf41a 100644 --- a/.github/workflows/pulsar_bk_tls.yml +++ b/.github/workflows/pulsar_bk_tls.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_broker_tls.yml b/.github/workflows/pulsar_broker_tls.yml index 7af0434..f07617a 100644 --- a/.github/workflows/pulsar_broker_tls.yml +++ b/.github/workflows/pulsar_broker_tls.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_function.yml b/.github/workflows/pulsar_function.yml index 7609737..e67f302 100644 --- a/.github/workflows/pulsar_function.yml +++ b/.github/workflows/pulsar_function.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_image.yml b/.github/workflows/pulsar_image.yml index 484a2ca..567cc89 100644 --- a/.github/workflows/pulsar_image.yml +++ b/.github/workflows/pulsar_image.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_jwt_asymmetric.yml b/.github/workflows/pulsar_jwt_asymmetric.yml index abd6fb3..e766dba 100644 --- a/.github/workflows/pulsar_jwt_asymmetric.yml +++ b/.github/workflows/pulsar_jwt_asymmetric.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_jwt_symmetric.yml b/.github/workflows/pulsar_jwt_symmetric.yml index 84fdcd7..382eac2 100644 --- a/.github/workflows/pulsar_jwt_symmetric.yml +++ b/.github/workflows/pulsar_jwt_symmetric.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_tls.yml b/.github/workflows/pulsar_tls.yml index 18c1bcd..a3673b9 100644 --- a/.github/workflows/pulsar_tls.yml +++ b/.github/workflows/pulsar_tls.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_zk_tls.yml b/.github/workflows/pulsar_zk_tls.yml index 754fc67..e0e4470 100644 --- a/.github/workflows/pulsar_zk_tls.yml +++ b/.github/workflows/pulsar_zk_tls.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/pulsar_zkbk_tls.yml b/.github/workflows/pulsar_zkbk_tls.yml index 013a238..7c5037d 100644 --- a/.github/workflows/pulsar_zkbk_tls.yml +++ b/.github/workflows/pulsar_zkbk_tls.yml @@ -22,6 +22,8 @@ on: pull_request: branches: - '*' + paths: + - 'charts/pulsar/**' jobs: lint-test: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8a9169..f2e730e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/pulsar/.helmignore b/charts/pulsar/.helmignore similarity index 100% rename from pulsar/.helmignore rename to charts/pulsar/.helmignore diff --git a/pulsar/Chart.yaml b/charts/pulsar/Chart.yaml similarity index 100% rename from pulsar/Chart.yaml rename to charts/pulsar/Chart.yaml diff --git a/pulsar/templates/_autorecovery.tpl b/charts/pulsar/templates/_autorecovery.tpl similarity index 100% rename from pulsar/templates/_autorecovery.tpl rename to charts/pulsar/templates/_autorecovery.tpl diff --git a/pulsar/templates/_bookkeeper.tpl b/charts/pulsar/templates/_bookkeeper.tpl similarity index 100% rename from pulsar/templates/_bookkeeper.tpl rename to charts/pulsar/templates/_bookkeeper.tpl diff --git a/pulsar/templates/_broker.tpl b/charts/pulsar/templates/_broker.tpl similarity index 100% rename from pulsar/templates/_broker.tpl rename to charts/pulsar/templates/_broker.tpl diff --git a/pulsar/templates/_helpers.tpl b/charts/pulsar/templates/_helpers.tpl similarity index 100% rename from pulsar/templates/_helpers.tpl rename to charts/pulsar/templates/_helpers.tpl diff --git a/pulsar/templates/_toolset.tpl b/charts/pulsar/templates/_toolset.tpl similarity index 100% rename from pulsar/templates/_toolset.tpl rename to charts/pulsar/templates/_toolset.tpl diff --git a/pulsar/templates/_zookeeper.tpl b/charts/pulsar/templates/_zookeeper.tpl similarity index 100% rename from pulsar/templates/_zookeeper.tpl rename to charts/pulsar/templates/_zookeeper.tpl diff --git a/pulsar/templates/autorecovery-configmap.yaml b/charts/pulsar/templates/autorecovery-configmap.yaml similarity index 100% rename from pulsar/templates/autorecovery-configmap.yaml rename to charts/pulsar/templates/autorecovery-configmap.yaml diff --git a/pulsar/templates/autorecovery-service.yaml b/charts/pulsar/templates/autorecovery-service.yaml similarity index 100% rename from pulsar/templates/autorecovery-service.yaml rename to charts/pulsar/templates/autorecovery-service.yaml diff --git a/pulsar/templates/autorecovery-statefulset.yaml b/charts/pulsar/templates/autorecovery-statefulset.yaml similarity index 100% rename from pulsar/templates/autorecovery-statefulset.yaml rename to charts/pulsar/templates/autorecovery-statefulset.yaml diff --git a/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml similarity index 100% rename from pulsar/templates/bookkeeper-cluster-initialize.yaml rename to charts/pulsar/templates/bookkeeper-cluster-initialize.yaml diff --git a/pulsar/templates/bookkeeper-configmap.yaml b/charts/pulsar/templates/bookkeeper-configmap.yaml similarity index 100% rename from pulsar/templates/bookkeeper-configmap.yaml rename to charts/pulsar/templates/bookkeeper-configmap.yaml diff --git a/pulsar/templates/bookkeeper-pdb.yaml b/charts/pulsar/templates/bookkeeper-pdb.yaml similarity index 100% rename from pulsar/templates/bookkeeper-pdb.yaml rename to charts/pulsar/templates/bookkeeper-pdb.yaml diff --git a/pulsar/templates/bookkeeper-service.yaml b/charts/pulsar/templates/bookkeeper-service.yaml similarity index 100% rename from pulsar/templates/bookkeeper-service.yaml rename to charts/pulsar/templates/bookkeeper-service.yaml diff --git a/pulsar/templates/bookkeeper-statefulset.yaml b/charts/pulsar/templates/bookkeeper-statefulset.yaml similarity index 100% rename from pulsar/templates/bookkeeper-statefulset.yaml rename to charts/pulsar/templates/bookkeeper-statefulset.yaml diff --git a/pulsar/templates/bookkeeper-storageclass.yaml b/charts/pulsar/templates/bookkeeper-storageclass.yaml similarity index 100% rename from pulsar/templates/bookkeeper-storageclass.yaml rename to charts/pulsar/templates/bookkeeper-storageclass.yaml diff --git a/pulsar/templates/broker-cluster-role-binding.yaml b/charts/pulsar/templates/broker-cluster-role-binding.yaml similarity index 100% rename from pulsar/templates/broker-cluster-role-binding.yaml rename to charts/pulsar/templates/broker-cluster-role-binding.yaml diff --git a/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml similarity index 100% rename from pulsar/templates/broker-configmap.yaml rename to charts/pulsar/templates/broker-configmap.yaml diff --git a/pulsar/templates/broker-pdb.yaml b/charts/pulsar/templates/broker-pdb.yaml similarity index 100% rename from pulsar/templates/broker-pdb.yaml rename to charts/pulsar/templates/broker-pdb.yaml diff --git a/pulsar/templates/broker-rbac.yaml b/charts/pulsar/templates/broker-rbac.yaml similarity index 100% rename from pulsar/templates/broker-rbac.yaml rename to charts/pulsar/templates/broker-rbac.yaml diff --git a/pulsar/templates/broker-service-account.yaml b/charts/pulsar/templates/broker-service-account.yaml similarity index 100% rename from pulsar/templates/broker-service-account.yaml rename to charts/pulsar/templates/broker-service-account.yaml diff --git a/pulsar/templates/broker-service.yaml b/charts/pulsar/templates/broker-service.yaml similarity index 100% rename from pulsar/templates/broker-service.yaml rename to charts/pulsar/templates/broker-service.yaml diff --git a/pulsar/templates/broker-statefulset.yaml b/charts/pulsar/templates/broker-statefulset.yaml similarity index 100% rename from pulsar/templates/broker-statefulset.yaml rename to charts/pulsar/templates/broker-statefulset.yaml diff --git a/pulsar/templates/dashboard-deployment.yaml b/charts/pulsar/templates/dashboard-deployment.yaml similarity index 100% rename from pulsar/templates/dashboard-deployment.yaml rename to charts/pulsar/templates/dashboard-deployment.yaml diff --git a/pulsar/templates/dashboard-ingress.yaml b/charts/pulsar/templates/dashboard-ingress.yaml similarity index 100% rename from pulsar/templates/dashboard-ingress.yaml rename to charts/pulsar/templates/dashboard-ingress.yaml diff --git a/pulsar/templates/dashboard-service.yaml b/charts/pulsar/templates/dashboard-service.yaml similarity index 100% rename from pulsar/templates/dashboard-service.yaml rename to charts/pulsar/templates/dashboard-service.yaml diff --git a/pulsar/templates/function-worker-configmap.yaml b/charts/pulsar/templates/function-worker-configmap.yaml similarity index 100% rename from pulsar/templates/function-worker-configmap.yaml rename to charts/pulsar/templates/function-worker-configmap.yaml diff --git a/pulsar/templates/grafana-deployment.yaml b/charts/pulsar/templates/grafana-deployment.yaml similarity index 100% rename from pulsar/templates/grafana-deployment.yaml rename to charts/pulsar/templates/grafana-deployment.yaml diff --git a/pulsar/templates/grafana-ingress.yaml b/charts/pulsar/templates/grafana-ingress.yaml similarity index 100% rename from pulsar/templates/grafana-ingress.yaml rename to charts/pulsar/templates/grafana-ingress.yaml diff --git a/pulsar/templates/grafana-service.yaml b/charts/pulsar/templates/grafana-service.yaml similarity index 100% rename from pulsar/templates/grafana-service.yaml rename to charts/pulsar/templates/grafana-service.yaml diff --git a/pulsar/templates/keytool.yaml b/charts/pulsar/templates/keytool.yaml similarity index 100% rename from pulsar/templates/keytool.yaml rename to charts/pulsar/templates/keytool.yaml diff --git a/pulsar/templates/namespace.yaml b/charts/pulsar/templates/namespace.yaml similarity index 100% rename from pulsar/templates/namespace.yaml rename to charts/pulsar/templates/namespace.yaml diff --git a/pulsar/templates/prometheus-configmap.yaml b/charts/pulsar/templates/prometheus-configmap.yaml similarity index 100% rename from pulsar/templates/prometheus-configmap.yaml rename to charts/pulsar/templates/prometheus-configmap.yaml diff --git a/pulsar/templates/prometheus-deployment.yaml b/charts/pulsar/templates/prometheus-deployment.yaml similarity index 100% rename from pulsar/templates/prometheus-deployment.yaml rename to charts/pulsar/templates/prometheus-deployment.yaml diff --git a/pulsar/templates/prometheus-pvc.yaml b/charts/pulsar/templates/prometheus-pvc.yaml similarity index 100% rename from pulsar/templates/prometheus-pvc.yaml rename to charts/pulsar/templates/prometheus-pvc.yaml diff --git a/pulsar/templates/prometheus-rbac.yaml b/charts/pulsar/templates/prometheus-rbac.yaml similarity index 100% rename from pulsar/templates/prometheus-rbac.yaml rename to charts/pulsar/templates/prometheus-rbac.yaml diff --git a/pulsar/templates/prometheus-service.yaml b/charts/pulsar/templates/prometheus-service.yaml similarity index 100% rename from pulsar/templates/prometheus-service.yaml rename to charts/pulsar/templates/prometheus-service.yaml diff --git a/pulsar/templates/prometheus-storageclass.yaml b/charts/pulsar/templates/prometheus-storageclass.yaml similarity index 100% rename from pulsar/templates/prometheus-storageclass.yaml rename to charts/pulsar/templates/prometheus-storageclass.yaml diff --git a/pulsar/templates/proxy-configmap.yaml b/charts/pulsar/templates/proxy-configmap.yaml similarity index 100% rename from pulsar/templates/proxy-configmap.yaml rename to charts/pulsar/templates/proxy-configmap.yaml diff --git a/pulsar/templates/proxy-pdb.yaml b/charts/pulsar/templates/proxy-pdb.yaml similarity index 100% rename from pulsar/templates/proxy-pdb.yaml rename to charts/pulsar/templates/proxy-pdb.yaml diff --git a/pulsar/templates/proxy-service.yaml b/charts/pulsar/templates/proxy-service.yaml similarity index 100% rename from pulsar/templates/proxy-service.yaml rename to charts/pulsar/templates/proxy-service.yaml diff --git a/pulsar/templates/proxy-statefulset.yaml b/charts/pulsar/templates/proxy-statefulset.yaml similarity index 100% rename from pulsar/templates/proxy-statefulset.yaml rename to charts/pulsar/templates/proxy-statefulset.yaml diff --git a/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml similarity index 100% rename from pulsar/templates/pulsar-cluster-initialize.yaml rename to charts/pulsar/templates/pulsar-cluster-initialize.yaml diff --git a/pulsar/templates/pulsar-manager-admin-secret.yaml b/charts/pulsar/templates/pulsar-manager-admin-secret.yaml similarity index 100% rename from pulsar/templates/pulsar-manager-admin-secret.yaml rename to charts/pulsar/templates/pulsar-manager-admin-secret.yaml diff --git a/pulsar/templates/pulsar-manager-configmap.yaml b/charts/pulsar/templates/pulsar-manager-configmap.yaml similarity index 100% rename from pulsar/templates/pulsar-manager-configmap.yaml rename to charts/pulsar/templates/pulsar-manager-configmap.yaml diff --git a/pulsar/templates/pulsar-manager-deployment.yaml b/charts/pulsar/templates/pulsar-manager-deployment.yaml similarity index 100% rename from pulsar/templates/pulsar-manager-deployment.yaml rename to charts/pulsar/templates/pulsar-manager-deployment.yaml diff --git a/pulsar/templates/pulsar-manager-service.yaml b/charts/pulsar/templates/pulsar-manager-service.yaml similarity index 100% rename from pulsar/templates/pulsar-manager-service.yaml rename to charts/pulsar/templates/pulsar-manager-service.yaml diff --git a/pulsar/templates/tls-cert-internal-issuer.yaml b/charts/pulsar/templates/tls-cert-internal-issuer.yaml similarity index 100% rename from pulsar/templates/tls-cert-internal-issuer.yaml rename to charts/pulsar/templates/tls-cert-internal-issuer.yaml diff --git a/pulsar/templates/tls-certs-internal.yaml b/charts/pulsar/templates/tls-certs-internal.yaml similarity index 100% rename from pulsar/templates/tls-certs-internal.yaml rename to charts/pulsar/templates/tls-certs-internal.yaml diff --git a/pulsar/templates/toolset-configmap.yaml b/charts/pulsar/templates/toolset-configmap.yaml similarity index 100% rename from pulsar/templates/toolset-configmap.yaml rename to charts/pulsar/templates/toolset-configmap.yaml diff --git a/pulsar/templates/toolset-service.yaml b/charts/pulsar/templates/toolset-service.yaml similarity index 100% rename from pulsar/templates/toolset-service.yaml rename to charts/pulsar/templates/toolset-service.yaml diff --git a/pulsar/templates/toolset-statefulset.yaml b/charts/pulsar/templates/toolset-statefulset.yaml similarity index 100% rename from pulsar/templates/toolset-statefulset.yaml rename to charts/pulsar/templates/toolset-statefulset.yaml diff --git a/pulsar/templates/zookeeper-configmap.yaml b/charts/pulsar/templates/zookeeper-configmap.yaml similarity index 100% rename from pulsar/templates/zookeeper-configmap.yaml rename to charts/pulsar/templates/zookeeper-configmap.yaml diff --git a/pulsar/templates/zookeeper-pdb.yaml b/charts/pulsar/templates/zookeeper-pdb.yaml similarity index 100% rename from pulsar/templates/zookeeper-pdb.yaml rename to charts/pulsar/templates/zookeeper-pdb.yaml diff --git a/pulsar/templates/zookeeper-service.yaml b/charts/pulsar/templates/zookeeper-service.yaml similarity index 100% rename from pulsar/templates/zookeeper-service.yaml rename to charts/pulsar/templates/zookeeper-service.yaml diff --git a/pulsar/templates/zookeeper-statefulset.yaml b/charts/pulsar/templates/zookeeper-statefulset.yaml similarity index 100% rename from pulsar/templates/zookeeper-statefulset.yaml rename to charts/pulsar/templates/zookeeper-statefulset.yaml diff --git a/pulsar/templates/zookeeper-storageclass.yaml b/charts/pulsar/templates/zookeeper-storageclass.yaml similarity index 100% rename from pulsar/templates/zookeeper-storageclass.yaml rename to charts/pulsar/templates/zookeeper-storageclass.yaml diff --git a/pulsar/values.yaml b/charts/pulsar/values.yaml similarity index 100% rename from pulsar/values.yaml rename to charts/pulsar/values.yaml