Skip to content

Commit d7ad2c0

Browse files
authored
Initial commit
0 parents  commit d7ad2c0

35 files changed

+1505
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
FROM ubuntu:24.04
2+
3+
ARG BUILDPLATFORM
4+
ARG DEBIAN_FRONTEND=noninteractive
5+
6+
USER root
7+
WORKDIR /root
8+
9+
RUN apt update && apt install -y \
10+
apt-transport-https ca-certificates gnupg curl wget git zip unzip less zsh net-tools iputils-ping jq lsof
11+
12+
ENV HOME="/root"
13+
14+
# --------------------------------------
15+
# Git
16+
# --------------------------------------
17+
# Need to add the devcontainer workspace folder as a safe directory to enable git
18+
# version control system to be enabled in the containers file system.
19+
RUN git config --global --add safe.directory "/workspaces/plugin-template"
20+
# --------------------------------------
21+
22+
# --------------------------------------
23+
# Oh my zsh
24+
# --------------------------------------
25+
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" -- \
26+
-t robbyrussell \
27+
-p git -p node -p npm
28+
29+
ENV SHELL=/bin/zsh
30+
# --------------------------------------
31+
32+
# --------------------------------------
33+
# Java
34+
# --------------------------------------
35+
ARG OS_ARCHITECTURE
36+
37+
RUN mkdir -p /usr/java
38+
RUN echo "Building on platform: $BUILDPLATFORM"
39+
RUN case "$BUILDPLATFORM" in \
40+
"linux/amd64") OS_ARCHITECTURE="x64_linux" ;; \
41+
"linux/arm64") OS_ARCHITECTURE="aarch64_linux" ;; \
42+
"darwin/amd64") OS_ARCHITECTURE="x64_mac" ;; \
43+
"darwin/arm64") OS_ARCHITECTURE="aarch64_mac" ;; \
44+
*) echo "Unsupported BUILDPLATFORM: $BUILDPLATFORM" && exit 1 ;; \
45+
esac && \
46+
wget "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.7%2B6/OpenJDK21U-jdk_${OS_ARCHITECTURE}_hotspot_21.0.7_6.tar.gz" && \
47+
mv OpenJDK21U-jdk_${OS_ARCHITECTURE}_hotspot_21.0.7_6.tar.gz openjdk-21.0.7.tar.gz
48+
RUN tar -xzvf openjdk-21.0.7.tar.gz && \
49+
mv jdk-21.0.7+6 jdk-21 && \
50+
mv jdk-21 /usr/java/
51+
ENV JAVA_HOME=/usr/java/jdk-21
52+
ENV PATH="$PATH:$JAVA_HOME/bin"
53+
# Will load a custom configuration file for Micronaut
54+
ENV MICRONAUT_ENVIRONMENTS=local,override
55+
# Sets the path where you save plugins as Jar and is loaded during the startup process
56+
ENV KESTRA_PLUGINS_PATH="/workspaces/plugin-template/local/plugins"
57+
# --------------------------------------
58+
59+
# --------------------------------------
60+
# SSH
61+
# --------------------------------------
62+
RUN mkdir -p ~/.ssh
63+
RUN touch ~/.ssh/config
64+
RUN echo "Host github.com" >> ~/.ssh/config \
65+
&& echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
66+
RUN touch ~/.ssh/id_ed25519
67+
# --------------------------------------

