Skip to content

Commit

Permalink
Support build testing pulsar cloud with oxia (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao authored Apr 4, 2023
1 parent 1e93861 commit f17ebbb
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG PULSAR_FQ_IMAGE
FROM ${PULSAR_FQ_IMAGE}

ARG OXIA_VERSION

USER root
RUN rm -rf /pulsar/lib/pulsar-metadatastore-oxia-*-shaded.jar

COPY ../pulsar-metadatastore-oxia/target/pulsar-metadatastore-oxia-${OXIA_VERSION}-shaded.jar /pulsar/lib
61 changes: 61 additions & 0 deletions .github/workflows/dispatch-build-test-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build & Publish testing pulsar image

on:
workflow_dispatch:
inputs:
pulsar_image:
description: pulsar image
required: true
pulsar_tag:
description: pulsar tag
required: true
publish_image:
description: publish image
required: true

envs:
PULSAR_TAG: ${{ github.event.inputs.pulsar_tag }}
PULSAR_FQ_IMAGE: ${{ github.event.inputs.pulsar_image }}:${{ github.event.inputs.pulsar_cloud_tag }}
PUBLISH_IMAGE: ${{ github.event.inputs.publish_image }}

jobs:
build-publish:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: mvn clean install -DskipTests
- name: Extract Maven project version
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
id: version
- uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
envs:
OXIA_VERSION: ${{ steps.version.outputs.version }}
with:
context: .
platforms: linux/x86_64,linux/arm64
push: true
file: {context}/.ci/Dockerfile
tags: $PUBLISH_IMAGE:$PULSAR_TAG-oxia-$OXIA_VERSION
build-args:
PULSAR_FQ_IMAGE: $PULSAR_FQ_IMAGE
OXIA_VERSION: $OXIA_VERSION
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
<header>etc/APACHE-2.txt</header>
<excludes>
<exclude>NOTICE</exclude>
<exclude>.ci/**/*</exclude>
</excludes>
</licenseSet>
</licenseSets>
Expand Down

0 comments on commit f17ebbb

Please sign in to comment.