Skip to content

Commit

Permalink
new xtrabackup
Browse files Browse the repository at this point in the history
  • Loading branch information
drivebyer committed Aug 8, 2024
1 parent 9801e77 commit 1086fc6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release_manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ on:
- 'logical-backup'
- 'ci-builder'
- 'elasticsearch-with-s3-plugin'
- 'mysql-operator-sidecar-80'
upstream-ref:
description: 'upstream ref'
required: false
Expand All @@ -42,6 +43,38 @@ env:
BUILD_PLATFORM: linux/amd64,linux/arm64

jobs:
mysql-operator-sidecar-80:
if : ${{ inputs.job == 'mysql-operator-sidecar-80' }}
runs-on: ubuntu-latest
steps:
- name: Git clone repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: ci-builder
uses: docker/[email protected]
with:
context: ./arm64/images/mysql-operator-sidecar-8.0
file: ./arm64/images/mysql-operator-sidecar-8.0/Dockerfile
github-token: ${{ secrets.GITHUB_TOKEN }}
push: true
platforms: ${{ env.BUILD_PLATFORM }}
tags: |
${{ env.ONLINE_REGISTER }}/mysql-operator-sidecar-8.0:${{ inputs.tag }}
${{ env.ONLINE_REGISTER }}/mysql-operator-sidecar-8.0:latest
cache-from: type=gha
cache-to: type=gha,mode=max

ci-builder:
if : ${{ inputs.job == 'ci-builder' }}
runs-on: ubuntu-latest
Expand Down
17 changes: 9 additions & 8 deletions arm64/images/mysql-operator-sidecar-8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ ENV GOPROXY=https://goproxy.cn
ENV GOPATH=/build

WORKDIR /build
RUN wget -O arm64.zip https://github.com/ksmartdata/mysql-operator/archive/refs/heads/arm64.zip
RUN unzip arm64.zip
WORKDIR /build/mysql-operator-arm64
RUN wget -O extra_image.zip https://github.com/ksmartdata/mysql-operator/archive/refs/heads/extra_image.zip
RUN unzip extra_image.zip
WORKDIR /build/mysql-operator-extra_image
RUN go mod tidy
RUN CGO_ENABLED=0 go build -o /mysql-operator-sidecar cmd/mysql-operator-sidecar/main.go

Expand All @@ -26,6 +26,7 @@ FROM --platform=$TARGETPLATFORM centos:8.3.2011 as all

USER root

ARG XTRABACKUP_VERSION=8.0.35-31

COPY rootfs/ /

Expand Down Expand Up @@ -57,17 +58,17 @@ RUN chmod +x /usr/local/bin/rclone

# percona-xtrabackup
WORKDIR /build
RUN wget -O percona-xtrabackup-8.0.29-22.zip https://github.com/percona/percona-xtrabackup/archive/refs/tags/percona-xtrabackup-8.0.29-22.zip
RUN unzip percona-xtrabackup-8.0.29-22
WORKDIR /build/percona-xtrabackup-percona-xtrabackup-8.0.29-22
RUN wget -O percona-xtrabackup-${XTRABACKUP_VERSION}.zip https://github.com/percona/percona-xtrabackup/archive/refs/tags/percona-xtrabackup-${XTRABACKUP_VERSION}.zip
RUN unzip percona-xtrabackup-${XTRABACKUP_VERSION}
WORKDIR /build/percona-xtrabackup-percona-xtrabackup-${XTRABACKUP_VERSION}

RUN yum -y install cmake openssl-devel libaio libaio-devel automake autoconf \
bison libtool ncurses-devel libgcrypt-devel libev-devel libcurl-devel zlib-devel \
vim-common


WORKDIR /build/percona-xtrabackup-percona-xtrabackup-8.0.29-22/build
WORKDIR /build/percona-xtrabackup-percona-xtrabackup-8.0.29-22
WORKDIR /build/percona-xtrabackup-percona-xtrabackup-${XTRABACKUP_VERSION}/build
WORKDIR /build/percona-xtrabackup-percona-xtrabackup-${XTRABACKUP_VERSION}

RUN yum install -y gcc-toolset-11-gcc gcc-toolset-11-gcc-c++ gcc-toolset-11-binutils

Expand Down

0 comments on commit 1086fc6

Please sign in to comment.