Skip to content

Commit

Permalink
feat(pingcap/ticdc): support publish artifacts for the repo's trunk b…
Browse files Browse the repository at this point in the history
…ranch (#528)

Artifacts:

- tiup package `cdc` nightly version will be published to tiup mirror
from this repo(switched from tiflow repo).
- container image `pingcap/ticdc:master` in docker hub will be published
from this repo.

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo authored Jan 9, 2025
1 parent 310df2a commit 229d393
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ function test_get_builder() {
done
done

# for cdc - only community edition
local cm="ticdc"
local versions="v9.0.0"
for version in $versions; do
for os in $operating_systems; do
for ac in $architectures; do
echo -en "[🚢] $cm $os $ac $version release:\t"
img=$($script "$cm" "$os" "$ac" "$version" release)
echo $img
check_image_existed $img
done
done
done

# enterprise profile
local components="tidb tiflash tikv pd"
for cm in $components; do
Expand Down Expand Up @@ -123,6 +137,19 @@ function test_gen_package_artifacts_script() {
done
done

# for cdc - only community edition
local cm="ticdc"
local versions="v9.0.0"
for version in $versions; do
for os in $operating_systems; do
for ac in $architectures; do
echo -en "[📃📦] $cm $os $ac $version $profile:\t"
$script "$cm" "$os" "$ac" "$version" $profile branch-xxx 123456789abcdef
shellcheck -S error packages/scripts/build-package-artifacts.sh
done
done
done

# enterprise profile
local profile="enterprise"
local components="tidb tikv pd tiflash"
Expand Down Expand Up @@ -225,6 +252,17 @@ function test_gen_package_images_script() {
done
done

# for cdc - only community edition
local cm="ticdc"
local versions="v9.0.0"
for version in $versions; do
for ac in $architectures; do
echo -en "[📃💿] $cm $os $ac $version $profile:\t"
$script "$cm" linux "$ac" "$version" "$profile" branch-xxx 123456789abcdef
shellcheck -S error packages/scripts/build-package-images.sh
done
done

# enterprise profile
local profile="enterprise"
local components="tidb tikv pd tiflash"
Expand Down
12 changes: 9 additions & 3 deletions packages/delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ image_copy_rules:
dest_repositories:
- docker.io/pingcap/advanced-statefulset
- gcr.io/pingcap-public/dbaas/advanced-statefulset
hub.pingcap.net/pingcap/ticdc/image:
# only delivey the master branch images.
- <<: *sync_trunk_community
dest_repositories:
- docker.io/pingcap/ticdc
hub.pingcap.net/pingcap/tidb-operator/images/tidb-operator:
- description: delivery the version images.
tags_regex:
Expand Down Expand Up @@ -155,9 +160,10 @@ image_copy_rules:
- gcr.io/pingcap-public/dbaas/dumpling
- docker.io/pingcap/dumpling-enterprise
hub.pingcap.net/pingcap/tiflow/images/cdc:
- <<: *sync_trunk_community
dest_repositories:
- docker.io/pingcap/ticdc
# We switch the `master` tag image building from `pingcap/tiflow` to `pingcap/ticdc` repo.
# - <<: *sync_trunk_community
# dest_repositories:
# - docker.io/pingcap/ticdc
- <<: *sync_rc_community
dest_repositories:
- hub.pingcap.net/qa/ticdc
Expand Down
48 changes: 46 additions & 2 deletions packages/packages.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ components:
src:
path: outputs/tiflash/
tiflow:
desc: tiflow components tarball
desc: tiflow components
git:
url: https://github.com/pingcap/tiflow.git
ref: {{ .Git.ref | default "master" }}
Expand Down Expand Up @@ -2119,7 +2119,51 @@ components:
dockerfile: deployments/engine/docker/Dockerfile
build_args:
- GOPROXY=http://goproxy.pingcap.net,https://goproxy.cn,direct

ticdc:
desc: ticdc components
git:
url: https://github.com/pingcap/ticdc.git
ref: {{ .Git.ref | default "master" }}
sha: {{ .Git.sha | default "" }}
version: {{ .Release.version }} # segment version.
artifactory:
package_repo: "{{ .Release.registry }}/pingcap/ticdc/package"
tags:
{{- if .Git.sha }}
- {{ strings.ReplaceAll "/" "-" .Git.ref | strings.ToLower }}-{{ strings.Trunc 7 .Git.sha }}
{{- end }}
- {{ strings.ReplaceAll "/" "-" .Git.ref | strings.ToLower }}
- {{ .Release.version }}
# binary builder, also we need it when build for mac to get build tools versions and other informations.
builders:
- if: {{ semver.CheckConstraint ">= 9.0.0-0" .Release.version }}
image: ghcr.io/pingcap-qe/cd/builders/ticdc:v2024.10.8-64-g95f12b0-centos7-go1.23
routers:
- description: For range [v9.0.0, )
if: {{ semver.CheckConstraint ">= 9.0.0-0" .Release.version }}
os: [linux, darwin]
arch: [amd64, arm64]
profile: [release]
steps:
release:
- script: make cdc
artifacts:
- name: "cdc-{{ .Release.version }}-{{ .Release.os }}-{{ .Release.arch }}.tar.gz"
files:
- name: cdc
src:
path: bin/cdc
tiup:
description: >-
CDC is a change data capture tool for TiDB
entrypoint: cdc
- name: container image - cdc
type: image
artifactory:
repo: "{{ .Release.registry }}/pingcap/ticdc/image"
dockerfile: https://github.com/PingCAP-QE/artifacts/raw/main/dockerfiles/products/ticdc/Dockerfile
files: # context files
- { name: cdc, src: { path: bin/cdc } }
tiflow-operator:
desc: tiflow operator components tarball
git:
Expand Down

0 comments on commit 229d393

Please sign in to comment.