Skip to content

Commit

Permalink
Prepare 2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
zhicwu committed Jan 6, 2021
1 parent 15f6251 commit 7c6d310
Show file tree
Hide file tree
Showing 119 changed files with 4,333 additions and 2,346 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
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
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dependency-reduced-pom.xml
.vscode/
demo/
target/
test.sh
41 changes: 8 additions & 33 deletions Dockerfile
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
Expand All @@ -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"
Expand All @@ -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 \
Expand All @@ -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
13 changes: 11 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
clickhouse-jdbc-bridge
Copyright 2019-2020, Zhichun Wu.
Copyright 2019-2021, Zhichun Wu.

This project includes software developed by Zhichun Wu.
https://github.com/zhicwu
Expand All @@ -18,18 +18,26 @@ specific language governing permissions and limitations
under the License.

This project includes:
Apache Commons Compress under Apache License, Version 2.0
Apache Log4j under The Apache Software License, Version 2.0
Caffeine cache under Apache License, Version 2.0
Checker Qual under The MIT License
ClickHouse JDBC Bridge under Apache License, Version 2.0
dnsjava under BSD-2-Clause
docker-java-api under The Apache Software License, Version 2.0
docker-java-transport under The Apache Software License, Version 2.0
docker-java-transport-zerodep under The Apache Software License, Version 2.0
Duct Tape under MIT
error-prone annotations under Apache 2.0
Hamcrest Core under New BSD License
HdrHistogram under Public Domain, per Creative Commons CC0 or BSD-2-Clause
HikariCP under The Apache Software License, Version 2.0
Jackson-annotations under The Apache Software License, Version 2.0
Jackson-core under The Apache Software License, Version 2.0
jackson-databind under The Apache Software License, Version 2.0
Java Native Access under LGPL, version 2.1 or Apache License v2.0
jcommander under Apache 2.0
JUnit under Eclipse Public License 1.0
LatencyUtils under Public Domain, per Creative Commons CC0
micrometer-core under The Apache Software License, Version 2.0
micrometer-registry-prometheus under The Apache Software License, Version 2.0
Expand All @@ -49,7 +57,7 @@ This project includes:
Prometheus Java Simpleclient Common under The Apache Software License, Version 2.0
SLF4J API Module under MIT License
SLF4J LOG4J-12 Binding under MIT License
SQLite JDBC under The Apache Software License, Version 2.0
Testcontainers Core under MIT
testng under Apache 2.0
Vert.x Bridge Common under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0
Vert.x Core under The Apache Software License, Version 2.0 or Eclipse Public License - v 2.0
Expand All @@ -59,4 +67,5 @@ This project includes:
vertx-web under The Apache Software License, Version 2.0 or Eclipse Public License - v 2.0
vertx-web-client under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0
vertx-web-common under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0
Visible Assertions under MIT

Loading

0 comments on commit 7c6d310

Please sign in to comment.