-
Notifications
You must be signed in to change notification settings - Fork 3
AB-449 PostgreSQL Operator: Project Setup + ClusterConnection and Role CRD
#1
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
Changes from 20 commits
d5c888e
e5df81f
035d5bf
b35354f
69fcdfa
7e11c98
2020658
92ab045
cde4784
c55c6b5
8cbbe0b
fe5cd98
3db4900
ee9f1ec
5a4669a
5a03d6c
288656a
6fb668f
6f98910
8616b99
a131ea9
a5d3081
358aee1
f8e539d
020797c
97629dd
9db67e1
9b0cccd
8d64cfe
46ef0ae
1343797
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| * | ||
| !build/*-runner | ||
| !build/*-runner.jar | ||
| !build/lib/* | ||
| !build/quarkus-app/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = 4 | ||
| indent_style = space | ||
| insert_final_newline = true | ||
| max_line_length = 120 | ||
| tab_width = 4 | ||
| ij_continuation_indent_size = 8 | ||
|
|
||
| [*.yml] | ||
| indent_size = 2 | ||
|
|
||
| [*.md] | ||
| max_line_length = off | ||
|
|
||
| [Makefile*] | ||
| indent_style = tab | ||
|
|
||
| [src/main/resources/default_banner.txt] | ||
| insert_final_newline = false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| src/generated/** linguist-generated |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
| set -o pipefail | ||
|
|
||
| ./gradlew --console=colored checkstyleMain checkstyleTest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [ opened, reopened, synchronize ] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Tests | ||
| uses: ./.github/workflows/test.yml | ||
| secrets: inherit | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Tests | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: aboutbits/github-actions-java/setup-with-gradle@v4 | ||
| with: | ||
| java-version: 25 | ||
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | ||
| - name: Build & Test | ||
| run: >- | ||
| ./gradlew | ||
| --console=colored | ||
| test | ||
| --fail-fast | ||
| env: | ||
| GITHUB_USER_NAME: ${{ github.actor }} | ||
| GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| ### PostgreSQL Operator ### | ||
| config/ | ||
|
|
||
| ### STS ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
|
|
||
| ### IntelliJ IDEA ### | ||
| # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
| .idea/* | ||
| !.idea/codeStyles | ||
| !.idea/.gitignore | ||
| !.idea/checkstyle-idea.xml | ||
| !.idea/encodings.xml | ||
| !.idea/misc.xml | ||
| !.idea/sqldialects.xml | ||
| !.idea/vcs.xml | ||
|
|
||
| *.iml | ||
| *.ipr | ||
| *.iws | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
| build/ | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| ### Mac ### | ||
| .DS_Store | ||
|
|
||
| ### Gradle ### | ||
| # Reference: https://github.com/github/gitignore/blob/main/Gradle.gitignore | ||
| .gradle | ||
| **/build/ | ||
| !**/src/**/build/ | ||
| gradle-app.setting | ||
| !gradle-wrapper.jar | ||
| !gradle-wrapper.properties | ||
| .gradletasknamecache | ||
|
|
||
| ### Quarkus ### | ||
| # Local environment | ||
| .env | ||
|
|
||
| # Plugin directory | ||
| /.quarkus/cli/plugins/ | ||
|
|
||
| # Quinoa | ||
| .quinoa/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ### SETUP | ||
|
|
||
| init: | ||
| $(MAKE) install | ||
|
|
||
| install: | ||
| ./gradlew --console=colored quarkusBuild | ||
|
|
||
|
|
||
| ### EXECUTION | ||
|
|
||
| run: | ||
| ./gradlew --console=colored quarkusDev | ||
|
|
||
| test: | ||
| ./gradlew --console=colored clean test | ||
|
|
||
| # Flag targets as phony, to tell `make` that these are no file targets | ||
| .PHONY: init install run test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,100 @@ | ||
| # AboutBits PostgreSQL Operator | ||
|
|
||
| ## Getting started | ||
|
|
||
| These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| To build the project, the following prerequisites must be met: | ||
|
|
||
| - Java JDK (e.g. [OpenJDK](https://openjdk.java.net/)) | ||
| - [Gradle](https://gradle.org/) (Optional) | ||
| - [Docker](https://www.docker.com/) | ||
|
|
||
| ### Setup configuration | ||
|
|
||
| To get started, call: | ||
|
|
||
| ```bash | ||
| make init | ||
| ``` | ||
|
|
||
| ### Running the project in the console | ||
|
|
||
| You can run your application in dev mode that enables live coding and continuous testing using: | ||
|
|
||
| ```shell script | ||
| make run | ||
|
|
||
| # or | ||
|
|
||
| ./gradlew quarkusDev | ||
| ``` | ||
|
|
||
| The app service will be available at http://localhost:8080, | ||
| and you can also use the Dev UI (available in dev mode only) at <http://localhost:8080/q/dev/>. | ||
|
|
||
| To execute the test without continuous testing in the dev mode, you can run the following command: | ||
|
|
||
| ```bash | ||
| make test | ||
|
|
||
| # or | ||
|
|
||
| ./gradlew test | ||
| ``` | ||
|
|
||
| ### Run the project as a service in IntelliJ | ||
|
|
||
| 1. Open the `Services` tool on the left side of the IDE | ||
| 2. Click on "+" and select "Quarkus" | ||
|
|
||
| Afterward, the project can be started in IntelliJ by navigating to `Run` -> `Run '...'`. | ||
|
|
||
| ## Packaging and running the application | ||
|
|
||
| The application can be packaged using: | ||
|
|
||
| ```shell script | ||
| ./gradlew build | ||
| ``` | ||
|
|
||
| It produces the `quarkus-run.jar` file in the `build/quarkus-app/` directory. | ||
| Be aware that it’s not an _über-jar_ as the dependencies are copied into the `build/quarkus-app/lib/` directory. | ||
|
|
||
| The application is now runnable using `java -jar build/quarkus-app/quarkus-run.jar`. | ||
|
|
||
| If you want to build an _über-jar_, execute the following command: | ||
|
|
||
| ```shell script | ||
| ./gradlew build -Dquarkus.package.jar.type=uber-jar | ||
| ``` | ||
|
|
||
| The application, packaged as an _über-jar_, is now runnable using `java -jar build/*-runner.jar`. | ||
|
|
||
| ## Creating a native executable | ||
|
|
||
| You can create a native executable using: | ||
|
|
||
| ```shell script | ||
| ./gradlew build -Dquarkus.native.enabled=true | ||
| ``` | ||
|
|
||
| Or, if you don't have GraalVM installed, you can run the native executable build in a container using: | ||
|
|
||
| ```shell script | ||
| ./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true | ||
| ``` | ||
|
|
||
| You can then execute your native executable with: `./build/postgresql-operator-1.0.0-SNAPSHOT-runner` | ||
|
|
||
| If you want to learn more about building native executables, please consult <https://quarkus.io/guides/gradle-tooling>. | ||
|
|
||
| ## Related Guides | ||
|
|
||
| - Operator SDK ([guide](https://docs.quarkiverse.io/quarkus-operator-sdk/dev/index.html)): Quarkus extension for the Java Operator SDK (https://javaoperatorsdk.io) | ||
| - Helm ([guide](https://docs.quarkiverse.io/quarkus-helm/dev/index.html)): Quarkus extension for Kubernetes Helm charts | ||
| - SmallRye Health ([guide](https://quarkus.io/guides/smallrye-health)): Monitor service health | ||
| - Micrometer metrics ([guide](https://quarkus.io/guides/micrometer)): Instrument the runtime and your application with dimensional metrics using Micrometer. | ||
| - YAML Configuration ([guide](https://quarkus.io/guides/config-yaml)): Use YAML to configure your Quarkus application |
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.
Here you used the structure/approach of our project pipelines. But wouldn't it be more appropriate to build this repository similar to a package where we have the publishing workflows?
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.
Yes, this makes sense. I will switch it to a publishing workflow, as we did it for other Java libs.
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.
I left it for now as is. I will change this workflow in a follow-up PR.
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.
Makes sense.