Skip to content

Commit 19766aa

Browse files
authored
feat: add a workflow for publishing oblogproxy-ce (#10)
* feat: add a workflow for publishing oblogproxy-ce * update action versions
1 parent 40d8cee commit 19766aa

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: release oblogproxy-ce
2+
3+
on:
4+
push:
5+
tags:
6+
- "oblogproxy-ce-*"
7+
8+
env:
9+
tagName: ${{ github.ref_name }}
10+
11+
jobs:
12+
release-oblogproxy-ce:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Log in to Docker hub
16+
uses: docker/login-action@v3
17+
with:
18+
username: ${{ secrets.DOCKER_USERNAME }}
19+
password: ${{ secrets.DOCKER_PASSWORD }}
20+
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v3
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Set Version variables
31+
id: set_version_vars
32+
run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*-\d{18})' --only-matching)" >> $GITHUB_OUTPUT
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v6
36+
with:
37+
context: ./oblogproxy-ce
38+
platforms: linux/amd64,linux/arm64
39+
file: ./oblogproxy-ce/Dockerfile
40+
push: true
41+
tags: ${{ vars.DOCKER_PUSH_BASE }}/oblogproxy-ce:${{ steps.set_version_vars.outputs.version }}
42+
build-args: |
43+
VERSION=${{ steps.set_version_vars.outputs.version }}

oblogproxy-ce/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM openanolis/anolisos:8.8
2+
3+
ARG VERSION
4+
5+
RUN yum install -y yum-utils diffutils && \
6+
yum-config-manager --add-repo https://mirrors.oceanbase.com/oceanbase/OceanBase.repo && \
7+
sed -i 's/$releasever/8/' /etc/yum.repos.d/OceanBase.repo && \
8+
if [[ -z "${VERSION}" ]]; then \
9+
echo "VERSION is empty, build image with the latest rpm"; \
10+
version=`yum info oblogproxy | grep Version | awk '{print $3}'`; \
11+
release=`yum info oblogproxy | grep Release | awk '{print $3}' | awk -F. '{print $1}'`; \
12+
VERSION="${version}-${release}"; \
13+
fi && \
14+
yum install -y oblogproxy-${VERSION}.el8 && yum clean all
15+
16+
COPY start.sh /root/boot/
17+
WORKDIR /root/boot/
18+
19+
EXPOSE 2983
20+
21+
ENTRYPOINT ["bash", "-c", "./start.sh"]

oblogproxy-ce/start.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
if [[ -n ${OB_SYS_USERNAME} && -n ${OB_SYS_PASSWORD} ]]; then
4+
echo "y" | /usr/local/oblogproxy/run.sh config_sys ${OB_SYS_USERNAME} ${OB_ROOT_PASSWORD}
5+
fi
6+
7+
rm -rf /usr/local/oblogproxy/run/*
8+
/usr/local/oblogproxy/run.sh start
9+
exec /sbin/init

0 commit comments

Comments
 (0)