Skip to content

Commit

Permalink
update v1.1 build and pom
Browse files Browse the repository at this point in the history
Signed-off-by: ruromero <rromerom@redhat.com>
  • Loading branch information
ruromero committed Feb 16, 2023
1 parent db5ff0c commit 4cf9c5c
Show file tree
Hide file tree
Showing 6 changed files with 5,033 additions and 857 deletions.
56 changes: 34 additions & 22 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,55 @@
name: Build
on:
workflow_dispatch:
push:
branches:
- 'main'
tags:
- 'v*.*.*'
env:
REGISTRY: quay.io
IMAGE_NAME: cloudevents-player
JAVA_VERSION: '17'

jobs:
build:
runs-on: ubuntu-latest
name: "Build native images"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up graalVM
uses: graalvm/setup-graalvm@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: 'latest'
java-version: '17'
components: 'native-image'
- name: Build the project
install: true
- name: Define tags
shell: bash
run: |
./mvnw package -Pnative
- name: Build the container image
id: build-image
uses: redhat-actions/buildah-build@v2
POM_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
VERSION=v${POM_VERSION%-SNAPSHOT}
echo "docker_tag=${VERSION}" >> $GITHUB_OUTPUT
id: build_tags
- name: Setup Java
uses: actions/setup-java@v3
with:
image: cloudevents-player
tags: v1.2
archs: amd64, arm64
dockerfiles: |
./src/main/docker/Dockerfile.native-micro
- name: Push to registry
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
cache: maven
- name: Log in to Quay
uses: docker/login-action@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/ruben
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build the project
run: |
if [ ${{ github.ref }} == 'refs/heads/main' ]; then
additional_tags="-Dquarkus.container-image.additional-tags=latest"
fi
./mvnw -B clean package -Dcontainer \
-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64 \
-Dquarkus.docker.buildx.output=type=registry \
-Dquarkus.container-image.tag=${{ steps.build_tags.outputs.docker_tag }} \
${additional_tags:-}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ work well and send valid CloudEvents.
By default the application will start using a loopback endpoint

```{bash}
./target/cloudevent-player-1.1-SNAPSHOT-runner
./target/cloudevent-player-1.1-runner
```

