Skip to content

Commit

Permalink
KOGITO-7055: Sandbox for Serverless Workflow and Dashbuilder (#1050)
Browse files Browse the repository at this point in the history
* Add note in the Kafka settings tab

* Method to retrieve access token for Service Registry

* Make listing a table

* Fix header

* Method to upload OpenAPI to Service Registry

* Remove unused imports

* Add button for tests and some fixes/improvements

* Check for openshift connection

* Use Basic auth instead of OAuth when uploading to service registry

* Remove test button

* Upload OpenAPI to Service Registry if the file has not been stored yet

* Keep fetching the OpenAPI until the deployment is up

* Minor improvements to the deploy

* Fetch artifacts

* Fix deploy without Kafka

* Remove some unnecessary dependencies

* Workaround undo/redo issue

* Disable kie-sandbox-fs tests

* Disable noImplicitAny

* Add informative text to Settings items

* Disable deploy button if the diagram is already deployed

* Delete OpenAPI file from FS if the deployment is deleted on OpenShift

* Improve Settings tabs a little bit more

* Add services to editor autocomplete

* Remove temp button

* Remove slashes from artifact ids

* Remove single quote from text

* Reverted removed theme undefined check.

* Add setTimeout to avoid blank graphical editor

* Create repository with Kogito Quarkus project

* Replace slashes and spaces by underscores for artifact ids

* Remove Create Gist item

* Fix workflow path after creating a GitHub repository

* Fix alert layout

* Update Quarkus to 2.8.0.Final on the Serverless Workflow base container file

* Prepare initial structure for SWF Sandbox (derived from swf-chrome-extension)

* High level reorganization

* Convert code to KIE Sandbox: Home

* Convert code to KIE Sandbox: EditorToolbar

* Fix Service Registry access and the Rename operation. Also remove some unnecessary stuff.

* Convert code to KIE Sandbox: Add Sample

* Fix console errors thrown by Monaco

* Convert code to KIE Sandbox: Loading editor

* Remove extra scroll from the editor

* Simplify OpenShiftContext

* Add buttons for creating dashboards

* Add SVG when deploying the workflow

* Add dropdown for deployments

* Convert code to KIE Sandbox: Env vars

* Alow any non-model file to be opened in a readonly text editor

* Add support for YML/YAML files

* Be able to open files like .gitignore

* Bring back settings as a modal

* Fix yarn.lock after merge with main

* Be able to open files without extension

* Fix undo and redo

* Remove undo/redo workaround

* Simplify OpenShiftService

* Showcase

* Add samples

* Showcase list

* Organize samples

* Add third example and descriptions

* Improve cards

* Show samples by default

* Update Proxy URL

* Remove accordion

* Use extended services

* Default to hosted extended services

* Remove dmnRunner references

* Initial support for serverless decision files

* Move text editor to its own package

* Copy env.json file

* Update extensions for serverless decision

* Stop using editorEnvelopeLocator for file filtering while we have an envelope for all files

* Allow serverless decision files to be deployed, though not supported by the base container image yet

* Fix upload file

* Remove padding from deploy button

* Convert YAML to JSON before deploying

* Enable users to create both yaml and json files

* Update page title

* Adjustments after sync with main

* Add full project as sample and horizontal scroll

* Turn into local workspace

* Use Quarkus template only if the workspace is not a project

* Make Download SVG only available to serverless workflow files

* Fixes after pnpm migration

* Implements sandbox api

* Load function from service-registry again

* Remove unused code and imports

* Add missing dependencies

* Dashbuilder on SWF Sandbox (#21)

* Remove comment

* Remove log

* Workaround duplicated monaco issue for now

* Fix build:prod

* Remove unnecessary dependency

* Compile gwt even for build:dev script

* Initial tag to represent projects

* Editor fixes and dashboard samples (#23)

* Update graph.dot

* Remove workaround for Monaco

* Fix path to dashbuilder-runtime-client

* Don't repeat functions

* Fix pnpm-lock file after sync

* Remove alias no longer necessary

* Don't get duplicate add functions

* Improve showcase labels

* Replace yarn by pnpm

* Update package.json (#25)

Fix copying setup.js

* Bold tag

* Add notification stuff from KIE Sandbox

* Remove duplicated package on .syncpackrc.json

* Updates after sync with main

* Add deploy-related stuff from KIE Sandbox

* No need to send the preview when deploying anymore

* Upload OpenAPI to Service Registry only if config is set

* Remove extra scrollbar

* Fix some strings

* Fix swf base image package and bump versions

* Ignore WEB-INF folder when copying dashbuilder bundle

* Avoid unnecessary calls to service catalog

* Reintroduce distinction between model and other files

* Add KieSandboxExtendedServicesModal from KIE Sandbox

* Standardize settings tabs

* Enable multifile deployments

* Fix some connection issues

* Add advanced options to confirm deploy modal

* Update KafkaSource resource to follow OpenShift changes

* Minor fixes

* Update message

* Minor fixes

* Clean up swf services to avoid unnecessary calls while navigating on settings

* Clean up

* Reuse LoadingSpinner

* Improve advanced options

* Update samples

* Disconnect OpenShift in case of polling errors

* Remove unnecessary resources

* Simplify resources a bit

* Fix message

* Bump Quarkus platform version

* Rename base image package

* Rename base image folder

* Rename env vars and constants

* A pom.xml file in the root folder makes the workspace be treated as a project when applicable

* Identify task related with enabling notifications

* Remove commented code taken from KIE Sandbox

* Centralize extension-related code

* Refactor SwfServiceCatalogStore and refresh catalog store after a new upload

* Add yard sample to new file dropdown

* Change dev port number to 9020

* Update pnpm lock file

* Rename path dashbuilder-runtime-client -> dashbuilder-client

* KOGITO-7329: Default Dashboard for SWF Sandbox Deployment (#28)

* KOGITO-7320: Publish Dashbuilder Client bundle to NPM

* Updating lockfile

* KOGITO-7329: Default Dashboard for SWF Sandbox Deployment

* Adding the dashboard to the base image

* updating pnpm lock

* Fixes

* removing unused files

* updating pnpm lock

* Update graph.dot

* Minor improvements

* Add basic webapp for serverless logic sandbox deployments

* Update file header

* Enable validation for swf json files

* Rename package: @kie-tools/swf-sandbox -> @kie-tools/serverless-logic-sandbox (not the folder yet)

* Standardize cookie names

* Rename folder: swf-sandbox -> serverless-logic-sandbox

* Remove Temperature conversion sample for now

* Update Quarkus accelerator repository

* Remove Create Gist while it does not work properly

* Adapt CI

* Fix SERVERLESS_LOGIC_SANDBOX__baseImageAccount

* Fix extended services host/port

* Setup GTM

* Compilation fixes after sync with main

* Fix warning: Potentially unsafe external link

* Add missing dev dependency

* Test building dashbuilder on all platforms

* Fix Dashbuilder scripts for Windows OS

* Dashbuilder: skip tests on windows/mac for now

* Fix Dashbuilder authoring/runtime scripts

* Remove comment

* Use relative path on swf-report sample

* Do not build dashbuilder authoring on Windows

* Do not build dashbuilder runtime on Windows

* Do not zip dashbuilder authoring/runtime on Windows

* Create empty file with touch

* Minor improvements

* Add Virtual Service Registry (#34)

* Init virtual path

* Rename context

* Provider

* Adds apicurio docker-compose

* Map all functions

* Filling services

* New VirtualServiceRegistry service

* Remove old provider

* Preliminary tests with virtual service registry

* Preview virtual registry files

* Catalog fixes

* Correctly deleting registry files and ignoring empty ones

* Rename folder

* Abstract FsService and DescriptorService

* Fixed import and lockfile

* Revert TextEditor and move apicurio docker-compose

* Remove duplicated dependency

* If not SWF, set editor ready

* Wait for apiImpl only for sw.json files

* Add spec files to virtual service registry

* Use stateControl from props when available

* Fix undo command on DashbuilderEditor

* Minor improvements to Settings tabs

* KOGITO-7447: Allow workflow to import specs from other files in same workspace (but not itself) (#36)

* Init virtual path

* Rename context

* Provider

* Adds apicurio docker-compose

* Map all functions

* Filling services

* New VirtualServiceRegistry service

* Remove old provider

* Preliminary tests with virtual service registry

* Preview virtual registry files

* Catalog fixes

* Correctly deleting registry files and ignoring empty ones

* Rename folder

* Abstract FsService and DescriptorService

* Fixed import and lockfile

* Revert TextEditor and move apicurio docker-compose

* Make same workspace files work as local files and filter out same workflow spec

* Enable single-module project deployment

* List functions without extended services

* Fix labels

* Minor improvements to Settings tabs

* Remove samples and add Compensation sample

* Prepare for integration with stunner

* Enable 'deploy as project' as default if applicable

* Set a fixed build tag version instead of latest

* [NOISSUE] Adds browser alert and fixes diagram for Firefox (#38)

* Check browser to add alert and increase timeout for updating diagram (fixes for Firefox)

* Revert dashbuilder-client build for Windows

* Simplify browser check

* [KOGITO-7467]: Create BaseService class to be used by WorkspaceService and VirtualServiceRegistryService (#37)

* Init virtual path

* Rename context

* Provider

* Adds apicurio docker-compose

* Map all functions

* Filling services

* New VirtualServiceRegistry service

* Remove old provider

* Preliminary tests with virtual service registry

* Preview virtual registry files

* Catalog fixes

* Correctly deleting registry files and ignoring empty ones

* Rename folder

* Abstract FsService and DescriptorService

* Fixed import and lockfile

* Revert TextEditor and move apicurio docker-compose

* Make same workspace files work as local files and filter out same workflow spec

* BaseService

* BaseService for VirtualServiceRegistryService

* KOGITO-7467: Make BaseService and use it for WorkspaceService and VirtualServiceRegistryService

* Bump Quarkus platform version

* Remove .vscode settings from gitignore

* Apply kogito.yml during OpenShift build when deploying as a project

* Fix curl output

* Skip cleanup and copy assets on Windows since it does not build anyway

* Move get-oc script to Containerfile

* Use font 12 on Monaco for Dashbuilder

* Use insecure-skip-tls-verify on oc login

* Applied same fix for monaco-yaml done in KOGITO-7519

* Integrate Stunner and Sandbox

* Use our deployed cors-proxy as default value

* Use relative path

Co-authored-by: Thiago Lugli <[email protected]>
Co-authored-by: Paulo Martins <[email protected]>
Co-authored-by: Thiago Lugli <[email protected]>
Co-authored-by: William Antônio Siqueira <[email protected]>
Co-authored-by: Thiago Lugli <[email protected]>
  • Loading branch information
6 people authored Jul 12, 2022
1 parent 9564799 commit 271eda1
Show file tree
Hide file tree
Showing 268 changed files with 36,973 additions and 85 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/publish_daily_dev_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ jobs:
OPENSHIFT_PART_OF: "daily-dev-kie-sandbox-app"
DEPLOY_TAG: "daily-dev"

SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION: "0.0.0"
SERVERLESS_LOGIC_SANDBOX__baseImageRegistry: "quay.io"
SERVERLESS_LOGIC_SANDBOX__baseImageAccount: "kie-tools"
SERVERLESS_LOGIC_SANDBOX__baseImageName: "serverless-logic-sandbox-base-image"
SERVERLESS_LOGIC_SANDBOX__baseImageTag: "daily-dev"
SERVERLESS_LOGIC_SANDBOX__baseImageBuildTags: "daily-dev"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageRegistry: "quay.io"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageAccount: "kie-tools"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageName: "openjdk11-mvn-image"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageTag: "daily-dev"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageBuildTags: "daily-dev"

steps:
- name: "Support longpaths (Windows only)"
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -87,6 +99,11 @@ jobs:
ONLINE_EDITOR__kieSandboxExtendedServicesCompatibleVersion: "${{ env.KIE_SANDBOX_EXTENDED_SERVICES_VERSION }}"
ONLINE_EDITOR__buildInfo: "${{ steps.version.outputs.version }} (daily-dev) @ ${{ github.sha }}"
DISPLAY: ":99.0"
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlLinux: "https://github.com/kiegroup/kie-tools/releases/download/${{ env.SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION }}/kie_sandbox_extended_services_linux_${{ env.SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION }}.tar.gz"
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlMacOs: "https://github.com/kiegroup/kie-tools/releases/download/${{ env.SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION }}/kie_sandbox_extended_services_macos_${{ env.SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION }}.dmg"
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlWindows: "https://github.com/kiegroup/kie-tools/releases/download/${{ env.SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION }}/kie_sandbox_extended_services_windows_${{ env.SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION }}.exe"
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesCompatibleVersion: "${{ env.SERVERLESS_LOGIC_SANDBOX_EXTENDED_SERVICES_VERSION }}"
SERVERLESS_LOGIC_SANDBOX__buildInfo: "${{ steps.version.outputs.version }} (daily-dev) @ ${{ github.sha }}"
run: |
cd kie-tools
pnpm -r build:prod
Expand Down Expand Up @@ -131,6 +148,26 @@ jobs:
username: "${{ env.KIE_SANDBOX__imageAccount }}"
password: "${{ secrets.QUAY_REGISTRY_PASSWORD }}"

- name: "Push serverless-logic-sandbox-base-image to quay.io (Ubuntu only)"
if: matrix.os == 'ubuntu-latest'
uses: redhat-actions/push-to-registry@v2
with:
image: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageName }}"
tags: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageBuildTags }}"
registry: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageRegistry }}/${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageAccount }}"
username: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageAccount }}"
password: "${{ secrets.QUAY_REGISTRY_PASSWORD }}"

