-
Notifications
You must be signed in to change notification settings - Fork 10
FUSETOOLS2-2489: Migrate deployment of single file from Camel K to Debug adapter #745
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| name: Deploy to Kubernetes CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| deploy: | ||
| env: | ||
| CODE_VERSION: max | ||
| TEST_RESOURCES: test-resources | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: 17 | ||
| distribution: "temurin" | ||
|
|
||
| - name: Install JBang | ||
| run: | | ||
| curl -Ls https://sh.jbang.dev | bash -s - app setup | ||
| echo "$HOME/.jbang/bin" >> $GITHUB_PATH | ||
| - name: Setup JBang (trusted sources) | ||
| run: jbang trust add https://github.com/apache/ | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Start Minikube | ||
| uses: medyagh/setup-minikube@latest | ||
| with: | ||
| driver: docker | ||
| addons: registry | ||
|
|
||
| - name: Cluster info | ||
| run: | | ||
| kubectl cluster-info | ||
| kubectl get pods -n kube-system | ||
| echo "current-context:" $(kubectl config current-context) | ||
| echo "environment-kubeconfig:" ${KUBECONFIG} | ||
|
|
||
| - name: Install | ||
| run: npm ci | ||
|
|
||
| - name: Compile | ||
| run: npm run compile | ||
|
|
||
| - name: UI Tests | ||
| run: | | ||
| eval $(minikube -p minikube docker-env) | ||
| xvfb-run --auto-servernum npm run ui-test:deploy | ||
|
|
||
| - name: Upload Coverage Results | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: ui-test-screenshots | ||
| path: test-resources/screenshots/*.png | ||
|
|
||
| check: | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| name: Status Check | ||
| needs: [ deploy ] | ||
| steps: | ||
| - name: Test Matrix Result | ||
| run: | | ||
| echo result = ${{ needs.deploy.result }} | ||
| - name: Status Check - success | ||
| if: ${{ needs.deploy.result == 'success' }} | ||
| run: | | ||
| echo "All tests successfully completed!" | ||
| exit 0 | ||
| - name: Status Check - failure | ||
| if: ${{ needs.deploy.result != 'success' }} | ||
| run: | | ||
| echo "Status Check failed!" | ||
| exit 1 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Deployment into cluster using Camel JBang Kubernetes plugin | ||
|
|
||
| ## Manage deployment lifecycle | ||
|
|
||
| There are extensions which allows you to manage your deployments (which are part of an [Extension Pack for Apache Camel](https://marketplace.visualstudio.com/items?itemName=redhat.apache-camel-extension-pack)): | ||
|
|
||
| - [OpenShift Toolkit](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-openshift-connector) | ||
| - [Kubernetes](https://marketplace.visualstudio.com/items?itemName=ms-kubernetes-tools.vscode-kubernetes-tools) | ||
|
|
||
| or you can use a power of Camel CLI described below. | ||
|
|
||
| ### Follow logs | ||
|
|
||
| You can use Camel CLI to obtain logs of current running integration. In terminal window execute: | ||
|
|
||
| ```shell | ||
| jbang camel@apache/camel kubernetes logs --name=<name> | ||
| ``` | ||
|
|
||
| ### Remove deployment | ||
|
|
||
| To remove current integration, you can use also Camel CLI. In this case the command is: | ||
|
|
||
| ```shell | ||
| jbang camel@apache/camel kubernetes delete --name=<name> | ||
| ``` | ||
|
|
||
| #### Troubleshooting | ||
|
|
||
| For a latest releases of Camel (4.8.1+) there could be problem when deleting deployments using Camel Jbang CLI, for details you can see reported upstream issue [CAMEL-21388](https://issues.apache.org/jira/browse/CAMEL-21388). | ||
|
|
||
| In that case please try with previous version which was working better. | ||
|
|
||
| ```shell | ||
| jbang -Dcamel.jbang.version=4.8.0 camel@apache/camel kubernetes delete --name=<name> | ||
| ``` | ||
|
|
||
| ## How to deploy into local Kubernetes cluster | ||
|
|
||
| By default, the deployment aims OpenShift cluster. In case you need to deploy into Kubernetes, there is a small modification needed: | ||
|
|
||
| 1) open Settings UI in VS Code | ||
| - Linux/Windows - `File > Preferences > Settings` | ||
| - macOS - `Code > Settings... > Settings` | ||
| 2) navigate to `Extensions > Debug Adapter for Apache Camel` | ||
| 3) modify setting `Camel > Debug Adapter: Kubernetes Run Parameters` as you can see on picture below | ||
|
|
||
|  | ||
|
|
||
| The picture describes how to deploy to local Kubernetes cluster using Minikube. You can use eg. also `Kind`. In that case, just change to `--cluster-type=kind`. | ||
|
|
||
| For more information see [Camel Kubernetes plugin official documentation](https://camel.apache.org/manual/camel-jbang-kubernetes.html). | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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 hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.