-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KOGITO-7579: Knative Workflow - Specify Kogito version #1114
Merged
Merged
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
45322f8
Parametrize Kogito version
ljmotta b874318
Remove versions from staging and release build, and minor fixes
ljmotta c197016
Add version and config file
ljmotta f99985e
Use env to set a custom quarkus and kogito version
ljmotta 07ee85f
Check env in main
ljmotta ade509a
Fix env
ljmotta ee30b7b
Add config file
ljmotta 2c31d20
Create version env
ljmotta c2b30c7
Merge remote-tracking branch 'origin/main' into kogito-7579
ljmotta e18b355
Extract file names to const
ljmotta 7e0a0cc
Cross compile to arm (macOS M1)
ljmotta 6ce227b
Add arm build script
ljmotta cc50f09
Fix readme
ljmotta 91614e0
Update the build extension version
ljmotta a556a23
Minor tweaks
ljmotta b494b92
Clean up
ljmotta 6db04ca
Remove both build extensions
ljmotta 9f12009
Update dependencies versions in the config command
ljmotta ef63c5e
Add apply option
ljmotta 52e014a
Update project version
ljmotta e2174bc
Bumb up golang version
ljmotta 354568f
Update go.mod
ljmotta 85e3411
PR review
ljmotta b352e74
Explain runAddExtension
ljmotta 52eaf25
Merge remote-tracking branch 'origin/main' into kogito-7579
ljmotta 0a0274e
Review
ljmotta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1133,20 +1133,10 @@ jobs: | |
password: "${{ secrets.quay_registry_password }}" | ||
|
||
kn_plugin_workflow: | ||
env: | ||
KN_PLUGIN_WORKFLOW__quarkusVersion: "2.9.2.Final" | ||
|
||
if: ${{ needs.extract_runners.outputs.kn_plugin_workflow == 'true' }} | ||
runs-on: ${{ matrix.os }} | ||
runs-on: ubuntu-latest | ||
needs: [extract_runners] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- name: "Support longpaths (Windows only)" | ||
if: matrix.os == 'windows-latest' | ||
run: git config --system core.longpaths true | ||
|
||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
with: | ||
|
@@ -1162,14 +1152,14 @@ jobs: | |
- name: "Setup environment" | ||
uses: ./.github/actions/setup-env | ||
with: | ||
os: ${{ matrix.os }} | ||
os: ubuntu-latest | ||
|
||
- name: "Build" | ||
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 }} | ||
- name: "Upload Knative CLI Workflow Plugin for Linux" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
|
@@ -1179,8 +1169,8 @@ jobs: | |
asset_name: kn-workflow-linux-amd64-${{ inputs.tag }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: "Upload Knative CLI Workflow Plugin for macOS (macOS only)" | ||
if: ${{ matrix.os == 'macos-latest' && !inputs.dry_run }} | ||
- name: "Upload Knative CLI Workflow Plugin for macOS" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
|
@@ -1190,8 +1180,19 @@ jobs: | |
asset_name: kn-workflow-darwin-amd64-${{ inputs.tag }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: "Upload Knative CLI Workflow Plugin for Windows (Windows only)" | ||
if: ${{ matrix.os == 'windows-latest' && !inputs.dry_run }} | ||
- name: "Upload Knative CLI Workflow Plugin for macOS M1" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
with: | ||
upload_url: ${{ inputs.upload_asset_url }} | ||
asset_path: ./packages/kn-plugin-workflow/dist/kn-workflow-darwin-arm64 | ||
asset_name: kn-workflow-darwin-arm64-${{ inputs.tag }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: "Upload Knative CLI Workflow Plugin for Windows" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,6 @@ jobs: | |
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlMacOs: "${{ inputs.download_asset_url }}/STAGING__kie_sandbox_extended_services_macos_${{ inputs.tag }}.dmg" | ||
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesDownloadUrlWindows: "${{ inputs.download_asset_url }}/STAGING__kie_sandbox_extended_services_windows_${{ inputs.tag }}.exe" | ||
SERVERLESS_LOGIC_SANDBOX__kieSandboxExtendedServicesCompatibleVersion: "${{ inputs.tag }}" | ||
KN_PLUGIN_WORKFLOW_quarkusVersion: "2.10.0.Final" | ||
run: | | ||
pnpm -r build:prod | ||
|
||
|
@@ -561,8 +560,8 @@ jobs: | |
username: "${{ env.DASHBUILDER__baseImageAccount }}" | ||
password: "${{ secrets.quay_registry_password }}" | ||
|
||
- name: "STAGING: Upload Knative CLI Workflow Plugin for Linux (Ubuntu only)" | ||
if: ${{ matrix.os == 'ubuntu-latest' && !inputs.dry_run }} | ||
- name: "STAGING: Upload Knative CLI Workflow Plugin for Linux" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
|
@@ -572,8 +571,8 @@ jobs: | |
asset_name: STAGING__kn-workflow-linux-amd64-${{ inputs.tag }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: "STAGING: Upload Knative CLI Workflow Plugin for macOS (macOS only)" | ||
if: ${{ matrix.os == 'macos-latest' && !inputs.dry_run }} | ||
- name: "STAGING: Upload Knative CLI Workflow Plugin for macOS" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
|
@@ -583,8 +582,19 @@ jobs: | |
asset_name: STAGING__kn-workflow-darwin-amd64-${{ inputs.tag }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: "STAGING: Knative CLI Workflow Plugin for Windows (Windows only)" | ||
if: ${{ matrix.os == 'windows-latest' && !inputs.dry_run }} | ||
- name: "STAGING: Upload Knative CLI Workflow Plugin for macOS M1" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
with: | ||
upload_url: ${{ inputs.upload_asset_url }} | ||
asset_path: ${{ github.workspace }}/kie-tools/packages/kn-plugin-workflow/dist/kn-workflow-darwin-arm64 | ||
asset_name: STAGING__kn-workflow-darwin-arm64-${{ inputs.tag }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: "STAGING: Knative CLI Workflow Plugin for Windows" | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.gh_token }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,48 @@ | ||
all: | ||
GO111MODULE=on GOOS=windows GOARCH=amd64 go build -ldflags "-X 'github.com/kiegroup/kie-tools/kn-plugin-workflow/pkg/common.QUARKUS_VERSION=$(build-env knPluginWorkflow.quarkusVersion)'" -o dist/kn-workflow-windows-amd64.exe cmd/main.go | ||
# | ||
# Copyright 2022 Red Hat, Inc. and/or its affiliates. | ||
# | ||
# Licensed 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. | ||
# | ||
|
||
BIN := kn-workflow | ||
BIN_DARWIN_AMD64 ?= $(BIN)-darwin-amd64 | ||
BIN_DARWIN_ARM64 ?= $(BIN)-darwin-arm64 | ||
BIN_LINUX ?= $(BIN)-linux-amd64 | ||
BIN_WINDOWS ?= $(BIN)-windows-amd64.exe | ||
|
||
QUARKUS_VERSION := $(shell pnpm build-env knPluginWorkflow.quarkusVersion) | ||
KOGITO_VERSION := $(shell pnpm build-env knPluginWorkflow.kogitoVersion) | ||
VERSION := $(shell pnpm build-env knPluginWorkflow.version) | ||
|
||
SET_QUARKUS_VERSION := main.quarkusVersion=$(QUARKUS_VERSION) | ||
SET_KOGITO_VERSION := main.kogitoVersion=$(KOGITO_VERSION) | ||
SET_VERSION := main.version=$(VERSION) | ||
LDFLAGS := "-X $(SET_QUARKUS_VERSION) -X $(SET_KOGITO_VERSION) -X $(SET_VERSION)" | ||
|
||
build-all: build-linux build-darwin-amd build-darwin-arm build-win32 | ||
|
||
build-linux: | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o ./dist/$(BIN_LINUX) cmd/main.go | ||
|
||
build-darwin-amd: | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags $(LDFLAGS) -o ./dist/$(BIN_DARWIN_AMD64) cmd/main.go | ||
|
||
build-darwin-arm: | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags $(LDFLAGS) -o ./dist/$(BIN_DARWIN_ARM64) cmd/main.go | ||
|
||
build-win32: | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -o ./dist/$(BIN_WINDOWS) cmd/main.go | ||
|
||
clean: | ||
go clean | ||
rm -rf $(BINARY_PATH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,84 +2,4 @@ | |
|
||
`kn-plugin-workflow` is a plugin of the Knative Client, to enable users to quickly set up a local Kogito Serverless Workflow project from the command line. | ||
|
||
## Getting Started | ||
|
||
Note: In order to use the `workflow` plugin, you must install: | ||
|
||
- [Java](https://www.java.com/en/download/help/download_options.html) at least version 11 | ||
- [Maven](https://maven.apache.org/install.html) at least version 3.8.1 | ||
- [Docker](https://docs.docker.com/engine/install/) (Optional) | ||
- [Podman](https://docs.podman.io/en/latest/) (Optional) | ||
- [Kubernetes CLI `kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl). | ||
|
||
### Instalation | ||
|
||
You can download the latest binaries from the [Releases](https://github.com/kiegroup/kie-tools/releases) page. | ||
|
||
There are two ways to run `kn workflow`: | ||
|
||
1. You can run it standalone, just put it on your system path and make sure it is executable. | ||
2. You can install it as a plugin of the `kn` client to run: | ||
- Follow the [documentation](https://github.com/knative/client/blob/main/docs/README.md#installing-kn) to install `kn` CLI if you don't have it | ||
- Copy the `kn-workflow` binary to a directory on your `PATH` (for example, `/usr/local/bin`) and make sure its filename is `kn-workflow` | ||
- On macOS give the ownership to the root user: `sudo chown root: /usr/local/bin/kn-workflow` | ||
- Run `kn plugin list` to verify that the `kn-workflow` plugin is installed successfully | ||
|
||
After the plugin is installed, you can use `kn workflow` to run its related subcommands. | ||
|
||
## Usage | ||
|
||
``` | ||
Get up and running with a local Knative environment | ||
|
||
Usage: | ||
kn workflow [command] | ||
|
||
Available Commands: | ||
build Build a Kogito Serverless Workflow project and generate a container image | ||
completion Generate the autocompletion script for the specified shell | ||
create Create a Kogito Serverless Workflow project | ||
deploy Deploy a Kogito Serverless Workflow project | ||
help Help about any command | ||
|
||
Flags: | ||
-h, --help help for kn-workflow | ||
-v, --verbose Print verbose logs | ||
|
||
Use "kn workflow [command] --help" for more information about a command. | ||
``` | ||
|
||
### create | ||
|
||
This command will scaffold a new Kogito Serverless Workflow project named "my-project": | ||
|
||
```bash | ||
kn workflow create --name my-project | ||
``` | ||
|
||
### build | ||
|
||
Builds a Kogito Serverless Workflow project in the current directory and generate a specific image: | ||
|
||
```bash | ||
kn workflow build --image quay.io/mysuer/myproject | ||
``` | ||
|
||
### deploy | ||
|
||
Deploys a Kogito Serverless Workflow project in the current directory (build command is required): | ||
|
||
```bash | ||
kn workflow deploy | ||
``` | ||
|
||
## Building from Source | ||
|
||
```bash | ||
git clone [email protected]:kiegroup/kie-tools.git | ||
cd kie-tools | ||
yarn bootstrap | ||
cd packages/kn-plugin-workflow | ||
go mod tidy | ||
yarn build | ||
``` | ||
[Read the documentation](https://kiegroup.github.io/kogito-docs/serverlessworkflow/main/tooling/kn-plugin-workflow-overview.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be difficult in the future to understand what
version
is. Would it be possible to use a more specific variable name?