Skip to content

Commit

Permalink
Merge pull request #88 from nityatadepalli123/kafka-java-console-sample
Browse files Browse the repository at this point in the history
adding kafka-java-console-sample workflow
  • Loading branch information
JunliWang authored Jan 24, 2024
2 parents 1ab9a15 + d75c640 commit a01a3b8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build & publish event-streams-samples images
on:
push:
branches: ['master']
paths:
- 'kafka-java-console-sample/**'

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- directory: kafka-java-console-sample
image: kafka-java-console-sample:latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Build image
run: |
cd ${{ matrix.directory }}
docker build . --file Dockerfile --tag ${{ matrix.image }} --label "latest"
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.image }}
# This changes all uppercase characters to lowercase.
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo IMAGE_ID=$IMAGE_ID
docker tag ${{ matrix.image }} $IMAGE_ID
docker push $IMAGE_ID
7 changes: 5 additions & 2 deletions kafka-java-console-sample/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM gradle:jdk8-alpine as jdk
FROM gradle:jdk11-alpine as jdk

COPY --chown=1000 . /usr/src/app
WORKDIR /usr/src/app

COPY build.gradle settings.gradle /usr/src/app/
COPY src /usr/src/app/src

RUN gradle -s --no-daemon assemble

FROM ibmjava:8-sfj-alpine
FROM openjdk:11

COPY --from=jdk /usr/src/app/build/libs/kafka-java-console-sample-2.0.jar /usr/src/app/

Expand Down
2 changes: 1 addition & 1 deletion kafka-java-console-sample/docs/Local.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We will not discuss establishing a connection from your laptop to Event Streams
2. **If you don't already have them, install the following prerequisites:**

* [git](https://git-scm.com/)
* [Gradle 7 of higher](https://gradle.org/)
* [Gradle 8 of higher](https://gradle.org/)
* Java 8 or higher


Expand Down
2 changes: 1 addition & 1 deletion kafka-java-console-sample/kafka-java-console-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: default
spec:
containers:
- image: ibmcom/kafka-java-console-sample:latest
- image: event-streams-samples/kafka-java-console-sample:latest
imagePullPolicy: Always
name: java-sample
env:
Expand Down

0 comments on commit a01a3b8

Please sign in to comment.