-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release docker image to github container registry (#55)
* push docker image to github container registry * add /opt/conf to classpath list
- Loading branch information
1 parent
a93ade8
commit 8684941
Showing
7 changed files
with
54 additions
and
87 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,4 +1,6 @@ | ||
Dockerfile | ||
**/target/ | ||
|
||
.idea/ | ||
.idea/ | ||
.github/ | ||
.run/ |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
name: CI to Github Container Registry | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
name: Main | ||
if: github.repository_owner == 'memiiso' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Github Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/build-push-action@v2 | ||
name: Build & push Docker image | ||
with: | ||
context: ./ | ||
file: ./Dockerfile | ||
push: true | ||
tags: ghcr.io/${{ github.repository_owner }}/debezium-server-iceberg:latest |
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 |
---|---|---|
|
@@ -10,25 +10,26 @@ env: | |
jobs: | ||
build: | ||
name: Main | ||
if: github.repository_owner == 'memiiso' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: Check Out Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set env | ||
run: | | ||
echo "RELEASE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
echo "RELEASE_NAME=latest" >> $GITHUB_ENV | ||
echo "RELEASE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | ||
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
- name: Build project | ||
run: mvn -B package -Passembly --file pom.xml -Drevision=latest | ||
run: mvn -B package -Passembly --file pom.xml -Drevision=${{ env.RELEASE_NAME }} | ||
|
||
- name: Delete latest release | ||
- name: Delete ${{ env.RELEASE_NAME }} release | ||
uses: dev-drprasad/[email protected] | ||
with: | ||
delete_release: true # default: false | ||
tag_name: latest | ||
tag_name: ${{ env.RELEASE_NAME }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -38,9 +39,9 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: Release master/latest | ||
tag_name: latest | ||
body: master branch release | ||
name: Release ${{ env.RELEASE_NAME }} | ||
tag_name: ${{ env.RELEASE_NAME }} | ||
body: Release master branch | ||
draft: false | ||
prerelease: true | ||
files: debezium-server-dist/target/debezium-server-dist-latest.zip | ||
files: debezium-server-dist/target/debezium-server-dist-${{ env.RELEASE_NAME }}.zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,15 @@ | ||
FROM eclipse-temurin:11-jdk as builder | ||
|
||
# Downloading and installing Maven | ||
ARG MAVEN_VERSION=3.8.3 | ||
ARG USER_HOME_DIR="/root" | ||
ARG SHA=1c12a5df43421795054874fd54bb8b37d242949133b5bf6052a063a13a93f13a20e6e9dae2b3d85b9c7034ec977bbc2b6e7f66832182b9c863711d78bfe60faa | ||
ARG BASE_URL=https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries | ||
|
||
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \ | ||
&& echo "Downlaoding maven" \ | ||
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ | ||
\ | ||
&& echo "Checking download hash" \ | ||
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \ | ||
\ | ||
&& echo "Unziping maven" \ | ||
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ | ||
\ | ||
&& echo "Cleaning and setting links" \ | ||
&& rm -f /tmp/apache-maven.tar.gz \ | ||
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn | ||
|
||
ENV MAVEN_HOME /usr/share/maven | ||
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2" | ||
|
||
RUN apt-get -qq update && apt-get -qq install maven unzip | ||
COPY . /app | ||
WORKDIR /app | ||
RUN mvn clean package -Passembly -Dmaven.test.skip | ||
RUN mvn clean package -Passembly -Dmaven.test.skip --quiet | ||
RUN unzip /app/debezium-server-dist/target/debezium-server-dist*.zip -d appdist | ||
|
||
FROM eclipse-temurin:11-jre | ||
COPY --from=builder /app/appdist/ /app/ | ||
|
||
WORKDIR /app | ||
EXPOSE 8080 8083 | ||
VOLUME ["/app/conf", "/app/data"] | ||
|
||
COPY --from=builder /app/debezium-server-dist/target /app/target | ||
RUN cp /app/target/debezium-server-dist-*-runner.jar /app/target/debezium-server-dist-runner.jar | ||
ENTRYPOINT ["java", "-cp", "/app/target/debezium-server-dist-runner.jar:/opt/conf:/app/target/lib/*", "io.debezium.server.Main"] | ||
ENTRYPOINT ["/app/run.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