Skip to content

Commit 6bbbffb

Browse files
committed
NebulaGraph Flink Connector 5
1 parent 755c88f commit 6bbbffb

File tree

3 files changed

+126
-91
lines changed

3 files changed

+126
-91
lines changed

.github/workflows/pull_request.yml

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,48 @@ name: pull_request
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ dev ]
99
pull_request:
1010
branches:
1111
- master
12-
- 'v[0-9]+.*'
12+
- 'release-**'
1313

1414
jobs:
1515
build:
1616

17-
runs-on: ubuntu-latest
17+
runs-on: [ self-hosted, linux ]
1818

1919
steps:
20-
- uses: actions/checkout@v2
21-
- name: Set up JDK 1.8
22-
uses: actions/setup-java@v1
23-
with:
24-
java-version: 1.8
25-
26-
- name: Cache the Maven packages to speed up build
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.m2/repository
30-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
31-
restore-keys: ${{ runner.os }}-maven-
32-
33-
- name: Install nebula-graph
34-
run: |
35-
mkdir tmp
36-
pushd tmp
37-
git clone https://github.com/vesoft-inc/nebula-docker-compose.git
38-
pushd nebula-docker-compose/
39-
cp ../../connector/src/test/resources/docker-compose.yaml .
40-
docker-compose up -d
41-
sleep 10
42-
popd
43-
popd
44-
45-
- name: Build with Maven
46-
run: |
47-
mvn -B package
48-
bash <(curl -s https://codecov.io/bash)
20+
- name: Clean runner
21+
uses: webiny/action-post-run@3.1.0
22+
with:
23+
run: find . -mindepth 1 -delete
24+
25+
- uses: actions/checkout@v4
26+
- name: Set up JDK 1.8
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: "temurin"
30+
java-version: "8"
31+
32+
- name: Set up Maven
33+
uses: stCarolas/setup-maven@v5
34+
with:
35+
maven-version: 3.8.2
36+
37+
- name: install nebula
38+
run: |
39+
docker compose pull && docker compose up -d
40+
sleep 60
41+
working-directory: docker-compose
42+
43+
- name: Build with Maven
44+
run: |
45+
mvn -B package
46+
bash <(curl -s https://codecov.io/bash)
47+
48+
- name: stop nebula
49+
if: always()
50+
run: |
51+
docker compose down
52+
working-directory: docker-compose

.github/workflows/release.yml

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
build:
1212

13-
runs-on: ubuntu-latest
13+
runs-on: [ self-hosted, linux ]
1414

1515
steps:
1616
- uses: actions/checkout@v2
@@ -26,22 +26,43 @@ jobs:
2626
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2727
restore-keys: ${{ runner.os }}-maven-
2828

29-
- name: Install nebula-graph
29+
- name: install nebula
3030
run: |
31-
mkdir tmp
32-
pushd tmp
33-
git clone https://github.com/vesoft-inc/nebula-docker-compose.git
34-
pushd nebula-docker-compose/
35-
cp ../../connector/src/test/resources/docker-compose.yaml .
36-
docker-compose up -d
37-
sleep 10
38-
popd
39-
popd
40-
41-
- name: Deploy release to Maven
42-
uses: samuelmeuli/action-maven-publish@v1
31+
docker compose pull && docker compose up -d
32+
sleep 60
33+
working-directory: docker-compose
34+
35+
- name: package flink connector
36+
run: |
37+
mvn clean package
38+
39+
- name: setup minio
40+
uses: vesoft-inc/.github/actions/setup-minio@master
4341
with:
44-
gpg_private_key: ${{ secrets.JAVA_GPG_PRIVATE_KEY }}
45-
gpg_passphrase: ""
46-
nexus_username: ${{ secrets.OSSRH_USERNAME }}
47-
nexus_password: ${{ secrets.OSSRH_TOKEN }}
42+
minio_url: ${{ secrets.MINIO_ENDPOINT }}
43+
access_key: ${{ secrets.MINIO_KEY }}
44+
secret_key: ${{ secrets.MINIO_SECRET }}
45+
46+
- name: Get the version
47+
id: get_version
48+
run: |
49+
tag=$(echo ${{ github.ref }} | rev | cut -d/ -f1 | rev)
50+
tagnum=$(echo $tag | sed 's/^v//')
51+
echo "tag=$tag" >> $GITHUB_OUTPUT
52+
echo "tagnum=$tagnum" >> $GITHUB_OUTPUT
53+
shell: bash
54+
55+
- name: Copy flink-connector to release on MinIO
56+
run: |
57+
mv target/ nebula-graph-flinkconnector/
58+
tar czf ./nebula-graph-flinkconnector-${{ steps.get_version.outputs.tagnum }}.tgz nebula-graph-flinkconnector/nebula-flink-connector-${{ steps.get_version.outputs.tagnum }}.jar
59+
sha256sum nebula-graph-flinkconnector-${{ steps.get_version.outputs.tagnum }}.tgz > nebula-graph-flinkconnector-${{ steps.get_version.outputs.tagnum }}.tgz.sha256sum.txt
60+
mc cp nebula-graph-flinkconnector-${{ steps.get_version.outputs.tagnum }}.tgz minio/release-build/nebula-ng-flink-connector/${{ steps.get_version.outputs.tagnum }}/
61+
mc cp nebula-graph-flinkconnector-${{ steps.get_version.outputs.tagnum }}.tgz.sha256sum.txt minio/release-build/nebula-ng-flink-connector/${{ steps.get_version.outputs.tagnum }}/
62+
working-directory: connector
63+
64+
- name: stop nebula
65+
if: always()
66+
run: |
67+
docker compose down
68+
working-directory: docker-compose

.github/workflows/snapshot.yml

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,59 @@
1-
# This workflow will build a Java project with Maven
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
1+
# Copyright (c) 2024 vesoft inc. All rights reserved.
32

43
name: snapshot
54

65
on:
76
push:
8-
branches: [ master ]
9-
schedule:
10-
- cron: '0 6 * * *'
7+
branches: [ dev ]
118

12-
jobs:
13-
build:
14-
15-
runs-on: ubuntu-latest
169

10+
jobs:
11+
deploy-java-driver-snapshot:
12+
runs-on: [ self-hosted, linux ]
1713
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up JDK 1.8
20-
uses: actions/setup-java@v1
21-
with:
22-
java-version: 1.8
23-
24-
- name: Cache the Maven packages to speed up build
25-
uses: actions/cache@v2
26-
with:
27-
path: ~/.m2/repository
28-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
29-
restore-keys: ${{ runner.os }}-maven-
30-
31-
- name: Install nebula-graph
32-
run: |
33-
mkdir tmp
34-
pushd tmp
35-
git clone https://github.com/vesoft-inc/nebula-docker-compose.git
36-
pushd nebula-docker-compose/
37-
cp ../../connector/src/test/resources/docker-compose.yaml .
38-
docker-compose up -d
39-
sleep 10
40-
popd
41-
popd
42-
43-
- name: Deploy SNAPSHOT to Sonatype
44-
uses: samuelmeuli/action-maven-publish@v1
45-
with:
46-
gpg_private_key: ${{ secrets.JAVA_GPG_PRIVATE_KEY }}
47-
gpg_passphrase: ""
48-
nexus_username: ${{ secrets.OSSRH_USERNAME }}
49-
nexus_password: ${{ secrets.OSSRH_TOKEN }}
14+
- name: Clean runner
15+
uses: webiny/action-post-run@3.1.0
16+
with:
17+
run: find . -mindepth 1 -delete
18+
19+
- name: Check out Git repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up JDK 1.8
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: "temurin"
26+
java-version: "8"
27+
28+
- name: Set up Maven
29+
uses: stCarolas/setup-maven@v5
30+
with:
31+
maven-version: 3.8.2
32+
33+
- name: install nebula
34+
run: |
35+
docker compose pull && docker compose up -d
36+
sleep 60
37+
working-directory: docker-compose
38+
39+
- name: package flink connector
40+
run: |
41+
mvn clean package
42+
43+
- name: setup minio
44+
uses: vesoft-inc/.github/actions/setup-minio@master
45+
with:
46+
minio_url: ${{ secrets.MINIO_ENDPOINT }}
47+
access_key: ${{ secrets.MINIO_KEY }}
48+
secret_key: ${{ secrets.MINIO_SECRET }}
49+
50+
- name: Copy java sdk to release on MinIO
51+
run: |
52+
mc cp target/nebula-flink-connector-5.0-SNAPSHOT.jar minio/nightly-build/nebula-ng-flinkconnector/
53+
working-directory: connector
54+
55+
- name: stop nebula
56+
if: always()
57+
run: |
58+
docker compose down
59+
working-directory: docker-compose

0 commit comments

Comments
 (0)