Merge pull request #3429 from RolandMa1986/staging-rules
Update staging repo sync rules
This commit is contained in:
60
staging/README.md
Normal file
60
staging/README.md
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# External Repository Staging Area
|
||||||
|
|
||||||
|
This directory is the staging area for packages that have been split to their
|
||||||
|
own repository. The content here will be periodically published to respective
|
||||||
|
top-level kubesphere.io repositories.
|
||||||
|
|
||||||
|
Repositories currently staged here:
|
||||||
|
|
||||||
|
- [`kubesphere.io/client-go`](https://github.com/kubesphere/client-go)
|
||||||
|
|
||||||
|
|
||||||
|
The code in the staging/ directory is authoritative, i.e. the only copy of the
|
||||||
|
code. You can directly modify such code.
|
||||||
|
|
||||||
|
## Using staged repositories from KubeSphere code
|
||||||
|
|
||||||
|
KubeSphere code uses the repositories in this directory via symlinks in the
|
||||||
|
`vendor/kubesphere.io` directory into this staging area. For example, when
|
||||||
|
KubeSphere code imports a package from the `kubesphere.io/client-go` repository, that
|
||||||
|
import is resolved to `staging/src/kubesphere.io/client-go` relative to the project
|
||||||
|
root:
|
||||||
|
|
||||||
|
```go
|
||||||
|
// pkg/example/some_code.go
|
||||||
|
package example
|
||||||
|
|
||||||
|
import (
|
||||||
|
"kubesphere.io/client-go/" // resolves to staging/src/kubesphere.io/client-go/dynamic
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the change-over to external repositories is complete, these repositories
|
||||||
|
will actually be vendored from `kubesphere.io/<package-name>`.
|
||||||
|
|
||||||
|
## Creating a new repository in staging
|
||||||
|
|
||||||
|
### Adding the staging repository in `kubesphere/kubesphere`:
|
||||||
|
|
||||||
|
1. Add a propose to sig-architecture in [community](https://github.com/kubesphere/community/). Waiting approval for creating the staging repository.
|
||||||
|
|
||||||
|
2. Once approval has been granted, create the new staging repository.
|
||||||
|
|
||||||
|
3. Add a symlink to the staging repo in `vendor/kubesphere.io`.
|
||||||
|
|
||||||
|
4. Add all mandatory template files to the staging repo such as README.md, LICENSE, OWNER,CONTRIBUTING.md.
|
||||||
|
|
||||||
|
|
||||||
|
### Creating the published repository
|
||||||
|
|
||||||
|
1. Create an repository in the KubeSphere org. The published repository **must** have an
|
||||||
|
initial empty commit.
|
||||||
|
|
||||||
|
2. Setup branch protection and enable access to the `ks-publishing-bot` bot.
|
||||||
|
|
||||||
|
3. Once the repository has been created in the KubeSphere org, update the publishing-bot to publish the staging repository by updating:
|
||||||
|
|
||||||
|
- [`rules.yaml`](/staging/publishing/rules.yaml):
|
||||||
|
Make sure that the list of dependencies reflects the staging repos in the `Godeps.json` file.
|
||||||
|
|
||||||
|
4. Add the repo to the list of staging repos in this `README.md` file.
|
||||||
21
staging/publishing/rules.yaml
Normal file
21
staging/publishing/rules.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
recursive-delete-patterns:
|
||||||
|
- BUILD
|
||||||
|
default-go-version: 1.13.15
|
||||||
|
rules:
|
||||||
|
- destination: client-go
|
||||||
|
library: true
|
||||||
|
branches:
|
||||||
|
- source:
|
||||||
|
branch: master
|
||||||
|
dir: staging/src/kubesphere.io/client-go
|
||||||
|
name: master
|
||||||
|
# - source:
|
||||||
|
# branch: release-3.1
|
||||||
|
# dir: staging/src/kubesphere.io/client-go
|
||||||
|
# name: release-3.1
|
||||||
|
# go: 1.13.15
|
||||||
|
|
||||||
|
smoke-test: |
|
||||||
|
# assumes GO111MODULE=on
|
||||||
|
go build ./...
|
||||||
|
go test ./...
|
||||||
Reference in New Issue
Block a user