Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into paths-standardization
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagobento committed Jan 5, 2024
2 parents 8a0788f + ce93411 commit 3702a78
Show file tree
Hide file tree
Showing 110 changed files with 4,749 additions and 481 deletions.
2 changes: 1 addition & 1 deletion .ci/jenkins/Jenkinsfile.daily-dev-publish
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ pipeline {
ln -s editors dev/gwt-editors
git add . && git commit -m "Apache KIE Tools Daily Dev Build resources - ${env.BUILD_DATE}" || echo 'No changes.'
""".trim()

githubUtils.pushObject('origin', 'gh-pages', "${pipelineVars.asfGithubPushCredentialsId}")
}
}
Expand Down
23 changes: 22 additions & 1 deletion .ci/jenkins/Jenkinsfile.release-build
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pipeline {
string(description: 'Base Ref', name: 'BASE_REF')
string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0')
string(description: 'Upload asset url', name: 'UPLOAD_ASSET_URL', defaultValue: '')
string(description: 'Runners', name: 'RUNNERS', defaultValue: '{"dev_deployment_base_image":"false","dev_deployment_dmn_form_webapp_image":"false","kie_sandbox_image":"false","kie_sandbox_extended_services_image":"false","cors_proxy_image":"false","online_editor":"false","chrome_extensions":"false","vscode_extensions_dev":"false","vscode_extensions_prod":"false","npm_packages":"false","standalone_editors_cdn":"false","extended_services":"false","serverless_logic_web_tools":"false","serverless_logic_web_tools_swf_builder_image":"false","serverless_logic_web_tools_base_builder_image":"false","serverless_logic_web_tools_swf_dev_mode_image":"false","dashbuilder_viewer_image":"false","kn_plugin_workflow":"false"}')
string(description: 'Runners', name: 'RUNNERS', defaultValue: '{"dev_deployment_base_image":"false","dev_deployment_dmn_form_webapp_image":"false","kie_sandbox_image":"false","kie_sandbox_extended_services_image":"false","cors_proxy_image":"false","online_editor":"false","chrome_extensions":"false","vscode_extensions_dev":"false","vscode_extensions_prod":"false","npm_packages":"false","standalone_editors_cdn":"false","extended_services":"false","serverless_logic_web_tools":"false","serverless_logic_web_tools_swf_builder_image":"false","serverless_logic_web_tools_base_builder_image":"false","serverless_logic_web_tools_swf_dev_mode_image":"false","dashbuilder_viewer_image":"false","kn_plugin_workflow":"false","kie_sandbox_helm_chart":"true"}')
}

environment {
Expand Down Expand Up @@ -82,6 +82,7 @@ pipeline {
env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE = runners.serverless_logic_web_tools_swf_dev_mode_image
env.DASHBUILDER_VIEWER_IMAGE = runners.dashbuilder_viewer_image
env.KN_PLUGIN_WORKFLOW = runners.kn_plugin_workflow
env.KIE_SANDBOX_HELM_CHART = runners.kie_sandbox_helm_chart
}
}
}
Expand All @@ -107,6 +108,7 @@ pipeline {
echo "serverless_logic_web_tools_swf_dev_mode_image: ${env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE}"
echo "dashbuilder_viewer_image: ${env.DASHBUILDER_VIEWER_IMAGE}"
echo "kn_plugin_workflow: ${env.KN_PLUGIN_WORKFLOW}"
echo "kie_sandbox_helm_chart: ${env.KIE_SANDBOX_HELM_CHART}"
""".trim()
}
}
Expand Down Expand Up @@ -466,6 +468,25 @@ pipeline {
}
}
}

stage('KIE Sandbox Helm Chart') {
when {
expression { env.KIE_SANDBOX_HELM_CHART == 'true' }
}
steps {
script {
env.KIE_SANDBOX_HELM_CHART_JOB_RESULT = build(
wait: true,
job: 'KIE/kie-tools/kie-tools-release-jobs/kie-sandbox-helm-chart',
parameters: [
booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"),
string(name: 'BASE_REF', value: "${params.BASE_REF}"),
string(name: 'TAG', value: "${params.TAG}")
]
).result
}
}
}
}

