Skip to content

Commit

Permalink
fix: test other distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Nov 27, 2023
1 parent a7eef1d commit 3293949
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 8 deletions.
70 changes: 69 additions & 1 deletion .github/workflows/release-distributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

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

- name: Build and push obproxy w/o cache
uses: docker/build-push-action@v2
Expand All @@ -79,3 +79,71 @@ jobs:
tags: ${{ secrets.DOCKER_USERNAME }}/obproxy-cloud-native:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
release-obagent:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref_name, 'obagent-') }}
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*)' --only-matching)" >> $GITHUB_OUTPUT

- name: Build and push obagent w/o cache
uses: docker/build-push-action@v2
with:
context: ./distribution/obagent
platforms: linux/amd64,linux/arm64
file: ./distribution/obagent/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/obagent-cloud-native:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
release-obconfigserver:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref_name, 'obconfigserver-') }}
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*)' --only-matching)" >> $GITHUB_OUTPUT

- name: Build and push obconfigserver w/o cache
uses: docker/build-push-action@v2
with:
context: ./distribution/obconfigserver
platforms: linux/amd64,linux/arm64
file: ./distribution/obconfigserver/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/obconfigserver-cloud-native:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
4 changes: 2 additions & 2 deletions distribution/ob-configserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM openanolis/anolisos:8.8
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ARG VERSION
ARG ARCH=x86_64
RUN yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/${ARCH}/ob-configserver-${VERSION}.el8.${ARCH}.rpm
ARG TARGETPLATFORM
RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]] ; yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/ob-configserver-${VERSION}.el8.x86_64.rpm ; else yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/ob-configserver-${VERSION}.el8.aarch64.rpm ; fi
ADD config.yaml.template /home/admin/ob-configserver/conf/
ADD start.sh /home/admin/ob-configserver
WORKDIR /home/admin/ob-configserver
Expand Down
4 changes: 2 additions & 2 deletions distribution/obagent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM openanolis/anolisos:8.8
ARG VERSION
ARG ARCH=x86_64
ARG TARGETPLATFORM
WORKDIR /home/admin/obagent
RUN yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/${ARCH}/obagent-${VERSION}.el8.${ARCH}.rpm
RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]] ; yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/obagent-${VERSION}.el8.x86_64.rpm ; else yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/obagent-${VERSION}.el8.aarch64.rpm ; fi
ADD replace_properties.sh /home/admin/obagent
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Expand Down
6 changes: 3 additions & 3 deletions distribution/obproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ FROM openanolis/anolisos:8.8
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ARG VERSION
ARG RELEASE
ARG ARCH=x86_64
ARG TARGETPLATFORM
WORKDIR /home/admin
RUN useradd -m admin
RUN rpm -ivh https://mirrors.aliyun.com/oceanbase/community/stable/el/8/${ARCH}/obproxy-ce-${VERSION}-${RELEASE}.el8.${ARCH}.rpm
RUN mv /home/admin/obproxy-${VERSION} /home/admin/obproxy
RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]] ; then rpm -ivh https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/obproxy-ce-${VERSION}.el8.x86_64.rpm ; else rpm -ivh https://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/obproxy-ce-${VERSION}.el8.aarch64.rpm ; fi
RUN mv /home/admin/obproxy-* /home/admin/obproxy
RUN chown -R admin:admin /home/admin/obproxy
ADD start.sh /home/admin

Expand Down

0 comments on commit 3293949

Please sign in to comment.