-
Notifications
You must be signed in to change notification settings - Fork 4
Improved CI workflow to build, test (matrix), push server Docker img #2
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 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e7f4da2
Converted project to multi-module, added CI workflow
petruki 89355d5
Fixed workflow to run ojp-serve as non-blocking step
petruki bdb65ac
Improved CI workflow to build, test (matrix), push server Docker img …
petruki a149796
Simplified PreparedStatement implementation to extend Statement. Few …
rrobetti 8f08457
ci: fixed job build-test title and docker image name
petruki 2d66c84
Merge remote-tracking branch 'origin/main' into main
rrobetti 99e76af
Merge remote-tracking branch 'origin/main' into main
rrobetti ec3a42c
Improved CI workflow to build, test (matrix), push server Docker img …
petruki a39413c
ci: fixed job build-test title and docker image name
petruki 56fd161
ci: fixes server module build JDK setup (#6)
petruki 8a6cd50
Repurposed Docker build workflow for manual dispatch
petruki 8b9ee64
Merge and compilation fixes.
rrobetti 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # This workflow builds and pushes the Docker image for the OJP server. | ||
| # It should only trigger when there are changes in the `ojp-server` or `ojp-grpc-commons` modules. | ||
| name: Main OJP Server Docker Image CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - '.github/workflows/main-docker.yml' | ||
| - 'ojp-server/**' | ||
| - 'ojp-grpc-commons/**' | ||
|
|
||
| jobs: | ||
| build-docker-image: | ||
| name: Build Docker Image | ||
| runs-on: ubuntu-latest | ||
| if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
|
|
||
| steps: | ||
| - name: Git checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up JDK 22 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: 22 | ||
| distribution: 'temurin' | ||
| cache: maven | ||
|
|
||
| - name: Build and push Docker image | ||
| env: | ||
| DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} | ||
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| DOCKERHUB_REPO: ${{ vars.DOCKERHUB_REPO }} | ||
| run: | | ||
| mvn compile jib:build -pl ojp-server \ | ||
| -Dimage="${DOCKERHUB_REPO}:latest" \ | ||
| -Djib.to.auth.username="${DOCKERHUB_USER}" \ | ||
| -Djib.to.auth.password="${DOCKERHUB_TOKEN}" \ | ||
| -Djib.to.image="${DOCKERHUB_REPO}:latest" \ | ||
| -Djib.container.mainClass="org.openjdbcproxy.grpc.server.GrpcServer" \ | ||
| -Djib.container.ports=1059 | ||
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,104 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
| <parent> | ||
| <artifactId>ojp-parent</artifactId> | ||
| <groupId>org.openjdbcproxy</groupId> | ||
| <version>1.0-SNAPSHOT</version> | ||
| </parent> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <artifactId>ojp-jdbc-driver</artifactId> | ||
| <version>1.0-SNAPSHOT</version> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <version>3.2.5</version> | ||
| <configuration> | ||
| <runOrder>alphabetical</runOrder> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <version>3.5.1</version> | ||
| <executions> | ||
| <execution> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>shade</goal> | ||
| </goals> | ||
| <configuration> | ||
| <createDependencyReducedPom>true</createDependencyReducedPom> | ||
| <transformers> | ||
| <transformer /> | ||
| <transformer /> | ||
| </transformers> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.projectlombok</groupId> | ||
| <artifactId>lombok</artifactId> | ||
| <version>1.18.38</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <version>4.13.2</version> | ||
| <scope>test</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <artifactId>hamcrest-core</artifactId> | ||
| <groupId>org.hamcrest</groupId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.h2database</groupId> | ||
| <artifactId>h2</artifactId> | ||
| <version>2.3.232</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter</artifactId> | ||
| <version>5.12.1</version> | ||
| <scope>test</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <artifactId>junit-jupiter-engine</artifactId> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-params</artifactId> | ||
| <version>5.12.1</version> | ||
| <scope>test</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <artifactId>apiguardian-api</artifactId> | ||
| <groupId>org.apiguardian</groupId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| </dependencies> | ||
| <properties> | ||
| <maven.compiler.target>11</maven.compiler.target> | ||
| <slf4j.version>2.0.17</slf4j.version> | ||
| <maven.compiler.source>11</maven.compiler.source> | ||
| </properties> | ||
| </project> |
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
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.
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.
We may want to keep the repository and image name hard-coded here. I use env vars to test with my own DockerHub account.
Another thing you may want to change is the tag. I set it to latest, but I saw that you are creating as 0.0.1-alpha
Let me know if you want to change this.
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 changed this to make only DockerHub repository configurable through Action vars.
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.
version is 0.0.3-alpha, we are not using latest for now to not look like it is a production ready version.
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.
Repurposed the workflow to be dispatched manually.
You can run the workflow by providing tag (default: latest) and repository (default: rrobetti)