Skip to content

Commit

Permalink
add oblogproxy-ce
Browse files Browse the repository at this point in the history
  • Loading branch information
whhe committed Jun 19, 2024
1 parent 338bf99 commit 607731a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release-oblogproxy-ce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
push:
tags:
- "oblogproxy-ce-*"

env:
tagName: ${{ github.ref_name }}

jobs:
release-oceanbase-cloud-native:
runs-on: ubuntu-latest
steps:
- name: Log in to Docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set Version variables
id: set_version_vars
run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*-\d{18})' --only-matching)" >> $GITHUB_OUTPUT

- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./oblogproxy-ce
platforms: linux/amd64,linux/arm64
file: ./oblogproxy-ce/Dockerfile
push: true
tags: ${{ vars.DOCKER_PUSH_BASE }}/oblogproxy-ce:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
25 changes: 25 additions & 0 deletions oblogproxy-ce/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM openanolis/anolisos:8.8

ARG VERSION

ENV OB_SYS_USERNAME=${OB_SYS_USERNAME}
ENV OB_SYS_PASSWORD=${OB_SYS_PASSWORD}

RUN yum install -y yum-utils diffutils && \
yum-config-manager --add-repo https://mirrors.oceanbase.com/oceanbase/OceanBase.repo && \
sed -i 's/$releasever/8/' /etc/yum.repos.d/OceanBase.repo && \
if [[ -z "${VERSION}" ]]; then \
echo "VERSION is empty, build image with the latest rpm"; \
version=`yum info oblogproxy | grep Version | awk '{print $3}'`; \
release=`yum info oblogproxy | grep Release | awk '{print $3}' | awk -F. '{print $1}'`; \
VERSION="${version}-${release}"; \
fi && \
yum install -y oblogproxy-${VERSION}.el8 && yum clean all && \
if [[ -n ${OB_SYS_USERNAME} && -n ${OB_SYS_PASSWORD} ]]; then \
echo "y" | /usr/local/oblogproxy/run.sh config_sys ${OB_SYS_USERNAME} ${OB_ROOT_PASSWORD}; \
fi && \
/usr/local/oblogproxy/run.sh start

EXPOSE 2983

ENTRYPOINT []

0 comments on commit 607731a

Please sign in to comment.