.devcontainer/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Kestra Plugin Devcontainer
2+
3+
This devcontainer provides a quick and easy setup for anyone using VSCode to get up and running quickly with plugin development for Kestra. It bootstraps a docker container for you to develop inside of without the need to manually setup the environment for developing plugins.
4+
5+
---
6+
7+
## INSTRUCTIONS
8+
9+
### Setup:
10+
11+
Once you have this repo cloned to your local system, you will need to install the VSCode extension [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack).
12+
13+
Then run the following command from the command palette:
14+
`Dev Containers: Open Folder in Container...` and select your Kestra root folder.
15+
16+
This will then put you inside a docker container ready for development.
17+
18+
NOTE: you'll need to wait for the gradle build to finish and compile Java files but this process should happen automatically within VSCode.
19+
20+
---
21+
22+
### Development:
23+
24+
It is recommended to read the following plugin development guide so you can better understand how to get started with plugin development: https://kestra.io/docs/plugin-developer-guide.
25+
26+
The next step is to run docker compose as this will build a custom Kestra image for you and also map the plugins folder to the local Kestra instance. There is also a volume mount so any changes to the plugin source code will reflect inside the local Kestra instance giving you a good development experience with a faster feedback loop.
27+
28+
Make sure to run the following command from your host system to start the docker compose stack as you cannot run docker within docker, so navigate to this folder within your host system and run the command:
29+
30+
```bash
31+
$ docker compose down -v && docker compose up -d
32+
```
33+
34+
From this point, you can start developing your plugin and every time you want it updated within Kestra, run the following command to build the plugin: `./gradlew shadowJar`.
35+
36+
The resulting JAR file will be generated in the `build/libs` directory and should automatically get reflected inside the local Kestra instance. However, you will need to manually restart the Kestra container for the plugin to take effect after making changes so Kestra can reload the plugins. But this is still a much better and faster developer experience as you won't need to rebuild the image and create a new container each time you make any source code changes.
37+
38+
You can now navigate to http://localhost:8080 and start using your custom plugin.
39+
40+
`Tests`:
41+
42+
```bash
43+
$ ./gradlew check --parallel
44+
```
45+
46+
---
47+
48+
### GIT
49+
50+
If you want to commit to GitHub, make sure to navigate to the `~/.ssh` folder and either create a new SSH key or override the existing `id_ed25519` file and paste an existing SSH key from your local machine into this file. You will then need to change the permissions of the file by running: `chmod 600 id_ed25519`. This will allow you to then push to GitHub.
51+
52+
---

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "plugin-template",
3+
"build": {
4+
"context": ".",
5+
"dockerfile": "Dockerfile"
6+
},
7+
"workspaceFolder": "/workspaces/plugin-template",
8+
"forwardPorts": [8080],
9+
"customizations": {
10+
"vscode": {
11+
"settings": {
12+
"terminal.integrated.profiles.linux": {
13+
"zsh": {
14+
"path": "/bin/zsh"
15+
}
16+
},
17+
"workbench.iconTheme": "vscode-icons",
18+
"editor.tabSize": 4,
19+
"editor.formatOnSave": true,
20+
"files.insertFinalNewline": true,
21+
"editor.defaultFormatter": "redhat.java",
22+
"telemetry.telemetryLevel": "off",
23+
"editor.bracketPairColorization.enabled": true,
24+
"editor.guides.bracketPairs": "active"
25+
},
26+
"extensions": [
27+
"redhat.vscode-yaml",
28+
"vscode-icons-team.vscode-icons",
29+
"eamodio.gitlens",
30+
"oderwat.indent-rainbow",
31+
"evondev.indent-rainbow-palettes",
32+
"IronGeek.vscode-env",
33+
"github.vscode-github-actions",
34+
"vscjava.vscode-java-pack"
35+
]
36+
}
37+
}
38+
}

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
root = true
2+
3+
[*]
4+
charset=utf-8
5+
end_of_line=lf
6+
insert_final_newline=false
7+
trim_trailing_whitespace=true
8+
indent_style=space
9+
indent_size=4
10+
continuation_indent_size=4
11+
12+
[*.yml]
13+
indent_size=2
14+
15+
[*.md]
16+
indent_size=2
17+
18+
[*.yaml]
19+
indent_size=2
20+
21+
[*.json]
22+
indent_size=2
23+
24+
[*.css]
25+
indent_size=2

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Match the .editorconfig
2+
* text=auto eol=lf
3+
4+
# Scripts
5+
*.bat text eol=crlf
6+
*.sh text eol=lf
7+
8+
# Gradle wrapper
9+
/gradlew text eol=lf

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Bug report
2+
description: File a bug report
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thanks for reporting an issue! Please provide a [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) and share any additional information that may help reproduce, troubleshoot, and hopefully fix the issue, including screenshots, error traceback, and your Kestra server logs. For quick questions, you can contact us directly on [Slack](https://kestra.io/slack).
8+
- type: textarea
9+
attributes:
10+
label: Describe the issue
11+
description: A concise description of the issue and how we can reproduce it.
12+
placeholder: Describe the issue step by step
13+
validations:
14+
required: true
15+
- type: textarea
16+
attributes:
17+
label: Environment
18+
description: Environment information where the problem occurs.
19+
value: |
20+
- Kestra Version: develop
21+
validations:
22+
required: false
23+
labels:
24+
- bug
25+
- area/plugin

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Chat
3+
url: https://kestra.io/slack
4+
about: Chat with us on Slack.

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Feature request
2+
description: Create a new feature request
3+
body:
4+
- type: textarea
5+
attributes:
6+
label: Feature description
7+
placeholder: Tell us more about your feature request
8+
validations:
9+
required: true
10+
labels:
11+
- enhancement
12+
- area/plugin

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See GitHub's docs for more information on this file:
2+
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
# Maintain dependencies for GitHub Actions
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
# Check for updates to GitHub Actions every weekday
10+
interval: "weekly"
11+
labels:
12+
- "dependency-upgrade"
13+
open-pull-requests-limit: 50
14+
15+
# Maintain dependencies for Gradle modules
16+
- package-ecosystem: "gradle"
17+
directory: "/"
18+
schedule:
19+
# Check for updates to Gradle modules every week
20+
interval: "weekly"
21+
labels:
22+
- "dependency-upgrade"
23+
open-pull-requests-limit: 50

.github/pull_request_template.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!-- Thanks for submitting a Pull Request to kestra. To help us review your contribution, please follow the guidelines below:
2+
3+
- Make sure that your commits follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification e.g. `feat(ui): add a new navigation menu item` or `fix(core): fix a bug in the core model` or `docs: update the README.md`. This will help us automatically generate the changelog.
4+
- The title should briefly summarize the proposed changes.
5+
- Provide a short overview of the change and the value it adds.
6+
- Share a flow example to help the reviewer understand and QA the change.
7+
- Use "close" to automatically close an issue. For example, `close #1234` will close issue #1234. -->
8+
9+
### What changes are being made and why?
10+
<!-- Please include a brief summary of the changes included in this PR e.g. closes #1234. -->
11+
12+
---
13+
14+
### How the changes have been QAed?
15+
16+
<!-- Include example code that shows how this PR has been QAed. The code should present a complete yet easily reproducible flow.
17+
18+
```yaml
19+
# Your example flow code here
20+
```
21+
22+
Note that this is not a replacement for unit tests but rather a way to demonstrate how the changes work in a real-life scenario, as the end-user would experience them.
23+
24+
Remove this section if this change applies to all flows or to the documentation only. -->
25+
26+
---
27+
28+
### Setup Instructions
29+
30+
<!--If there are any setup requirements like API keys or trial accounts, kindly include brief bullet-points-description outlining the setup process below.
31+
32+
- [External System Documentation](URL)
33+
- Steps to set up the necessary resources
34+
35+
If there are no setup requirements, you can remove this section.
36+
37+
Thank you for your contribution. ❤️ -->
38+
39+
---
40+
41+
### Contributor Checklist ✅
42+
43+
- [ ] I have read and followed the [plugin contribution guidelines](https://kestra.io/docs/plugin-developer-guide/contribution-guidelines)

0 commit comments

Comments
 (0)