Skip to content

Commit

Permalink
redis 镜像兼容老版本 operator
Browse files Browse the repository at this point in the history
  • Loading branch information
drivebyer committed Jan 22, 2024
1 parent 2ca4c0e commit 0294152
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/release_manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,38 @@ jobs:
# 默认为空,则使用默认分支
ref: ${{ inputs.upstream-ref }}

- name: Adapt
run: |
# 删除 Dockerfile 文件中的行:REDIS_MAJOR_VERSION=${REDIS_MAJOR_VERSION:-"v7"}
# 因为老版本的 OT operator 不会给 pod 传递 REDIS_MAJOR_VERSION 这个环境变量,会导致 entrypoint.sh 走到错误的逻辑流程
sed -i '/REDIS_MAJOR_VERSION=${REDIS_MAJOR_VERSION:-"v7"}/d' ./Dockerfile
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare env variables
id: env
run: |
echo "BUILD_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
echo "GIT_SHA=$(git rev-parse --short HEAD | cut -c1-7)" >> $GITHUB_ENV
echo "GIT_REF=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match)" >> $GITHUB_ENV
echo "GIT_REPO=$(git config --get remote.origin.url)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build && Push
uses: docker/[email protected]
with:
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Build from ${{ env.GIT_REPO }}/${{ env.GIT_REF }}@${{ env.GIT_SHA }} at ${{ env.BUILD_DATE }}
labels:
org.opencontainers.image.description: Build from ${{ env.GIT_REPO }}/${{ env.GIT_REF }}@${{ env.GIT_SHA }} at ${{ env.BUILD_DATE }}
context: .
file: ./Dockerfile
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 0294152

Please sign in to comment.