forked from oceanbase/ob-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: release images | ||
|
||
on: | ||
push: | ||
tags: | ||
- "observer-*" | ||
- "obproxy-*" | ||
- "obagent-*" | ||
- "obconfigserver-*" | ||
|
||
env: | ||
tagName: ${{ github.ref_name }} | ||
|
||
jobs: | ||
release-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- 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: Log in to Docker hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- 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 | ||
|
||
- name: Build and push observer w/o cache | ||
uses: docker/build-push-action@v2 | ||
if: ${{ startWith(github.ref_name, "observer-") }} | ||
with: | ||
context: ./distribution/oceanbase | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./distribution/oceanbase/Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/oceanbase-cloud-native:${{ steps.set_version_vars.outputs.version }} | ||
build-args: | | ||
VERSION:${{ steps.set_version_vars.outputs.version }} |
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,18 +1,17 @@ | ||
FROM golang:1.20.4 as builder | ||
ARG GOPROXY=https://goproxy.io,direct | ||
WORKDIR /workspace | ||
COPY ./oceanbase-helper . | ||
RUN GO11MODULE=ON CGO_ENABLED=0 GOOS=linux go build -a -o oceanbase-helper main.go | ||
RUN GO11MODULE=ON CGO_ENABLED=0 GOOS=linux GOPROXY=https://goproxy.io,direct go build -a -o oceanbase-helper main.go | ||
|
||
FROM openanolis/anolisos:8.8 | ||
ARG VERSION | ||
ARG ARCH=x86_64 | ||
WORKDIR /home/admin/oceanbase | ||
RUN mkdir -p /home/admin/oceanbase/bin | ||
COPY --from=builder /workspace/oceanbase-helper /home/admin/oceanbase/bin | ||
RUN yum -y install python27 | ||
RUN pip2 install mysql-connector -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com | ||
RUN yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/${ARCH}/oceanbase-ce-libs-${VERSION}.el8.${ARCH}.rpm | ||
RUN yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/${ARCH}/oceanbase-ce-${VERSION}.el8.${ARCH}.rpm | ||
# support docker platform linux/amd64 and linux/arm64, mapping platform to x86_64 or aarch64 | ||
RUN if [[ $TARGETPLATFORM == "linux/amd64" ]]; then yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/oceanbase-ce-libs-${VERSION}.el8.x86_64.rpm; else yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/oceanbase-ce-libs-${VERSION}.el8.aarch64.rpm; fi | ||
RUN if [[ $TARGETPLATFORM == "linux/amd64" ]]; then yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/oceanbase-ce-${VERSION}.el8.x86_64.rpm; else yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/oceanbase-ce-libs-${VERSION}.el8.aarch64.rpm; fi | ||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | ||
ENV LD_LIBRARY_PATH /home/admin/oceanbase/lib |