You can send a message from inside the application by filling in the form and the activity will show the sent
Expand Down Expand Up @@ -77,7 +77,7 @@ $ java -Dplayer.mode=LOCAL -jar target/quarkus-app/quarkus-run.jar
...
2022-06-24 18:39:07,794 INFO [io.und.websockets] (main) UT026003: Adding annotated server endpoint class com.redhat.syseng.tools.cloudevents.resources.MessagesSocket for path /socket
2022-06-24 18:39:08,130 INFO [io.qua.sma.ope.run.OpenApiRecorder] (main) Default CORS properties will be used, please use 'quarkus.http.cors' properties instead
2022-06-24 18:39:08,216 INFO [io.quarkus] (main) cloudevent-player 1.1-SNAPSHOT on JVM (powered by Quarkus 2.15.0.Final) started in 0.879s. Listening on: http://0.0.0.0:8080
2022-06-24 18:39:08,216 INFO [io.quarkus] (main) cloudevent-player 1.1 on JVM (powered by Quarkus 2.15.0.Final) started in 0.879s. Listening on: http://0.0.0.0:8080
2022-06-24 18:39:08,217 INFO [io.quarkus] (main) Profile prod activated.
2022-06-24 18:39:08,217 INFO [io.quarkus] (main) Installed features: [cdi, hibernate-validator, kubernetes-client, rest-client, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, smallrye-openapi, vertx, websockets, websockets-client]
```
Expand All @@ -94,7 +94,7 @@ Listening for transport dt_socket at address: 5005
2022-06-24 18:51:43,172 INFO [io.und.websockets] (Quarkus Main Thread) UT026003: Adding annotated server endpoint class com.redhat.syseng.tools.cloudevents.resources.MessagesSocket for path /socket

2022-06-24 18:51:43,229 WARN [org.jbo.res.res.i18n] (Quarkus Main Thread) RESTEASY002155: Provider class io.cloudevents.http.restful.ws.CloudEventsProvider is already registered. 2nd registration is being ignored.
2022-06-24 18:51:43,513 INFO [io.quarkus] (Quarkus Main Thread) cloudevent-player 1.1-SNAPSHOT on JVM (powered by Quarkus 2.15.0.Final) started in 2.543s. Listening on: http://localhost:8080
2022-06-24 18:51:43,513 INFO [io.quarkus] (Quarkus Main Thread) cloudevent-player 1.1 on JVM (powered by Quarkus 2.15.0.Final) started in 2.543s. Listening on: http://localhost:8080
2022-06-24 18:51:43,514 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2022-06-24 18:51:43,515 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, hibernate-validator, kubernetes-client, rest-client, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, smallrye-openapi, swagger-ui, vertx, websockets, websockets-client]

Expand All @@ -112,9 +112,9 @@ mvn clean install -Pnative
Run

```shell script
$ ./target/cloudevent-player-1.1-SNAPSHOT-runner -Dplayer.mode=LOCAL
$ ./target/cloudevent-player-1.1-runner -Dplayer.mode=LOCAL
...
2022-06-24 18:48:11,565 INFO [io.quarkus] (main) cloudevent-player 1.1-SNAPSHOT native (powered by Quarkus 2.15.0.Final) started in 0.022s. Listening on: http://0.0.0.0:8080
2022-06-24 18:48:11,565 INFO [io.quarkus] (main) cloudevent-player 1.1 native (powered by Quarkus 2.15.0.Final) started in 0.022s. Listening on: http://0.0.0.0:8080
2022-06-24 18:48:11,565 INFO [io.quarkus] (main) Profile prod activated.
2022-06-24 18:48:11,565 INFO [io.quarkus] (main) Installed features: [cdi, hibernate-validator, kubernetes-client, rest-client, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, smallrye-openapi, vertx, websockets, websockets-client]
2022-06-24 18:48:17,028 INFO [com.red.sys.too.clo.ser.MessageService] (ForkJoinPool.commonPool-worker-3) Player mode LOCAL - broker: http://localhost:8080/
Expand Down Expand Up @@ -168,10 +168,10 @@ Cloudevents-player comes with 2 modes defined in the PLAYER_MODE environment var

```bash
# Local Mode
./target/cloudevent-player-1.1-SNAPSHOT-runner -Dplayer.mode=LOCAL
./target/cloudevent-player-1.1-runner -Dplayer.mode=LOCAL

# Knative Mode
./target/cloudevent-player-1.1-SNAPSHOT-runner -Dplayer.mode=KNATIVE
./target/cloudevent-player-1.1-runner -Dplayer.mode=KNATIVE
```

### Broker URI
Expand All @@ -180,7 +180,7 @@ Sets the broker URI where the messages will be sent to. It will always be `local
Overrides the name and namespace properties.

```bash
./target/cloudevent-player-1.1-SNAPSHOT-runner -Dplayer.mode=KNATIVE -Dbroker.uri=http://some-broker:1234
./target/cloudevent-player-1.1-runner -Dplayer.mode=KNATIVE -Dbroker.uri=http://some-broker:1234
```

### Broker Name and Namespace
Expand All @@ -190,7 +190,7 @@ namespace will be the current namespace.

```bash
# The broker URL
./target/cloudevent-player-1.1-SNAPSHOT-runner -Dplayer.mode=KNATIVE -Dbroker.name=example -Dbroker.namespace=other
./target/cloudevent-player-1.1-runner -Dplayer.mode=KNATIVE -Dbroker.name=example -Dbroker.namespace=other
...
2022-06-24 19:08:53,681 INFO [com.red.sys.too.clo.ser.MessageService] (ForkJoinPool.commonPool-worker-3) Player mode KNATIVE - broker: http://broker-ingress.knative-eventing.svc.cluster.local/other/example
```
Loading

0 comments on commit 4cf9c5c

Please sign in to comment.