From b73355f488f42e479cb2349939ccc0ed4c0c6c50 Mon Sep 17 00:00:00 2001 From: aceforeverd Date: Thu, 26 Sep 2024 12:49:07 +0800 Subject: [PATCH] Ci centos eol (#50) * build: update build env * build(deps): bump docker/build-push-action from 5 to 6 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * fix: patch_yum_repo.sh --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 17 ++++++----------- .github/workflows/docker-publish.yml | 2 +- Dockerfile | 14 +++++++++----- patch_yum_repo.sh | 11 +++++++++++ 4 files changed, 27 insertions(+), 17 deletions(-) create mode 100755 patch_yum_repo.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8eb8db..07d028e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: fail-fast: true matrix: include: - - container: ghcr.io/aceforeverd/hybridsql-base:0.4.0 + - container: ghcr.io/4paradigm/hybridsql-base:latest flags: "" distro: centos - container: ubuntu:20.04 @@ -50,9 +50,9 @@ jobs: env: MAKEOPTS: -j2 DISTRO: ${{ matrix.distro }} - + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: setup deps if: startsWith(matrix.container, 'ubuntu') @@ -60,13 +60,8 @@ jobs: apt update DEBIAN_FRONTEND=noninteractive apt-get install -y bison python3-dev libcppunit-dev build-essential cmake autoconf tcl pkg-config git curl patch libtool-bin - - name: setup deps(centos) - if: startsWith(matrix.container, 'ghcr') - run: | - yum install -y patch - - name: download thirdparty source - uses: actions/checkout@v2 + uses: actions/checkout@v3 if: github.event_name == 'push' || github.event_name == 'pull_request' with: repository: ${{ env.OPENMLDB_REPO }} @@ -74,7 +69,7 @@ jobs: path: openmldb - name: download thirdparty source (workflow_dispatch) - uses: actions/checkout@v2 + uses: actions/checkout@v3 if: github.event_name == 'workflow_dispatch' with: repository: ${{ github.event.inputs.OPENMLDB_REPO }} @@ -98,7 +93,7 @@ jobs: - name: Upload Artifact if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: deps/thirdparty-*.tar.gz diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e811012..6b9e093 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -73,7 +73,7 @@ jobs: - name: Build And Push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . push: ${{ env.PUSH }} diff --git a/Dockerfile b/Dockerfile index 224b0e6..e397291 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,16 @@ FROM centos:7 ARG TARGETARCH -# hadolint ignore=DL3031 -RUN yum update -y && yum install -y centos-release-scl epel-release && yum clean all - -RUN yum install -y devtoolset-8 rh-git227 flex autoconf automake unzip bc expect libtool \ +COPY ./patch_yum_repo.sh / +# hadolint ignore=DL3031,DL3033 +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \ + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo && \ + yum update -y && yum install -y centos-release-scl epel-release && \ + /patch_yum_repo.sh && \ + yum install -y devtoolset-8 rh-git227 flex autoconf automake unzip bc expect libtool \ rh-python38-python-devel gettext byacc xz tcl cppunit-devel rh-python38-python-wheel patch \ - && yum clean all + && yum clean all && rm /patch_yum_repo.sh COPY setup_cmake.sh / RUN /setup_cmake.sh ${TARGETARCH} && rm -f setup_cmake.sh diff --git a/patch_yum_repo.sh b/patch_yum_repo.sh new file mode 100755 index 0000000..7852c3a --- /dev/null +++ b/patch_yum_repo.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo +sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo +sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo + +if [[ "$(arch)" = "aarch64" ]]; then + sed -i s/vault.centos.org\\/centos/vault.centos.org\\/altarch/g /etc/yum.repos.d/*.repo +fi