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
119 changed files
with
4,333 additions
and
2,346 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,32 @@ | ||
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: | ||
- 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 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,87 @@ | ||
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: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
- name: Install Java and Maven | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Release Maven package | ||
uses: samuelmeuli/action-maven-publish@v1 | ||
with: | ||
maven_profiles: release | ||
maven_args: -Drevision=${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }} --batch-mode | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
nexus_username: ${{ secrets.SONATYPE_USER }} | ||
nexus_password: ${{ secrets.SONATYPE_PASSWD }} | ||
- name: Create Pre-release on Github | ||
uses: "zhicwu/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# | ||
# Copyright (C) 2019-2020, Zhichun Wu | ||
# Copyright (C) 2019-2021, Zhichun Wu | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
|
@@ -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 \ | ||
|
@@ -79,6 +57,3 @@ EXPOSE 9019 | |
VOLUME ["${JDBC_BRIDGE_HOME}/drivers", "${JDBC_BRIDGE_HOME}/extensions", "${JDBC_BRIDGE_HOME}/logs", "${JDBC_BRIDGE_HOME}/scripts"] | ||
|
||
CMD "./docker-entrypoint.sh" | ||
|
||
HEALTHCHECK --start-period=5m --interval=30s --timeout=5s \ | ||
CMD curl --connect-timeout 3 --no-keepalive -f http://localhost:9019/ping || exit 1 |
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.