-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #382 from Altinity/pull-request-workflow
Pull request workflow
- Loading branch information
Showing
8 changed files
with
83 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,38 +1,55 @@ | ||
name: Sink connector(Kafka version) Docker Build/Push | ||
name: Kafka - Build | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
build-kafka: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
cache: maven | ||
|
||
- name: Setup env | ||
working-directory: sink-connector | ||
run: | | ||
echo "IMAGE_TAG=${{ github.event.number }}-$GITHUB_SHA-kafka" >> "$GITHUB_ENV" | ||
echo "PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> "$GITHUB_ENV" | ||
- name: Build with Maven | ||
working-directory: sink-connector | ||
run: mvn -B package --file pom.xml | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
|
||
- name: Upload Maven build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: clickhouse-sink-connector_${{ env.IMAGE_TAG }}.jar | ||
path: sink-connector/target/clickhouse-kafka-sink-connector-${{ env.PROJECT_VERSION }}.jar | ||
|
||
- name: Build with Go | ||
working-directory: sink-connector-client | ||
run: CGO_ENABLED=0 go build | ||
|
||
- name: Upload sink-connector-client | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
if: ${{ env.username != '' }} | ||
name: clickhouse-sink-connector-client_${{ env.IMAGE_TAG }} | ||
path: sink-connector-client/sink-connector-client | ||
|
||
- name: Build the Docker image | ||
env: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
if: ${{ env.username != '' }} | ||
working-directory: sink-connector | ||
run: docker build . --file docker/Dockerfile-sink-on-debezium-base-image --tag altinity/clickhouse-sink-connector:$(date +%F) | ||
- name: Push docker image to dockerhub | ||
env: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
if: ${{ env.username != '' }} | ||
working-directory: sink-connector | ||
run: docker push altinity/clickhouse-sink-connector:$(date +%F) | ||
run: | | ||
docker build . --file docker/Dockerfile-sink-on-debezium-base-image --tag clickhouse-sink-connector:${{ env.IMAGE_TAG }} | ||
docker save clickhouse-sink-connector:${{ env.IMAGE_TAG }}| gzip > clickhouse-sink-connector_${{ env.IMAGE_TAG }}.tar.gz | ||
- name: Upload Docker tar | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: clickhouse-sink-connector_${{ env.IMAGE_TAG }}.tar.gz | ||
path: sink-connector/clickhouse-sink-connector_${{ env.IMAGE_TAG }}.tar.gz |
This file contains 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,24 @@ | ||
name: Kafka Sink Connector - Pull Request Pipeline | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- synchronize | ||
- reopened | ||
- opened | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build-kafka: | ||
uses: ./.github/workflows/docker-build.yml | ||
|
||
testflows-kafka: | ||
needs: [build-kafka] | ||
uses: ./.github/workflows/testflows-sink-connector-kafka.yml | ||
with: | ||
sink_version: ${{ github.event.number }}-${{ github.sha }}-kafka | ||
|
||
java-tests-kafka: | ||
needs: [build-kafka] | ||
uses: ./.github/workflows/sink-connector-kafka-tests.yml |
This file contains 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 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 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
2 changes: 1 addition & 1 deletion
2
...s/testflow-sink-connector-lightweight.yml → .../testflows-sink-connector-lightweight.yml
This file contains 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 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 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