Skip to content

Commit

Permalink
docs(packages): Update README.md
Browse files Browse the repository at this point in the history
also add the the verify step for the README.md with shelldoc tool

Ref: https://github.com/endocode/shelldoc
Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo committed Dec 19, 2023
1 parent c81ae73 commit 802c368
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 11 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/pull-verify-packages-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,32 @@ jobs:

- name: Install tools
run: |
git clone https://github.com/hairyhenderson/gomplate
cd gomplate
GOBIN=/usr/local/bin go install ./cmd/gomplate
rm -rf gomplate
gomplate --version
# install gomplate
git clone https://github.com/hairyhenderson/gomplate && \
pushd gomplate && \
GOBIN=/usr/local/bin go install ./cmd/gomplate &&
popd &&
rm -rf gomplate && \
gomplate --version
# install shelldoc to check the README.md
git clone https://github.com/endocode/shelldoc && \
pushd shelldoc && \
GOBIN=/usr/local/bin go install ./cmd/shelldoc &&
popd &&
rm -rf shelldoc && \
# we need yq and jq.
yq --version
jq --version
- name: Checkout code
uses: actions/checkout@v4

# - name: Verify the README.md
# run: |
# shelldoc run --shell `which bash` packages/README.md

- name: Test => Get builder
run: |
for cm in tidb tiflow tiflash tikv pd; do
Expand Down
38 changes: 37 additions & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
`WIP`
Central declarative congfigurations for artifacts delivering.
===

> We use go template format to control them.
## Prerequire tools

- [gomplate](https://github.com/hairyhenderson/gomplate)
> Please install the master version.
- [yq]
- jq

## For component binaries packages and container images

Configuration template: [packages.yaml.tmpl](./packages.yaml.tmpl)

### Required context

You can get them by run:
```console
$ grep -oE "{{\s*\..*?}}" packages/packages.yaml.tmpl | grep -oE "\.\w+(\.\w+)*" | sort -u
.Git.ref
.Git.sha
.Release.arch
.Release.os
.Release.version
```

## For offline deploy pacakges

### Required context

You can get them by run:
```console
$ grep -oE "{{\s*\..*?}}" packages/offline-packages.yaml.tmpl | grep -oE "\.\w+(\.\w+)*" | sort -u
.Release.arch
.Release.version
```
11 changes: 6 additions & 5 deletions packages/offline-packages.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# See README.md
artifactory:
repo: hub.pingcap.net/pingcap/offline-package
tags:
- "{{ .Release.version }}"
artifacts:
community:
desc: community offline package
version: "{{ .Release.version }}" # segment version.
artifactory:
repo: hub.pingcap.net/pingcap/offline-package
tags:
- "{{ .Release.version }}"
routers: # match once.
- description: "Started from v7.5.0 to latest"
# ref: https://github.com/Masterminds/semver#checking-version-constraints
Expand Down Expand Up @@ -107,7 +108,7 @@ artifacts:
extract: true
extract_inner_path: "etcd-v3.4.21-linux-{{ .Release.arch }}/etcdctl"
- description: "Started from v7.1.0 until v7.5"
# ref: https://github.com/Masterminds/semver#checking-version-constraints
# ref: https://github.com/Masterminds/semver#checking-version-constraints
if: {{ semver.CheckConstraint ">=7.1.0-0, <7.5.0-0" .Release.version }}
os: [linux]
arch: [amd64, arm64]
Expand Down
1 change: 1 addition & 0 deletions packages/packages.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# See README.md
components:
pd:
desc: pd server component tarball
Expand Down

0 comments on commit 802c368

Please sign in to comment.