This is an automated email from the ASF dual-hosted git repository.
tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new 1f33734048c NO-ISSUE: Fix publishing KIE Sandbox helm chart to Docker
Hub (#2459)
1f33734048c is described below
commit 1f33734048cb921b4d95c6903bc73de93cb835c2
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Thu Jul 4 00:28:11 2024 -0300
NO-ISSUE: Fix publishing KIE Sandbox helm chart to Docker Hub (#2459)
---
.ci/jenkins/Jenkinsfile.daily-dev-publish | 3 ++-
.../release-jobs/Jenkinsfile.kie-sandbox-helm-chart | 3 ++-
.ci/jenkins/shared-scripts/dockerUtils.groovy | 6 +++---
.ci/jenkins/shared-scripts/helmUtils.groovy | 14 +++++++++-----
packages/kie-sandbox-helm-chart/README.md | 8 ++++----
packages/kie-sandbox-helm-chart/install.js | 3 +++
packages/kie-sandbox-helm-chart/src/Chart.yaml | 2 +-
packages/kie-sandbox-helm-chart/src/README.md | 2 +-
8 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.daily-dev-publish
b/.ci/jenkins/Jenkinsfile.daily-dev-publish
index fafb46bf032..1dc81ba53c4 100644
--- a/.ci/jenkins/Jenkinsfile.daily-dev-publish
+++ b/.ci/jenkins/Jenkinsfile.daily-dev-publish
@@ -530,7 +530,8 @@ pipeline {
dir('kie-tools') {
script {
helmUtils.pushChartToRegistry(
-
"${env.KIE_SANDBOX_HELM_CHART__registry}/${env.KIE_SANDBOX_HELM_CHART__account}",
+ "${env.KIE_SANDBOX_HELM_CHART__registry}",
+ "${env.KIE_SANDBOX_HELM_CHART__account}",
"packages/kie-sandbox-helm-chart/dist/${env.KIE_SANDBOX_HELM_CHART__name}-${env.KIE_SANDBOX_HELM_CHART__tag}.tgz",
"${pipelineVars.dockerHubUserCredentialsId}",
"${pipelineVars.dockerHubTokenCredentialsId}"
diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-helm-chart
b/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-helm-chart
index 1d3a8f9c919..31d32e9dc18 100644
--- a/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-helm-chart
+++ b/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-helm-chart
@@ -141,7 +141,8 @@ pipeline {
dir('kie-tools') {
script {
helmUtils.pushChartToRegistry(
-
"${env.KIE_SANDBOX_HELM_CHART__registry}/${env.KIE_SANDBOX_HELM_CHART__account}",
+ "${env.KIE_SANDBOX_HELM_CHART__registry}",
+ "${env.KIE_SANDBOX_HELM_CHART__account}",
"packages/kie-sandbox-helm-chart/dist/${env.KIE_SANDBOX_HELM_CHART__name}-${env.KIE_SANDBOX_HELM_CHART__tag}.tgz",
"${pipelineVars.dockerHubUserCredentialsId}",
"${pipelineVars.dockerHubTokenCredentialsId}"
diff --git a/.ci/jenkins/shared-scripts/dockerUtils.groovy
b/.ci/jenkins/shared-scripts/dockerUtils.groovy
index c36f1f0dc32..da1740a7295 100644
--- a/.ci/jenkins/shared-scripts/dockerUtils.groovy
+++ b/.ci/jenkins/shared-scripts/dockerUtils.groovy
@@ -19,10 +19,10 @@
* Push an image to a given registry
*/
def pushImageToRegistry(String registry, String account, String image, String
tags, String userCredentialsId, String tokenCredentialsId) {
- withCredentials([string(credentialsId: userCredentialsId, variable:
'DOCKER_USER')]) {
- withCredentials([string(credentialsId: tokenCredentialsId, variable:
'DOCKER_TOKEN')]) {
+ withCredentials([string(credentialsId: userCredentialsId, variable:
'REGISTRY_USER')]) {
+ withCredentials([string(credentialsId: tokenCredentialsId, variable:
'REGISTRY_TOKEN')]) {
sh """
- echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USER}"
--password-stdin $registry
+ echo "${REGISTRY_TOKEN}" | docker login -u "${REGISTRY_USER}"
--password-stdin $registry
""".trim()
tagList = tags.split(' ')
for (tag in tagList) {
diff --git a/.ci/jenkins/shared-scripts/helmUtils.groovy
b/.ci/jenkins/shared-scripts/helmUtils.groovy
index 3081c0c7768..7e51edcc6d4 100644
--- a/.ci/jenkins/shared-scripts/helmUtils.groovy
+++ b/.ci/jenkins/shared-scripts/helmUtils.groovy
@@ -18,11 +18,15 @@
/**
* Push a Helm Chart to a given registry
*/
-def pushChartToRegistry(String registry, String chart, String credentialsId) {
- withCredentials([usernamePassword(credentialsId: credentialsId,
usernameVariable: 'REGISTRY_USER', passwordVariable: 'REGISTRY_PWD')]) {
- sh "set +x && helm registry login -u $REGISTRY_USER -p $REGISTRY_PWD
$registry"
- sh "helm push ${chart} oci://${registry}"
- sh "helm registry logout ${registry}"
+def pushChartToRegistry(String registry, String account, String chart, String
userCredentialsId, String tokenCredentialsId) {
+ withCredentials([string(credentialsId: userCredentialsId, variable:
'REGISTRY_USER')]) {
+ withCredentials([string(credentialsId: tokenCredentialsId, variable:
'REGISTRY_TOKEN')]) {
+ sh """
+ echo "${REGISTRY_TOKEN}" | helm registry login -u
"${REGISTRY_USER}" --password-stdin $registry
+ helm push ${chart} oci://${registry}/${account}
+ helm registry logout ${registry}
+ """.trim()
+ }
}
}
diff --git a/packages/kie-sandbox-helm-chart/README.md
b/packages/kie-sandbox-helm-chart/README.md
index 55c8bfc2dad..af6f078f908 100644
--- a/packages/kie-sandbox-helm-chart/README.md
+++ b/packages/kie-sandbox-helm-chart/README.md
@@ -168,27 +168,27 @@ Very similar to the way you install the chart from source
code, you can also ins
### Default install
```console
-$ helm install kie-sandbox
oci://docker.io/apache/incubator-kie-sandbox-helm-chart --version=0.0.0
+$ helm install kie-sandbox
oci://docker.io/apache/incubator-kie-sandbox-helm-chart --version=0.0.0-main
```
### Minikube install
```console
-$ helm pull oci://docker.io/apache/incubator-kie-sandbox-helm-chart
--version=0.0.0 --untar
+$ helm pull oci://docker.io/apache/incubator-kie-sandbox-helm-chart
--version=0.0.0-main --untar
$ helm install kie-sandbox ./kie-sandbox-helm-chart --values
./kie-sandbox-helm-chart/values-minikube-nginx.yaml
```
### Kubernetes install
```console
-$ helm pull oci://docker.io/apache/incubator-kie-sandbox-helm-chart
--version=0.0.0 --untar
+$ helm pull oci://docker.io/apache/incubator-kie-sandbox-helm-chart
--version=0.0.0-main --untar
$ helm install kie-sandbox ./kie-sandbox-helm-chart --values
./kie-sandbox-helm-chart/values-kubernetes.yaml --set
global.kubernetesClusterDomain="<YOUR_KUBERNETES_CLUSTER_DOMAIN>" --set
global.kubernetesIngressClass="<YOUR_KUBERNETES_INGRESS_CLASS>"
```
### OpenShift install
```console
-$ helm pull oci://docker.io/apache/incubator-kie-sandbox-helm-chart
--version=0.0.0 --untar
+$ helm pull oci://docker.io/apache/incubator-kie-sandbox-helm-chart
--version=0.0.0-main --untar
$ helm install kie-sandbox ./kie-sandbox-helm-chart --values
./kie-sandbox-helm-chart/values-openshift.yaml --set
global.openshiftRouteDomain="<YOUR_OCP_ROUTE_DOMAIN>"
```
diff --git a/packages/kie-sandbox-helm-chart/install.js
b/packages/kie-sandbox-helm-chart/install.js
index 6671b3e681e..59824cd39c7 100644
--- a/packages/kie-sandbox-helm-chart/install.js
+++ b/packages/kie-sandbox-helm-chart/install.js
@@ -31,6 +31,9 @@ const chartFiles = [
];
chartFiles.forEach((file) => {
const doc = yaml.parseDocument(fs.readFileSync(file, "utf8"));
+ if (file == "src/Chart.yaml") {
+ doc.setIn(["name"], env.kieSandboxHelmChart.name);
+ }
doc.setIn(["version"], env.kieSandboxHelmChart.tag);
doc.setIn(["appVersion"], env.kieSandboxHelmChart.tag);
if (doc.getIn(["dependencies"])) {
diff --git a/packages/kie-sandbox-helm-chart/src/Chart.yaml
b/packages/kie-sandbox-helm-chart/src/Chart.yaml
index 70a625d5369..09ccb4b2306 100644
--- a/packages/kie-sandbox-helm-chart/src/Chart.yaml
+++ b/packages/kie-sandbox-helm-chart/src/Chart.yaml
@@ -1,5 +1,5 @@
apiVersion: v2
-name: kie-sandbox-helm-chart
+name: incubator-kie-sandbox-helm-chart
description: A Helm chart to deploy KIE Sandbox and related services on
Kubernetes
type: application
version: 0.0.0
diff --git a/packages/kie-sandbox-helm-chart/src/README.md
b/packages/kie-sandbox-helm-chart/src/README.md
index 74aeb533ee7..9f703326dbc 100644
--- a/packages/kie-sandbox-helm-chart/src/README.md
+++ b/packages/kie-sandbox-helm-chart/src/README.md
@@ -15,7 +15,7 @@
under the License.
-->
-# kie-sandbox-helm-chart
+# incubator-kie-sandbox-helm-chart



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]