This repository was archived by the owner on Sep 6, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +130
-70
lines changed Expand file tree Collapse file tree 5 files changed +130
-70
lines changed Original file line number Diff line number Diff line change @@ -3,50 +3,48 @@ name: CI
3
3
on :
4
4
pull_request :
5
5
branches :
6
- - ' * '
6
+ - " * "
7
7
push :
8
8
branches :
9
9
- master
10
10
11
11
jobs :
12
-
13
12
build :
14
13
name : Build
15
14
runs-on : ubuntu-latest
16
15
steps :
17
-
18
- - name : Set up Go 1.14
19
- uses : actions/setup-go@v1
20
- with :
21
- go-version : 1.14
22
- id : go
23
-
24
- - name : Check out code into the Go module directory
25
- uses : actions/checkout@v1
26
-
27
- - name : Set up Docker Buildx
28
- id : buildx
29
- uses : crazy-max/ghaction-docker-buildx@v1
30
- with :
31
- version : latest
32
-
33
- - name : Available platforms
34
- run : echo ${{ steps.buildx.outputs.platforms }}
35
-
36
- - name : Prepare Host
37
- run : |
38
- sudo apt-get -qq update || true
39
- sudo apt-get install -y bzr
40
-
41
- - name : Run checks
42
- run : |
43
- make ci
44
-
45
- - name : Build
46
- env :
47
- REGISTRY : appscodeci
48
- DOCKER_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
49
- USERNAME : 1gtm
50
- run : |
51
- docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
52
- make push
16
+ - name : Set up Go 1.14
17
+ uses : actions/setup-go@v1
18
+ with :
19
+ go-version : 1.14
20
+ id : go
21
+
22
+ - name : Check out code into the Go module directory
23
+ uses : actions/checkout@v1
24
+
25
+ - name : Set up Docker Buildx
26
+ id : buildx
27
+ uses : crazy-max/ghaction-docker-buildx@v1
28
+ with :
29
+ version : latest
30
+
31
+ - name : Available platforms
32
+ run : echo ${{ steps.buildx.outputs.platforms }}
33
+
34
+ - name : Prepare Host
35
+ run : |
36
+ sudo apt-get -qq update || true
37
+ sudo apt-get install -y bzr
38
+
39
+ - name : Run checks
40
+ run : |
41
+ make ci
42
+
43
+ - name : Build
44
+ env :
45
+ REGISTRY : appscodeci
46
+ DOCKER_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
47
+ USERNAME : 1gtm
48
+ run : |
49
+ docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
50
+ make push
Original file line number Diff line number Diff line change @@ -3,37 +3,35 @@ name: Release
3
3
on :
4
4
push :
5
5
tags :
6
- - ' *.*'
6
+ - " *.*"
7
7
8
8
jobs :
9
-
10
9
build :
11
10
name : Build
12
11
runs-on : ubuntu-latest
13
12
steps :
14
-
15
- - name : Check out code into the Go module directory
16
- uses : actions/checkout@v1
17
-
18
- - name : Print version info
19
- id : semver
20
- run : |
21
- make version
22
-
23
- - name : Set up Docker Buildx
24
- id : buildx
25
- uses : crazy-max/ghaction-docker-buildx@v1
26
- with :
27
- version : latest
28
-
29
- - name : Available platforms
30
- run : echo ${{ steps.buildx.outputs.platforms }}
31
-
32
- - name : Build
33
- env :
34
- DOCKER_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
35
- USERNAME : 1gtm
36
- APPSCODE_ENV : prod
37
- run : |
38
- docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
39
- make release
13
+ - name : Check out code into the Go module directory
14
+ uses : actions/checkout@v1
15
+
16
+ - name : Print version info
17
+ id : semver
18
+ run : |
19
+ make version
20
+
21
+ - name : Set up Docker Buildx
22
+ id : buildx
23
+ uses : crazy-max/ghaction-docker-buildx@v1
24
+ with :
25
+ version : latest
26
+
27
+ - name : Available platforms
28
+ run : echo ${{ steps.buildx.outputs.platforms }}
29
+
30
+ - name : Build
31
+ env :
32
+ DOCKER_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
33
+ USERNAME : 1gtm
34
+ APPSCODE_ENV : prod
35
+ run : |
36
+ docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
37
+ make release
Original file line number Diff line number Diff line change
1
+ name : update-docs
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+
8
+ jobs :
9
+ build :
10
+ name : Build
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Set up Go 1.14
14
+ uses : actions/setup-go@v1
15
+ with :
16
+ go-version : 1.14
17
+ id : go
18
+
19
+ - uses : actions/checkout@v1
20
+
21
+ - name : Install GitHub CLI
22
+ run : |
23
+ curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
24
+ sudo mv bin/hub /usr/local/bin
25
+
26
+ - name : Clone charts repository
27
+ env :
28
+ GITHUB_USER : 1gtm
29
+ GITHUB_TOKEN : ${{ secrets.LGTM_GITHUB_TOKEN }}
30
+ DOCS_REPOSITORY : ${{ secrets.DOCS_REPOSITORY }}
31
+ run : |
32
+ url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${DOCS_REPOSITORY}.git"
33
+ cd $RUNNER_WORKSPACE
34
+ git clone $url
35
+ cd $(basename $DOCS_REPOSITORY)
36
+ git config user.name "${GITHUB_USER}"
37
+ git config user.email "${GITHUB_USER}@appscode.com"
38
+
39
+ - name : Update docs
40
+ env :
41
+ GITHUB_USER : 1gtm
42
+ GITHUB_TOKEN : ${{ secrets.LGTM_GITHUB_TOKEN }}
43
+ DOCS_REPOSITORY : ${{ secrets.DOCS_REPOSITORY }}
44
+ run : |
45
+ export DOCS_ROOT=$RUNNER_WORKSPACE/$(basename $DOCS_REPOSITORY)
46
+ ./hack/gendocs/make.sh
47
+ $DOCS_ROOT/hack/scripts/open-pr.sh
Original file line number Diff line number Diff line change @@ -66,10 +66,17 @@ aliases:
66
66
` ))
67
67
)
68
68
69
+ func docsDir () string {
70
+ if dir , ok := os .LookupEnv ("DOCS_ROOT" ); ok {
71
+ return dir
72
+ }
73
+ return runtime .GOPath () + "/src/kubevault.dev/docs"
74
+ }
75
+
69
76
// ref: https://github.com/spf13/cobra/blob/master/doc/md_docs.md
70
77
func main () {
71
78
rootCmd := cmds .NewRootCmd ()
72
- dir := runtime . GOPath () + "/src/kubevault.dev/ docs/docs/ reference/ csi-driver"
79
+ dir := filepath . Join ( docsDir (), " docs" , " reference" , " csi-driver")
73
80
fmt .Printf ("Generating cli markdown tree in: %v\n " , dir )
74
81
err := os .RemoveAll (dir )
75
82
if err != nil {
Original file line number Diff line number Diff line change 1
- #! /usr/ bin/env bash
1
+ #! /bin/bash
2
2
3
3
# Copyright The KubeVault Authors.
4
4
#
14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- pushd $GOPATH /src/kubevault.dev/csi-driver/hack/gendocs
17
+ set -eou pipefail
18
+
19
+ SCRIPT_ROOT=$( realpath $( dirname " ${BASH_SOURCE[0]} " ) /../..)
20
+ SCRIPT_NAME=$( basename " ${BASH_SOURCE[0]} " )
21
+ pushd $SCRIPT_ROOT /hack/gendocs
22
+
23
+ # http://redsymbol.net/articles/bash-exit-traps/
24
+ function cleanup() {
25
+ popd
26
+ }
27
+ trap cleanup EXIT
28
+
18
29
go run main.go
19
- popd
You can’t perform that action at this time.
0 commit comments