- name: "Push openjdk11-mvn-image to quay.io (Ubuntu only)"
if: matrix.os == 'ubuntu-latest'
uses: redhat-actions/push-to-registry@v2
with:
image: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageName }}"
tags: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageBuildTags }}"
registry: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageRegistry }}/${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageAccount }}"
username: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageAccount }}"
password: "${{ secrets.QUAY_REGISTRY_PASSWORD }}"

- name: "Deploy kie-sandbox-extended-services-image to OpenShift (Ubuntu only)"
id: deploy_kie_sandbox_extended_services_image
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -263,3 +300,25 @@ jobs:
git add . && git commit -m "KIE Tools Daily Dev Build resources - $today" || echo "No changes."
git push origin gh-pages
cd -
- name: "Checkout serverless-logic-sandbox-deployment (Ubuntu only)"
if: matrix.os == 'ubuntu-latest'
uses: actions/checkout@v2
with:
token: ${{ secrets.KIE_TOOLS_BOT_TOKEN }}
path: serverless-logic-sandbox-deployment
repository: kiegroup/serverless-logic-sandbox-deployment
ref: gh-pages

- name: "Update serverless-logic-sandbox-deployment resources (Ubuntu only)"
if: matrix.os == 'ubuntu-latest'
run: |
cd serverless-logic-sandbox-deployment
rm -rf dev
cp -r ../kie-tools/packages/serverless-logic-sandbox/dist/* dev/
git config --global user.email "[email protected]"
git config --global user.name "KIE Tools Bot (kiegroup)"
today=$(date -I)
git add . && git commit -m "KIE Tools Daily Dev Build resources - $today" || echo "No changes."
git push origin gh-pages
cd -
181 changes: 179 additions & 2 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
runners:
type: string
required: false
default: '{"dmn_dev_sandbox_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","desktop":"false","npm_packages":"false","standalone_editors_cdn":"false","extended_services":"false","dashbuilder":"false","dashbuilder_images":"false","kn_plugin_workflow":"false"}'
default: '{"dmn_dev_sandbox_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","desktop":"false","npm_packages":"false","standalone_editors_cdn":"false","extended_services":"false","dashbuilder":"false","dashbuilder_images":"false","serverless_logic_sandbox":"false","serverless_logic_sandbox_base_image":"false","openjdk11_mvn_image":"false","kn_plugin_workflow":"false"}'
secrets:
kie_tools_bot_token:
required: false
Expand Down Expand Up @@ -76,6 +76,9 @@ jobs:
extended_services: ${{ steps.set_runners.outputs.extended_services }}
dashbuilder: ${{ steps.set_runners.outputs.dashbuilder }}
dashbuilder_images: ${{ steps.set_runners.outputs.dashbuilder_images }}
serverless_logic_sandbox: ${{ steps.set_runners.outputs.serverless_logic_sandbox }}
serverless_logic_sandbox_base_image: ${{ steps.set_runners.outputs.serverless_logic_sandbox_base_image }}
openjdk11_mvn_image: ${{ steps.set_runners.outputs.openjdk11_mvn_image }}
kn_plugin_workflow: ${{ steps.set_runners.outputs.kn_plugin_workflow }}

steps:
Expand All @@ -97,6 +100,9 @@ jobs:
echo "::set-output name=extended_services::${{ fromJSON(inputs.runners).extended_services }}"
echo "::set-output name=dashbuilder::${{ fromJSON(inputs.runners).dashbuilder }}"
echo "::set-output name=dashbuilder_images::${{ fromJSON(inputs.runners).dashbuilder_images }}"
echo "::set-output name=serverless_logic_sandbox::${{ fromJSON(inputs.runners).serverless_logic_sandbox }}"
echo "::set-output name=serverless_logic_sandbox_base_image::${{ fromJSON(inputs.runners).serverless_logic_sandbox_base_image }}"
echo "::set-output name=openjdk11_mvn_image::${{ fromJSON(inputs.runners).openjdk11_mvn_image }}"
echo "::set-output name=kn_plugin_workflow::${{ fromJSON(inputs.runners).kn_plugin_workflow }}"
- name: "Print Runners"
Expand All @@ -116,6 +122,9 @@ jobs:
echo "extended_services: ${{ steps.set_runners.outputs.extended_services }}"
echo "dashbuilder: ${{ steps.set_runners.outputs.dashbuilder }}"
echo "dashbuilder_images: ${{ steps.set_runners.outputs.dashbuilder_images }}"
echo "serverless_logic_sandbox: ${{ steps.set_runners.outputs.serverless_logic_sandbox }}"
echo "serverless_logic_sandbox_base_image: ${{ steps.set_runners.outputs.serverless_logic_sandbox_base_image }}"
echo "openjdk11_mvn_image: ${{ steps.set_runners.outputs.openjdk11_mvn_image }}"
echo "kn_plugin_workflow: ${{ steps.set_runners.outputs.kn_plugin_workflow }}"
dmn_dev_sandbox_image:
Expand Down Expand Up @@ -1159,7 +1168,6 @@ jobs:
shell: bash
run: |
pnpm -F @kie-tools/kn-plugin-workflow... build:prod
- name: "Upload Knative CLI Workflow Plugin for Linux (Ubuntu only)"
if: ${{ matrix.os == 'ubuntu-latest' && !inputs.dry_run }}
uses: actions/[email protected]
Expand Down Expand Up @@ -1192,3 +1200,172 @@ jobs:
asset_path: "./packages/kn-plugin-workflow/dist/kn-workflow-windows-amd64.exe"
asset_name: "kn-workflow-windows-amd64-${{ inputs.tag }}.exe"
asset_content_type: application/octet-stream

serverless_logic_sandbox_base_image:
env:
SERVERLESS_LOGIC_SANDBOX__baseImageRegistry: "quay.io"
SERVERLESS_LOGIC_SANDBOX__baseImageAccount: "kie-tools"
SERVERLESS_LOGIC_SANDBOX__baseImageName: "serverless-logic-sandbox-base-image"
SERVERLESS_LOGIC_SANDBOX__baseImageBuildTags: "latest ${{ inputs.tag }}"

if: ${{ needs.extract_runners.outputs.serverless_logic_sandbox_base_image == 'true' }}
runs-on: ubuntu-latest
needs: [extract_runners]
steps:
- name: "Checkout kie-tools"
uses: actions/checkout@v2
with:
ref: ${{ inputs.base_ref }}
fetch-depth: 0

- name: "Setup kie-tools-bot"
uses: ./.github/actions/setup-kie-tools-bot

- name: "Merge PR changes"
uses: ./.github/actions/merge-pr-changes

- name: "Cache Maven packages"
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-serverless-logic-sandbox-base-image-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-serverless-logic-sandbox-base-image-m2

- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
os: ubuntu-latest

- name: "Build"
shell: bash
run: |
pnpm -F @kie-tools/serverless-logic-sandbox-base-image... build:prod
- name: "Push serverless-logic-sandbox-base-image to quay.io"
if: ${{ !inputs.dry_run }}
uses: redhat-actions/push-to-registry@v2
with:
image: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageName }}"
tags: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageBuildTags }}"
registry: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageRegistry }}/${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageAccount }}"
username: "${{ env.SERVERLESS_LOGIC_SANDBOX__baseImageAccount }}"
password: "${{ secrets.quay_registry_password }}"

openjdk11_mvn_image:
env:
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageRegistry: "quay.io"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageAccount: "kie-tools"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageName: "openjdk11-mvn-image"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageBuildTags: "latest ${{ inputs.tag }}"

if: ${{ needs.extract_runners.outputs.openjdk11_mvn_image == 'true' }}
runs-on: ubuntu-latest
needs: [extract_runners]
steps:
- name: "Checkout kie-tools"
uses: actions/checkout@v2
with:
ref: ${{ inputs.base_ref }}
fetch-depth: 0

- name: "Setup kie-tools-bot"
uses: ./.github/actions/setup-kie-tools-bot

- name: "Merge PR changes"
uses: ./.github/actions/merge-pr-changes

- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
os: ubuntu-latest

- name: "Build"
shell: bash
run: |
pnpm -F @kie-tools/openjdk11-mvn-image... build:prod
- name: "Push openjdk11-mvn-image to quay.io"
if: ${{ !inputs.dry_run }}
uses: redhat-actions/push-to-registry@v2
with:
image: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageName }}"
tags: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageBuildTags }}"
registry: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageRegistry }}/${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageAccount }}"
username: "${{ env.SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageAccount }}"
password: "${{ secrets.quay_registry_password }}"

serverless_logic_sandbox:
env:
SERVERLESS_LOGIC_SANDBOX__buildInfo: ""
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlLinux: "https://github.com/kiegroup/kie-tools/releases/download/${{ inputs.tag }}/kie_sandbox_extended_services_linux_${{ inputs.tag }}.tar.gz"
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlMacOs: "https://github.com/kiegroup/kie-tools/releases/download/${{ inputs.tag }}/kie_sandbox_extended_services_macos_${{ inputs.tag }}.dmg"
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlWindows: "https://github.com/kiegroup/kie-tools/releases/download/${{ inputs.tag }}/kie_sandbox_extended_services_windows_${{ inputs.tag }}.exe"
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesCompatibleVersion: "${{ inputs.tag }}"
SERVERLESS_LOGIC_SANDBOX__gtmId: "GTM-5W2QP3C"
SERVERLESS_LOGIC_SANDBOX__baseImageRegistry: "quay.io"
SERVERLESS_LOGIC_SANDBOX__baseImageAccount: "kie-tools"
SERVERLESS_LOGIC_SANDBOX__baseImageName: "serverless-logic-sandbox-base-image"
SERVERLESS_LOGIC_SANDBOX__baseImageTag: "${{ inputs.tag }}"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageRegistry: "quay.io"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageAccount: "kie-tools"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageName: "openjdk11-mvn-image"
SERVERLESS_LOGIC_SANDBOX__openJdk11MvnImageTag: "${{ inputs.tag }}"

if: ${{ always() && needs.extract_runners.outputs.serverless_logic_sandbox == 'true' && (needs.extended_services.result == 'success' || needs.extended_services.result == 'skipped') && (needs.serverless_logic_sandbox_base_image.result == 'success' || needs.serverless_logic_sandbox_base_image.result == 'skipped') && (needs.openjdk11_mvn_image.result == 'success' || needs.openjdk11_mvn_image.result == 'skipped') }}
runs-on: ubuntu-latest
needs: [extract_runners, serverless_logic_sandbox_base_image, openjdk11_mvn_image, extended_services]
steps:
- name: "Checkout kie-tools"
uses: actions/checkout@v2
with:
ref: ${{ inputs.base_ref }}
path: ${{ github.workspace }}/kie-tools
fetch-depth: 0

- name: "Setup kie-tools-bot"
uses: ./kie-tools/.github/actions/setup-kie-tools-bot

- name: "Merge PR changes"
uses: ./kie-tools/.github/actions/merge-pr-changes
with:
path: kie-tools

- name: "Checkout serverless-logic-sandbox-deployment"
if: ${{ !inputs.dry_run }}
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/serverless-logic-sandbox-deployment
fetch-depth: 0
token: ${{ secrets.kie_tools_bot_token }}
repository: kiegroup/serverless-logic-sandbox-deployment
ref: gh-pages

- name: "Cache Maven packages"
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-serverless-logic-sandbox-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-serverless-logic-sandbox-m2

- name: "Setup environment"
uses: ./kie-tools/.github/actions/setup-env
with:
path: kie-tools
os: ubuntu-latest

- name: "Build"
working-directory: ${{ github.workspace }}/kie-tools
run: |
pnpm -F @kie-tools/serverless-logic-sandbox... build:prod
- name: "Deploy to GitHub Pages (serverless-logic-sandbox-deployment)"
if: ${{ !inputs.dry_run }}
working-directory: ${{ github.workspace }}/serverless-logic-sandbox-deployment
shell: bash
run: |
echo "Reset deployment dir"
shopt -s extglob
rm -rf -- !("dev"|"staging"|".nojekyll"|"CNAME")
echo "Copy resources"
cp -r ${{ github.workspace }}/kie-tools/packages/serverless-logic-sandbox/dist/* .
echo "Commit changes and push"
git add .
git commit -m "Deploy ${{ inputs.tag }}"
git push origin gh-pages
2 changes: 1 addition & 1 deletion .github/workflows/release_dry_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
with:
dry_run: true
base_ref: ${{ github.event.pull_request && github.base_ref || github.ref }}
runners: '{"dmn_dev_sandbox_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","desktop":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","dashbuilder":"true","dashbuilder_images":"true","kn_plugin_workflow":"true"}'
runners: '{"dmn_dev_sandbox_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","desktop":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","dashbuilder":"true","dashbuilder_images":"true","serverless_logic_sandbox":"true","serverless_logic_sandbox_base_image":"true","openjdk11_mvn_image":"true","kn_plugin_workflow":"true"}'
2 changes: 1 addition & 1 deletion .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
runners:
type: string
required: true
default: '{"dmn_dev_sandbox_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","desktop":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","dashbuilder":"true","dashbuilder_images":"true","kn_plugin_workflow":"true"}'
default: '{"dmn_dev_sandbox_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","desktop":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","dashbuilder":"true","dashbuilder_images":"true","serverless_logic_sandbox":"true","serverless_logic_sandbox_base_image":"true","openjdk11_mvn_image":"true","kn_plugin_workflow":"true"}'

jobs:
prepare:
Expand Down
Loading

0 comments on commit 271eda1

Please sign in to comment.