post {
Expand Down
2 changes: 1 addition & 1 deletion .ci/jenkins/Jenkinsfile.release-dry-run
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pipeline {
build job: 'KIE/kie-tools/kie-tools-release-build', parameters: [
booleanParam(name: 'DRY_RUN', value: true),
string(name: 'BASE_REF', value: 'main'),
string(name: 'RUNNERS', value: '{"dev_deployment_base_image":"true","dev_deployment_dmn_form_webapp_image":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","serverless_logic_web_tools":"true","serverless_logic_web_tools_swf_builder_image":"true","serverless_logic_web_tools_base_builder_image":"true","serverless_logic_web_tools_swf_dev_mode_image":"true","dashbuilder_viewer_image":"true","kn_plugin_workflow":"true"}')
string(name: 'RUNNERS', value: '{"dev_deployment_base_image":"true","dev_deployment_dmn_form_webapp_image":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","serverless_logic_web_tools":"true","serverless_logic_web_tools_swf_builder_image":"true","serverless_logic_web_tools_base_builder_image":"true","serverless_logic_web_tools_swf_dev_mode_image":"true","dashbuilder_viewer_image":"true","kn_plugin_workflow":"true","kie_sandbox_helm_chart":"true"}')
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .ci/jenkins/Jenkinsfile.release-publish
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {

parameters {
string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0')
string(description: 'Runners', name: 'RUNNERS', defaultValue: '{"dev_deployment_base_image":"true","dev_deployment_dmn_form_webapp_image":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","serverless_logic_web_tools":"true","serverless_logic_web_tools_swf_builder_image":"true","serverless_logic_web_tools_base_builder_image":"true","serverless_logic_web_tools_swf_dev_mode_image":"true","dashbuilder_viewer_image":"true","kn_plugin_workflow":"true"}')
string(description: 'Runners', name: 'RUNNERS', defaultValue: '{"dev_deployment_base_image":"true","dev_deployment_dmn_form_webapp_image":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","serverless_logic_web_tools":"true","serverless_logic_web_tools_swf_builder_image":"true","serverless_logic_web_tools_base_builder_image":"true","serverless_logic_web_tools_swf_dev_mode_image":"true","dashbuilder_viewer_image":"true","kn_plugin_workflow":"true","kie_sandbox_helm_chart":"true"}')
}

stages {
Expand Down
25 changes: 24 additions & 1 deletion .ci/jenkins/Jenkinsfile.staging-build
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ pipeline {
SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageTag = "${params.TAG}-prerelease"
SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageBuildTags = "${params.TAG}-prerelease"

KIE_SANDBOX_HELM_CHART__registry = 'quay.io'
KIE_SANDBOX_HELM_CHART__account = 'kie-tools'
KIE_SANDBOX_HELM_CHART__name = 'kie-sandbox-helm-chart'
KIE_SANDBOX_HELM_CHART__tag = "${params.TAG}-prerelease"

DOCKER_CONFIG = "${WORKSPACE}/.docker"
}

Expand All @@ -106,6 +111,7 @@ pipeline {
githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy'
openShiftUtils = load '.ci/jenkins/shared-scripts/openShiftUtils.groovy'
dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy'
helmUtils = load '.ci/jenkins/shared-scripts/helmUtils.groovy'
zipUtils = load '.ci/jenkins/shared-scripts/zipUtils.groovy'
}
}
Expand Down Expand Up @@ -795,6 +801,23 @@ pipeline {
}
}
}

stage('STAGING: Push kie-sandbox-helm-chart to quay.io') {
when {
expression { !params.DRY_RUN }
}
steps {
dir('kie-tools') {
script {
helmUtils.pushChartToRegistry(
"${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.quayPushCredentialsId}"
)
}
}
}
}
}

post {
Expand Down Expand Up @@ -848,7 +871,7 @@ def deployOnlineEditor(String tag, String credentialsId) {
sh """#!/bin/bash -el
git config user.email [email protected]
git config user.name asf-ci-kie

echo "Switch to main branch"
git checkout main

Expand Down
144 changes: 144 additions & 0 deletions .ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-helm-chart
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pipeline {
agent {
docker {
image 'quay.io/kie-tools/kie-tools-ci-build:latest'
args '--shm-size=2g --privileged --group-add docker'
}
}

options {
timeout(time: 60, unit: 'MINUTES')
}

parameters {
booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true)
string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0')
string(description: 'Base Ref', name: 'BASE_REF')
}

environment {
KIE_TOOLS_BUILD__runLinters = 'false'
KIE_TOOLS_BUILD__runTests = 'false'
KIE_TOOLS_BUILD__runEndToEndTests = 'false'
KIE_TOOLS_BUILD__buildContainerImages = 'true'

KIE_SANDBOX_HELM_CHART__registry = 'quay.io'
KIE_SANDBOX_HELM_CHART__account = 'kie-tools'
KIE_SANDBOX_HELM_CHART__name = 'kie-sandbox-helm-chart'
KIE_SANDBOX_HELM_CHART__tag = "${params.TAG}"

DOCKER_CONFIG = "${WORKSPACE}/.docker"

PNPM_FILTER_STRING = '-F @kie-tools/kie-sandbox-helm-chart...'
}

stages {
stage('Load local shared scripts') {
steps {
script {
pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy'
buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy'
githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy'
hemlUtils = load '.ci/jenkins/shared-scripts/helmUtils.groovy'
}
}
}

stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') {
steps {
script {
buildUtils.startRequiredServices()
}
}
}

stage('Clean workspace before build') {
steps {
cleanWs(deleteDirs: true, disableDeferredWipeout: true)
}
}

stage('Checkout kie-tools') {
steps {
dir('kie-tools') {
script {
githubUtils.checkoutRepo(
"http://github.com/${pipelineVars.githubRepositorySlug}.git",
"${params.BASE_REF}",
"${pipelineVars.kieToolsBotGithubCredentialsId}"
)
}
}
}
}

stage('Setup PNPM') {
steps {
dir('kie-tools') {
script {
buildUtils.setupPnpm()
}
}
}
}

stage('PNPM Bootstrap') {
steps {
dir('kie-tools') {
script {
buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}")
}
}
}
}

stage('Build') {
steps {
dir('kie-tools') {
script {
buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}")
}
}
}
}

stage('Push kie-sandbox-helm-chart to quay.io') {
when {
expression { !params.DRY_RUN }
}
steps {
dir('kie-tools') {
script {
helmUtils.pushChartToRegistry(
"${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.quayPushCredentialsId}"
)
}
}
}
}
}

post {
always {
cleanWs(deleteDirs: true)
}
}
}
29 changes: 29 additions & 0 deletions .ci/jenkins/shared-scripts/helmUtils.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* 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}"
}
}

return this;
4 changes: 4 additions & 0 deletions .ci/kie-tools-ci-build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ RUN wget https://github.com/github/codeql-action/releases/latest/download/codeql
RUN wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz -P /tmp && \
sudo tar -C /usr/bin/ -xvzf /tmp/openshift-client-linux.tar.gz oc && rm /tmp/openshift-client-linux.tar.gz

# Helm CLI setup
RUN wget https://get.helm.sh/helm-v3.13.3-linux-amd64.tar.gz -P /tmp && \
sudo tar -C /usr/bin/ -zxvf /tmp/helm-v3.13.3-linux-amd64.tar.gz linux-amd64/helm --strip-components 1 && rm /tmp/helm-v3.13.3-linux-amd64.tar.gz

# Env vars
ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
ENV DISPLAY=":99"
Expand Down
10 changes: 10 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ runs:
colima start --memory 4 --network-address --verbose
# QEMU is reinstalled due to this bug: https://github.com/lima-vm/lima/issues/1742

- name: "Setup Helm (Ubuntu)"
if: runner.os == 'Linux'
shell: bash
env:
HELM_VERSION: "v3.13.3"
run: |
echo "STEP: Install Helm (Ubuntu only)"
sudo wget -q https://get.helm.sh/helm-$HELM_VERSION-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm
sudo chmod +x /usr/local/bin/helm
- name: "Setup network timeout"
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "ms-kubernetes-tools.vscode-kubernetes-tools"]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"eslint.options": {
"overrideConfigFile": "packages/eslint/.eslintrc.js"
},
"files.associations": {
"*.yaml.helm": "helm"
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ To start building the Apache KIE Tools project, you're going to need:
- Maven `3.8.6`
- Java `11`
- Go `1.21.1` _(To install, follow these instructions: https://go.dev/doc/install)_
- Helm `3.13.3` _(To install, follow these instructions: https://helm.sh/docs/intro/install/)_

> **ℹ️ NOTE:** Some packages will require that `make` is available as well.
Expand Down
6 changes: 3 additions & 3 deletions examples/commit-message-validation-service/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 3702a78

Please sign in to comment.