Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: website markup, auto-doc ci #877

Closed
wants to merge 16 commits into from
8 changes: 7 additions & 1 deletion .github/workflows/auto-gen-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ on:
- 'docs/**'
- 'website/**'
- 'assets/**'
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
paths:
- 'docs/**'
- 'website/**'
- 'assets/**'

jobs:
# Set the job key. The key is displayed as the job name
Expand Down Expand Up @@ -76,7 +82,7 @@ jobs:

# Creates pull request with generated docs
- name: Create Pull Request
if: env.IS_CHANGED == 'true'
if: env.IS_CHANGED == 'true' && github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@v5
with:
commit-message: Auto-updated docs
Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -479,22 +479,24 @@ helm-release-latest: helm

# Download and build hugo extended locally if necessary
HUGO_PATH = $(shell pwd)/bin/hugo
HUGO_VERSION = v0.113.0
HAS_HUGO := $(shell $(HUGO_PATH)/hugo version 2>&- | grep $(HUGO_VERSION))
HUGO_VERSION = 0.118.1
HAS_HUGO := $(shell $(HUGO_PATH) version 2>&- | grep $(HUGO_VERSION))
hugo:
ifeq ($(HAS_HUGO), )
@echo "Installing Hugo $(HUGO_VERSION)"
rm -rf $(HUGO_PATH)
git clone https://github.com/gohugoio/hugo.git --depth=1 --branch $(HUGO_VERSION) $(HUGO_PATH)
cd $(HUGO_PATH) && go build --tags extended -o hugo main.go
curl -L -O https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_extended_$(HUGO_VERSION)_Linux-64bit.tar.gz
tar -xzvf hugo_extended_$(HUGO_VERSION)_Linux-64bit.tar.gz hugo
rm hugo_extended_$(HUGO_VERSION)_Linux-64bit.tar.gz
mkdir -p bin
mv $(shell pwd)/hugo $(HUGO_PATH)
endif

.PHONY: generate-docs
generate-docs: hugo ## Re-generate docs directory from the website directory
@echo "+ $@"
rm -rf docs || echo "Cannot remove docs dir, ignoring"
cd website && npm install
$(HUGO_PATH)/hugo -s website -d ../docs
cd website && npm install && npm install postcss postcss-cli autoprefixer
$(HUGO_PATH) -s website -d ../docs

.PHONY: run-docs
run-docs: hugo
Expand Down
3 changes: 1 addition & 2 deletions website/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ blog = "/:section/:year/:month/:day/:slug/"
#latexDashes = true

[markup]
defaultMarkdownHandler = "blackfriday"
defaultMarkdownHandler = "goldmark"

# Image processing configuration.
[imaging]
Expand Down Expand Up @@ -134,4 +134,3 @@ no = 'Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY
# url = "https://github.com/google/docsy"
# icon = "fab fa-github"
# desc = "Development takes place here!"

23 changes: 16 additions & 7 deletions website/content/en/docs/Developer Guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Start minikube instance configured for **Jenkins Operator**. Appropriate minikub
```bash
make minikube-start
```
Next run **Jenkins Operator** locally.
Next run **Jenkins Operator** locally.
```bash
make run
```
Expand All @@ -45,7 +45,7 @@ Console output indicating readiness of this phase:
kubectl config use-context minikube
Switched to context "minikube".
Watching 'default' namespace
bin/manager --jenkins-api-hostname=192.168.99.252 --jenkins-api-port=0 --jenkins-api-use-nodeport=true --cluster-domain=cluster.local
bin/manager --jenkins-api-hostname=192.168.99.252 --jenkins-api-port=0 --jenkins-api-use-nodeport=true --cluster-domain=cluster.local
2021-02-08T14:14:45.263+0100 INFO cmd Version: v0.5.0
2021-02-08T14:14:45.263+0100 INFO cmd Git commit: 305dbeda-dirty-dirty
2021-02-08T14:14:45.264+0100 INFO cmd Go Version: go1.15.6
Expand Down Expand Up @@ -93,9 +93,9 @@ kubectl apply -f config/samples/jenkins.io_v1alpha2_jenkins.yaml
{"level":"info","ts":1612790853.489524,"logger":"controller-jenkins","msg":"User configuration phase is complete, took 2m38s","cr":"jenkins-example"}

Two log lines says that Jenkins Operator works correctly:
* `Base configuration phase is complete` - ensures manifests, Jenkins pod, Jenkins configuration and Jenkins API token
* `User configuration phase is complete` - ensures Jenkins restore, backup and seed jobs along with user configuration

* `Base configuration phase is complete` - ensures manifests, Jenkins pod, Jenkins configuration and Jenkins API token
* `User configuration phase is complete` - ensures Jenkins restore, backup and seed jobs along with user configuration

> Details about base and user phase can be found [here](https://jenkinsci.github.io/kubernetes-operator/docs/how-it-works/architecture-and-design/).

Expand Down Expand Up @@ -209,7 +209,7 @@ seed-job-agent-jenkins-example-758cc7cc5c-82hbl 1/1 Running 0

Install Docker Desktop. If you are using Docker Desktop for Windows, you will also need to install WSL or WSL2. Ensure that Docker Desktop is currently running, and that you have enabled Kubernetes in it.

Run **Jenkins Operator** locally.
Run **Jenkins Operator** locally.
```bash
make config="config.docker-desktop.env" run
```
Expand Down Expand Up @@ -250,7 +250,7 @@ kubectl --context remote-k8s --namespace default get po

## Testing

Tests are written using [Ginkgo](https://onsi.github.io/ginkgo/) with [Gomega](https://onsi.github.io/gomega/).
Tests are written using [Ginkgo](https://onsi.github.io/ginkgo/) with [Gomega](https://onsi.github.io/gomega/).

Run unit tests with go fmt, lint, staticcheck, vet:

Expand Down Expand Up @@ -285,6 +285,15 @@ Run the specific e2e test:
make e2e E2E_TEST_SELECTOR='^TestConfiguration$'
```

### Running Bats tests

Run bats tests in a `kind` cluster:

```bash
make kind-setup
make bats-tests
```

### Building docker image on minikube

To be able to work with the docker daemon on `minikube` machine run the following command before building an image:
Expand Down
2 changes: 1 addition & 1 deletion website/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
#
rm -rf public/
HUGO_ENV="production" hugo --gc || exit 1
s3deploy -source=public/ -region=eu-west-1 -bucket=bep.is -distribution-id=E8OKNT7W9ZYZ2 -path temp/td
#s3deploy -source=public/ -region=eu-west-1 -bucket=bep.is -distribution-id=E8OKNT7W9ZYZ2 -path temp/td
1 change: 0 additions & 1 deletion website/themes/docsy/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
{{ partialCached "favicons.html" . }}
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/google_news.html" . -}}
{{- template "_internal/schema.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{ if eq (getenv "HUGO_ENV") "production" }}
Expand Down
2 changes: 1 addition & 1 deletion website/themes/docsy/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
command = "git submodule update -f --init && cd userguide && npm install postcss-cli && hugo --themesDir ../.."

[build.environment]
HUGO_VERSION = "0.55.6"
HUGO_VERSION = "0.118.1"
HUGO_THEME = "repo"
NODE_VERSION = "12.2.0"