forked from ClickHouse/clickhouse-jdbc-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
2,506 additions
and
1,394 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
paths-ignore: | ||
- "**.md" | ||
- "misc/**" | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths-ignore: | ||
- "**.md" | ||
- "misc/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Dependencies | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
CH_REPO: deb [trusted=yes] https://repo.clickhouse.tech/deb/stable/ main/ | ||
CH_CONF_DIR: /etc/clickhouse-server/config.d | ||
run: | | ||
sudo apt-get update -y -qq | ||
sudo apt-get install -y -qq --no-install-recommends ca-certificates dpkg fakeroot rpm | ||
echo $CH_REPO | sudo tee -a /etc/apt/sources.list | ||
sudo apt-get update -y -qq | ||
sudo apt-get install -y -qq clickhouse-server | ||
sudo mkdir -p $CH_CONF_DIR | ||
sudo touch $CH_CONF_DIR/test.xml | ||
echo "<yandex><jdbc_bridge><host>127.0.0.1</host><port>9019</port></jdbc_bridge></yandex>" | sudo tee -a $CH_CONF_DIR/test.xml | ||
sudo /usr/sbin/clickhouse-server --config=/etc/clickhouse-server/config.xml & | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build with Maven | ||
run: mvn --batch-mode --update-snapshots -Prelease verify |
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,78 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
major: | ||
description: "Major version" | ||
required: true | ||
default: "2" | ||
minor: | ||
description: "Minor version" | ||
required: false | ||
default: "0" | ||
patch: | ||
description: "Patch" | ||
required: false | ||
default: "0" | ||
organization: | ||
description: "DockerHub organization" | ||
required: false | ||
default: "yandex" | ||
|
||
jobs: | ||
pre-release: | ||
name: "Pre Release" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build with Maven | ||
run: mvn -Dmaven.test.skip=true -Drevision=${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }} --batch-mode -Prelease package | ||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}" | ||
prerelease: true | ||
title: "Release v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}" | ||
files: | | ||
LICENSE | ||
NOTICE | ||
target/clickhouse*.jar | ||
target/*.deb | ||
target/**/*.rpm | ||
publish: | ||
name: "Build and Publish Docker Image" | ||
runs-on: ubuntu-latest | ||
needs: pre-release | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USER }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWD }} | ||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
build-args: | | ||
revision=${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }} | ||
repository=${{ github.repository }} | ||
tags: | | ||
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:latest | ||
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:${{ github.event.inputs.major }} | ||
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:${{ github.event.inputs.major }}.${{ github.event.inputs.minor }} | ||
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }} |
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ dependency-reduced-pom.xml | |
.vscode/ | ||
demo/ | ||
target/ | ||
test.sh |
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 |
---|---|---|
|
@@ -17,39 +17,17 @@ | |
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
FROM adoptopenjdk/openjdk8-openj9:jre8u275-b01_openj9-0.23.0-ubuntu | ||
|
||
# docker build --squash --build-arg revision=2.0.0 -t yandex/clickhouse-jdbc-bridge . | ||
ARG revision=2.0.0-SNAPSHOT | ||
|
||
# | ||
# Stage 1/2: Build | ||
# | ||
FROM maven:3-openjdk-8 as builder | ||
|
||
ARG revision | ||
|
||
COPY LICENSE NOTICE pom.xml /app/ | ||
COPY docker /app/docker/ | ||
COPY misc /app/misc/ | ||
COPY src /app/src/ | ||
|
||
WORKDIR /app | ||
|
||
RUN mvn -Drevision=${revision} package | ||
|
||
|
||
# | ||
# Stage 2/2: Pack | ||
# | ||
FROM adoptopenjdk/openjdk8-openj9:jre8u265-b01_openj9-0.21.0-ubuntu | ||
|
||
ARG revision | ||
ARG revision=2.0.0 | ||
ARG repository=ClickHouse/clickhouse-jdbc-bridge | ||
|
||
# Maintainer | ||
LABEL maintainer="[email protected]" | ||
|
||
# Environment variables | ||
ENV JDBC_BRIDGE_HOME=/app JDBC_BRIDGE_VERSION=${revision} | ||
ENV JDBC_BRIDGE_HOME=/app JDBC_BRIDGE_VERSION=${revision} \ | ||
JDBC_BRIDGE_REL_URL=https://github.com/${repository}/releases/download/v${revision}/ | ||
|
||
# Labels | ||
LABEL app_name="ClickHouse JDBC Bridge" app_version="$JDBC_BRIDGE_VERSION" | ||
|
@@ -59,10 +37,10 @@ RUN apt-get update \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated apache2-utils \ | ||
apt-transport-https curl htop iftop iptraf iputils-ping jq lsof net-tools tzdata wget \ | ||
&& apt-get clean \ | ||
&& wget -q -P $JDBC_BRIDGE_HOME $JDBC_BRIDGE_REL_URL/LICENSE $JDBC_BRIDGE_REL_URL/NOTICE \ | ||
$JDBC_BRIDGE_REL_URL/clickhouse-jdbc-bridge-${revision}.jar \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
COPY --from=builder /app/LICENSE /app/NOTICE \ | ||
/app/target/clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION.jar $JDBC_BRIDGE_HOME/ | ||
COPY --chown=root:root docker/ $JDBC_BRIDGE_HOME | ||
|
||
RUN chmod +x $JDBC_BRIDGE_HOME/*.sh \ | ||
|
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
Oops, something went wrong.