-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actions for building and releasing manifests (#107)
* chore: workflows for building and release
- Loading branch information
Showing
17 changed files
with
291 additions
and
24 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,39 @@ | ||
name: build ob-operator | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*_dev' | ||
|
||
env: | ||
GO_VERSION: "1.20" | ||
|
||
jobs: | ||
build-images: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: go mod vendor | ||
run: go mod vendor | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build Docker images | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: false |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
pull_request: | ||
branches: | ||
- 2.0.x_dev | ||
- 2.x_dev | ||
|
||
permissions: | ||
contents: read | ||
|
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,14 +1,14 @@ | ||
name: release helm chart | ||
name: release helm charts | ||
|
||
on: | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- '*release' | ||
- 'helm-chart' | ||
tags: | ||
- '2.[0-9]+.[0-9]+' | ||
- 'chart-2.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
release: | ||
release-chart: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -22,6 +22,8 @@ jobs: | |
git config user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/chart-releaser-action@v1.1.0 | ||
uses: helm/chart-releaser-action@v1.6.0 | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
with: | ||
mark_as_latest: false |
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,43 @@ | ||
name: release obagent | ||
|
||
on: | ||
push: | ||
tags: | ||
- "obagent-*" | ||
|
||
env: | ||
tagName: ${{ github.ref_name }} | ||
|
||
jobs: | ||
release-obagent: | ||
runs-on: ubuntu-latest | ||
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: ${{ vars.DOCKER_PUSH_BASE }}/obagent:${{ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: release obconfigserver | ||
|
||
on: | ||
push: | ||
tags: | ||
- "obconfigserver-*" | ||
|
||
env: | ||
tagName: ${{ github.ref_name }} | ||
|
||
jobs: | ||
release-obconfigserver: | ||
runs-on: ubuntu-latest | ||
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/ob-configserver | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./distribution/ob-configserver/Dockerfile | ||
push: true | ||
tags: ${{ vars.DOCKER_PUSH_BASE }}/obconfigserver:${{ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: release obproxy | ||
|
||
on: | ||
push: | ||
tags: | ||
- "obproxy-*" | ||
|
||
env: | ||
tagName: ${{ github.ref_name }} | ||
|
||
jobs: | ||
release-obproxy: | ||
runs-on: ubuntu-latest | ||
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*-\d*)' --only-matching)" >> $GITHUB_OUTPUT | ||
|
||
- name: Build and push obproxy w/o cache | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./distribution/obproxy | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./distribution/obproxy/Dockerfile | ||
push: true | ||
tags: ${{ vars.DOCKER_PUSH_BASE }}/obproxy:${{ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: release observer | ||
|
||
on: | ||
push: | ||
tags: | ||
- "observer-*" | ||
|
||
env: | ||
tagName: ${{ github.ref_name }} | ||
|
||
jobs: | ||
release-observer: | ||
runs-on: ubuntu-latest | ||
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*-\d{18})' --only-matching)" >> $GITHUB_OUTPUT | ||
|
||
- name: Build and push observer w/o cache | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./distribution/oceanbase | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./distribution/oceanbase/Dockerfile | ||
push: true | ||
tags: ${{ vars.DOCKER_PUSH_BASE }}/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: release operator | ||
|
||
on: | ||
push: | ||
tags: | ||
- '2.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
release-operator: | ||
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: Create and push manifests w/ cache | ||
uses: docker/build-push-action@v2 | ||
if: ${{ vars.ENABLE_DOCKER_CACHE }} | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ vars.DOCKER_PUSH_BASE }}/ob-operator:${{ github.ref_name }} | ||
cache-from: type=registry,ref=${{ vars.DOCKER_PUSH_BASE }}/ob-operator:buildcache | ||
cache-to: type=registry,ref=${{ vars.DOCKER_PUSH_BASE }}/ob-operator:buildcache,mode=max | ||
|
||
- name: Create and push manifests w/o cache | ||
uses: docker/build-push-action@v2 | ||
if: ${{ !vars.ENABLE_DOCKER_CACHE }} | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ vars.DOCKER_PUSH_BASE }}/ob-operator:${{ github.ref_name }} |
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,2 +1,3 @@ | ||
#!/bin/bash | ||
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg ARCH=$3 . | ||
# @Params TARGETPLATFORM linux/amd64 or linux/arm64 | ||
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 . |
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,2 +1,3 @@ | ||
#!/bin/bash | ||
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg ARCH=$3 . | ||
# @Params TARGETPLATFORM linux/amd64 or linux/arm64 | ||
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 . |
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,2 +1,4 @@ | ||
#!/bin/bash | ||
docker build -t $1:$2-$3 --build-arg VERSION=$2 --build-arg RELEASE=$3 --build-arg ARCH=$4 . | ||
# @Params TARGETPLATFORM linux/amd64 or linux/arm64 | ||
# VERSION: x.y.z-r e.g. 4.2.1-11 which merge old VERSION and RELEASE | ||
docker build -t $1:$2 --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 . |
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,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker build -t $1:$2 --build-arg GOPROXY=${GOPROXY} --build-arg VERSION=$2 --build-arg ARCH=$3 . | ||
# @Params TARGETPLATFORM linux/amd64 or linux/arm64 | ||
docker build -t $1:$2 --build-arg GOPROXY=${GOPROXY} --build-arg VERSION=$2 --build-arg TARGETPLATFORM=$3 . |
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