Skip to content

Commit 2dffc5e

Browse files
committed
add generator
Signed-off-by: cuisongliu <cuisongliu@qq.com>
1 parent aa3c910 commit 2dffc5e

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

.github/workflows/generator.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
bash download.sh
1818
export SYNC_DIR=docs/docker
1919
export SYNC_HUB=docker.io/labring
20-
/tmp/repos
20+
/tmp/cluster-image-docs
2121
- name: auto generator by aliyun
2222
run: |
2323
export SYNC_DIR=docs/aliyun-hk
2424
export SYNC_HUB=registry.cn-hongkong.aliyuncs.com/labring
25-
/tmp/repos
25+
/tmp/cluster-image-docs
2626
- uses: peter-evans/create-pull-request@v5
2727
with:
2828
title: 'workflow: Automated Workflow Update for ${{steps.get-current-tag.outputs.tag }}'
@@ -37,6 +37,6 @@ jobs:
3737
token: ${{ secrets.GH_PAT }}
3838
reviewers: cuisongliu
3939
branch-suffix: short-commit-hash
40-
labels: sync-images
40+
labels: sync-docs
4141
committer: sealos-ci-robot <sealos-ci-robot@sealos.io>
4242
author: sealos-ci-robot <sealos-ci-robot@sealos.io>

download.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
#!/bin/bash
22

33
# 仓库名称
4-
repository="labring-actions/repos"
4+
repository="labring-actions/cluster-image-docs"
55

66
# 获取最新release的版本号
7-
latest_release=$(curl -s "https://api.github.com/repos/$repository/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
7+
latest_release=$(curl -s "https://api.github.com/cluster-image-docs/$repository/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
88
# 构建下载链接
9-
download_url="https://github.com/$repository/releases/download/$latest_release/repos_${latest_release#v}_linux_amd64.tar.gz"
9+
download_url="https://github.com/$repository/releases/download/$latest_release/cluster-image-docs_${latest_release#v}_linux_amd64.tar.gz"
1010

1111
# 下载最新release
1212
wget $download_url
1313

1414
# 解压缩下载的文件(如果是tar.gz格式)
15-
tar -zxvf repos_${latest_release#v}_linux_amd64.tar.gz repos
15+
tar -zxvf cluster-image-docs_${latest_release#v}_linux_amd64.tar.gz cluster-image-docs
1616

1717
# 删除压缩包
18-
rm -rf repos_${latest_release#v}_linux_amd64.tar.gz
18+
rm -rf cluster-image-docs_${latest_release#v}_linux_amd64.tar.gz
1919

20-
chmod a+x repos
20+
chmod a+x cluster-image-docs
2121

2222
mkdir "/tmp"
2323

24-
mv srepos "/tmp"
24+
mv cluster-image-docs "/tmp"

generator/default.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package generator
1919
import (
2020
"context"
2121
"github.com/cuisongliu/logger"
22-
"github.com/labring-actions/repos/generator/markdown"
23-
"github.com/labring-actions/repos/generator/types"
22+
"github.com/labring-actions/cluster-image-docs/generator/markdown"
23+
"github.com/labring-actions/cluster-image-docs/generator/types"
2424
"golang.org/x/sync/errgroup"
2525
"os"
2626
"path/filepath"

generator/markdown/other.md.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package markdown
1818

1919
import (
2020
"github.com/cuisongliu/logger"
21-
"github.com/labring-actions/repos/generator/types"
21+
"github.com/labring-actions/cluster-image-docs/generator/types"
2222
"html/template"
2323
"os"
2424
"path"

generator/markdown/other.md_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package markdown
1818

1919
import (
20-
"github.com/labring-actions/repos/generator/types"
20+
"github.com/labring-actions/cluster-image-docs/generator/types"
2121
"testing"
2222
)
2323

generator/repos.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"encoding/json"
2222
"fmt"
2323
"github.com/cuisongliu/logger"
24-
"github.com/labring-actions/repos/generator/registry"
25-
"github.com/labring-actions/repos/generator/types"
26-
"github.com/labring-actions/repos/generator/utils"
24+
"github.com/labring-actions/cluster-image-docs/generator/registry"
25+
"github.com/labring-actions/cluster-image-docs/generator/types"
26+
"github.com/labring-actions/cluster-image-docs/generator/utils"
2727
"golang.org/x/sync/errgroup"
2828
"strings"
2929
"sync"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/labring-actions/repos
1+
module github.com/labring-actions/cluster-image-docs
22

33
go 1.20
44

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
package main
1818

19-
import "github.com/labring-actions/repos/generator"
19+
import "github.com/labring-actions/cluster-image-docs/generator"
2020

2121
func main() {
2222
generator.Do()

0 commit comments

Comments
 (0)