forked from bitpoke/mysql-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de731ab
commit fdb84f3
Showing
4 changed files
with
487 additions
and
0 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,70 @@ | ||
name: Release Single Mongodb Image | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pipeline-argument: | ||
description: 'Images(agent,readiness-probe,version-upgrade-hook,operator)' | ||
required: true | ||
image-tag: | ||
description: 'Image tag to build' | ||
required: true | ||
jobs: | ||
release-single-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
#/usr/bin/git config --global --add safe.directory /home/runner/work/ksmartdata/ksmartdata/ksmartdata | ||
path: ksmartdata | ||
|
||
- name: Checkout mongodb operator | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "mongodb/mongodb-kubernetes-operator" | ||
# 使用指定的tag | ||
ref: 'v0.10.0' | ||
#/usr/bin/git config --global --add safe.directory /home/runner/work/ksmartdata/ksmartdata/mongodb-kubernetes-operator | ||
path: mongodb-kubernetes-operator | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10.4' | ||
architecture: 'x64' | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ hashFiles('./mongodb-kubernetes-operator/requirements.txt') }} | ||
|
||
- name: Install Python Dependencies | ||
run: pip install -r ./mongodb-kubernetes-operator/requirements.txt | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# template: .action_templates/steps/set-up-qemu.yaml | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Override some files of mongodb operator | ||
run: | | ||
cp ./ksmartdata/images/mongodb/config.json ./mongodb-kubernetes-operator/scripts/ci/config.json | ||
cp ./ksmartdata/images/mongodb/operator-inventory.yaml ./mongodb-kubernetes-operator/inventories/operator-inventory.yaml | ||
cp ./ksmartdata/images/mongodb/pipeline.py ./mongodb-kubernetes-operator/pipeline.py | ||
- name: Build and Push Image To ghcr.io | ||
working-directory: ./mongodb-kubernetes-operator | ||
run: python pipeline.py --image-name ${{ github.event.inputs.pipeline-argument }} --tag ${{ github.event.inputs.image-tag }} | ||
env: | ||
MONGODB_COMMUNITY_CONFIG: "${{ github.workspace }}/mongodb-kubernetes-operator/scripts/ci/config.json" | ||
version_id: "${{ github.event.inputs.image-tag }}" | ||
|
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,9 @@ | ||
{ | ||
"namespace": "default", | ||
"repo_url": "ghcr.io/usernameisnull", | ||
"operator_image": "mongodb-kubernetes-operator", | ||
"version_upgrade_hook_image": "mongodb-kubernetes-operator-version-upgrade-post-start-hook", | ||
"agent_image": "mongodb-agent-ubi", | ||
"readiness_probe_image": "mongodb-kubernetes-readinessprobe", | ||
"s3_bucket": "" | ||
} |
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,117 @@ | ||
vars: | ||
registry: <registry> | ||
architecture: amd64 | ||
|
||
images: | ||
- name: operator | ||
vars: | ||
context: . | ||
template_context: scripts/dev/templates/operator | ||
|
||
inputs: | ||
- image | ||
- image_dev | ||
|
||
platform: linux/$(inputs.params.architecture) | ||
|
||
stages: | ||
# | ||
# Dev build stages | ||
# | ||
- name: operator-builder-dev | ||
task_type: docker_build | ||
tags: [ "ubi" ] | ||
dockerfile: scripts/dev/templates/operator/Dockerfile.builder | ||
|
||
buildargs: | ||
builder_image: $(inputs.params.builder_image) | ||
|
||
labels: | ||
quay.expires-after: 48h | ||
|
||
output: | ||
- registry: $(inputs.params.registry)/$(inputs.params.image_dev) | ||
tag: $(inputs.params.version_id)-context-$(inputs.params.architecture) | ||
|
||
- name: operator-template-dev | ||
task_type: dockerfile_template | ||
tags: ["ubi"] | ||
template_file_extension: operator | ||
inputs: | ||
- base_image | ||
|
||
output: | ||
- dockerfile: scripts/dev/templates/operator/Dockerfile.operator-$(inputs.params.version_id) | ||
|
||
- name: operator-build-dev | ||
task_type: docker_build | ||
tags: ["ubi"] | ||
dockerfile: scripts/dev/templates/operator/Dockerfile.operator-$(inputs.params.version_id) | ||
|
||
inputs: | ||
- version_id | ||
|
||
buildargs: | ||
imagebase: $(inputs.params.registry)/$(inputs.params.image_dev):$(inputs.params.version_id)-context-$(inputs.params.architecture) | ||
|
||
labels: | ||
quay.expires-after: 48h | ||
|
||
output: | ||
- registry: $(inputs.params.registry)/$(inputs.params.image_dev) | ||
tag: $(inputs.params.version_id)-$(inputs.params.architecture) | ||
- registry: $(inputs.params.registry)/$(inputs.params.image_dev) | ||
tag: latest-$(inputs.params.architecture) | ||
|
||
# | ||
# Release build stages | ||
# | ||
- name: operator-builder-release | ||
task_type: docker_build | ||
tags: [ "ubi", "release"] | ||
|
||
inputs: | ||
- builder_image | ||
- release_version | ||
|
||
dockerfile: scripts/dev/templates/operator/Dockerfile.builder | ||
|
||
labels: | ||
quay.expires-after: Never | ||
|
||
buildargs: | ||
builder_image: $(inputs.params.builder_image) | ||
|
||
output: | ||
- registry: $(inputs.params.registry)/$(inputs.params.image) | ||
tag: $(inputs.params.release_version)-context-$(inputs.params.architecture) | ||
|
||
- name: operator-template-release | ||
task_type: dockerfile_template | ||
tags: [ "ubi", "release"] | ||
template_file_extension: operator | ||
inputs: | ||
- base_image | ||
- release_version | ||
|
||
output: | ||
- dockerfile: scripts/dev/templates/operator/Dockerfile.operator-$(inputs.params.release_version) | ||
|
||
- name: operator-build-release | ||
task_type: docker_build | ||
tags: [ "ubi", "release"] | ||
|
||
inputs: | ||
- release_version | ||
|
||
dockerfile: scripts/dev/templates/operator/Dockerfile.operator-$(inputs.params.release_version) | ||
|
||
buildargs: | ||
imagebase: $(inputs.params.registry)/$(inputs.params.image):$(inputs.params.release_version)-context-$(inputs.params.architecture) | ||
|
||
labels: | ||
quay.expires-after: Never | ||
|
||
output: | ||
- registry: $(inputs.params.registry)/$(inputs.params.image) | ||
tag: $(inputs.params.release_version)-$(inputs.params.architecture) |
Oops, something went wrong.