forked from bitpoke/mysql-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.66 KB
/
release-mongodb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
cp ./ksmartdata/images/mongodb/Dockerfile.ubi ./mongodb-kubernetes-operator/scripts/dev/templates/agent/Dockerfile.ubi
- 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 }}"