diff --git a/.github/workflows/release-distributions.yml b/.github/workflows/release-distributions.yml index a8ece65d3..2059ceec2 100644 --- a/.github/workflows/release-distributions.yml +++ b/.github/workflows/release-distributions.yml @@ -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 @@ -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 }} diff --git a/distribution/ob-configserver/Dockerfile b/distribution/ob-configserver/Dockerfile index 9c65b40ab..749e7996e 100644 --- a/distribution/ob-configserver/Dockerfile +++ b/distribution/ob-configserver/Dockerfile @@ -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 diff --git a/distribution/obagent/Dockerfile b/distribution/obagent/Dockerfile index a936e3456..a7a9bb2f6 100644 --- a/distribution/obagent/Dockerfile +++ b/distribution/obagent/Dockerfile @@ -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 diff --git a/distribution/obproxy/Dockerfile b/distribution/obproxy/Dockerfile index 271b73e47..01da7a839 100644 --- a/distribution/obproxy/Dockerfile +++ b/distribution/obproxy/Dockerfile @@ -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