diff --git a/docs/about/contributing.md b/docs/about/contributing.md new file mode 100644 index 0000000000000000000000000000000000000000..22268aff40ceec2bf56c20f048d368284b2ec875 --- /dev/null +++ b/docs/about/contributing.md @@ -0,0 +1,68 @@ +# Contributing + +It is recommended to develop with [Visual Studio Code](https://code.visualstudio.com/) and make use of the git integration and the many extensions available. + +## Documentation +> `mkdocs.yml`, `docs/` + +The documentation is written in Markdown and built using [MkDocs](https://www.mkdocs.org/), the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme and several extensions (see `mkdocs.yml`). + +Local development (requires python): +``` bash +pip install mkdocs +pip install mkdocs-material +mkdocs serve # starts a dev server +``` + +CI pipeline: `.gitlab-ci-docs.yml` + +## Server +> `go.mod`, `go.sum`, `cmd/`, `internal/`, `pkg/` + +The Stream TV Server is written in [Go](https://golang.org). It uses [Go Modules](https://github.com/golang/go/wiki/Modules). +`go.mod` and `go.sum` are for the module system to ensure [Reproducible builds](https://reproducible-builds.org/). + +The `cmd/` directory contains only the `stream-tv-server` command. It sets up the HTTP server and forwards requests to the respective `website`, `twitch` and `tv` handlers in `internal/`. +`pkg/` contains project independent code to access the Twitch API. This separation is done in accordance to the [Standard Go Project Layout](https://github.com/golang-standards/project-layout). + +Local development (requires go 1.12 and a twitch client id): + +``` bash tab="bash" linenums="1" +env TWITCH_CLIENT_ID="your client id here" go run ./cmd/stream-tv-server/main.go +``` + +``` PowerShell tab="PowerShell" linenums="1" +$env:TWITCH_CLIENT_ID="your client id here" +go run .\cmd\stream-tv-server\main.go +``` + +CI pipeline: `.gitlab-ci-server.yml` + +## Versioning +> `CHANGELOG.md` + +The project uses [Semantic Versioning](https://semver.org) prefixed with an `v`. + +CI pipeline: `.gitlab-ci.yml` + +## GitLab + +Everybody can contribute code by opening merge requests. Users with role *Developer* can also directly push to master. +This allows interested students to work on master and make use of the CI pipeline but only *Maintainers* can create version tags. These tags are protected and will trigger an deploy to GitLab Pages by `.gitlab-ci-pages.yml`. This means that only a *Maintainer* can update the live documentation and the downloads. +This is done to prevent abuse e.g. distributing malware. + +### How a Maintainer should publish a new version + +1. In GitLab --> Repository --> Compare - review the changes between *master* and the latest version tag (bottom of the list). + +2. If everything is okay and no malicious code is found update the CHANGELOG.md with the new version and a short changelog. Maybe even link to issues or merge requests. + +3. Commit (name it `Updated CHANGELOG to vX.X.X`), push the changes and check if the CI pipeline succeeds. + If the pipeline fails it means there are still errors in the server or the docs. + +4. *Optionally for additional testing:* The artifacts of the pipeline can be manually tested. + +5. In GitLab --> Repository --> Tags create a new tag from master. The version should be the same as in the changelog and the commit message. + +6. After the pipeline for the tag is finished the documentation and downloads should update after some time. + Note that google needs some time to crawl and virus scan the executables so until that happens chrome will display a warning when downloading. diff --git a/docs/server/contributing.md b/docs/server/contributing.md deleted file mode 100644 index 805c5b81648116a5a15c2d4338e22b3960dddc08..0000000000000000000000000000000000000000 --- a/docs/server/contributing.md +++ /dev/null @@ -1,2 +0,0 @@ -<!-- Insert CONTRIBUTING.md from the root --> ---8<-- "CONTRIBUTING.md"