Skip to content

Commit

Permalink
Merge pull request #728 from werf/fix-docs-routing-2
Browse files Browse the repository at this point in the history
fix: docs routing /2
  • Loading branch information
ilya-lesikov authored May 13, 2024
2 parents a1bf9b3 + 267dcd7 commit 197e614
Show file tree
Hide file tree
Showing 68 changed files with 386 additions and 383 deletions.
8 changes: 4 additions & 4 deletions .helm/templates/20-ingress-tuf-router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ spec:
- host: {{ $host }}
http:
paths:
- path: /targets
- path: /targets/
pathType: Prefix
backend:
service:
name: tuf-router
port:
name: http
- path: /download
- path: /download/
pathType: Prefix
backend:
service:
Expand All @@ -36,14 +36,14 @@ spec:
- host: ru.{{ $host }}
http:
paths:
- path: /targets
- path: /targets/
pathType: Prefix
backend:
service:
name: tuf-router
port:
name: http
- path: /download
- path: /download/
pathType: Prefix
backend:
service:
Expand Down
437 changes: 218 additions & 219 deletions .helm/templates/_rewrites.tpl

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions .helm/trdl_channels-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ groups:
- name: "1.2"
channels:
- name: alpha
version: 1.2.3-dev
version: 1.2.294+fix1
- name: beta
version: 1.2.3-dev
version: 1.2.294+fix1
- name: ea
version: 1.2.3-dev
version: 1.2.294+fix1
- name: stable
version: 1.2.3-dev
version: 1.2.294+fix1
- name: rock-solid
version: 1.2.3-dev
version: 1.2.294+fix1
- name: "2"
channels:
- name: alpha
version: 2.0.3-dev
version: 2.0.3
- name: beta
version: 2.0.3-dev
version: 2.0.3
- name: ea
version: 2.0.3-dev
version: 2.0.3
- name: stable
version: 2.0.3-dev
version: 2.0.3
- name: rock-solid
version: 2.0.3-dev
version: 2.0.3
4 changes: 2 additions & 2 deletions .werf/nginx-dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ http {
proxy_pass http://website-$lang;
}

location /documentation/ {
rewrite ^/documentation/(?<ver>v\d+(?:\.\d+(?:\.\d+(?:-[^/]+)?)?)?)/(?<tail>.*) /$tail break;
location /docs/ {
rewrite ^/docs/(?<ver>v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/(?<tail>.*) /$tail break;

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ___

## Development

- Install [werf](http://werf.io/documentation/index.html).
- Install [werf](http://werf.io/docs/index.html).
- Install [task](https://taskfile.dev/installation/).

### Local development setup
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository contains files required to build the [werf CI/CD tool website](h
and run it locally.

It includes all of website pages with the only exception for the official
[werf documentation](https://werf.io/documentation/) which can be found
[werf documentation](https://werf.io/docs/) which can be found
in the [main werf](https://github.com/werf/werf/tree/main/docs) repo since it's
versioned and provided together with werf releases themselves (e.g. we have
the documentation for werf v1.2.51, v1.1.23, and so on).
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ site_urls:
ru: https://ru.werf.io
en: https://werf.io
editlink: "https://github.com/werf/website/edit/main"
canonical_url_prefix: /documentation/v2
canonical_url_prefix: /docs/v2

social_links:
ru:
Expand Down
2 changes: 1 addition & 1 deletion _data/en/topnav.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- title: Getting Started
url: /getting_started/
- title: Documentation
url: /documentation/v2/
url: /docs/v2/
- title: Kubernetes guide
url: /guides.html
hot: true
Expand Down
2 changes: 1 addition & 1 deletion _data/ru/topnav.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- title: Быстрый старт
url: /getting_started/
- title: Документация
url: /documentation/v2/
url: /docs/v2/
- title: Самоучитель по Kubernetes
url: /guides.html
hot: true
Expand Down
2 changes: 1 addition & 1 deletion _includes/_common/channel-menu-v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{- $prevVersion := "" }}
{{- range (slice .VersionItems 1) }}
<li class="submenu-item">
<a data-proofer-ignore class="submenu-item-link" href="/documentation/{{ .VersionURL }}{{ $CurrentPageURLRelative }}">
<a data-proofer-ignore class="submenu-item-link" href="/docs/{{ .VersionURL }}{{ $CurrentPageURLRelative }}">
{{- if eq .Version "latest" }}
<span class="submenu-item-channel">latest</span>
{{- else }}
Expand Down
2 changes: 1 addition & 1 deletion _includes/_common/channel-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{- $prevVersion := "" }}
{{- range (slice .VersionItems 1) }}
<li class="submenu-item">
<a data-proofer-ignore class="submenu-item-link" href="/documentation/{{ .VersionURL }}{{ $CurrentPageURLRelative }}">
<a data-proofer-ignore class="submenu-item-link" href="/docs/{{ .VersionURL }}{{ $CurrentPageURLRelative }}">
{{- if eq .Version "latest" }}
<span class="submenu-item-channel">latest</span>
<span class="submenu-item-dot{{ if eq $prevVersion .Version }} submenu-item-dot_special{{ end }}"></span>
Expand Down
2 changes: 1 addition & 1 deletion _includes/_common/group-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{- $prevVersion := "" }}
{{- range (slice .VersionItems 1) }}
<li class="submenu-item">
<a data-proofer-ignore class="submenu-item-link" href="/documentation/v{{ .Group }}{{ $CurrentPageURLRelative }}">
<a data-proofer-ignore class="submenu-item-link" href="/docs/v{{ .Group }}{{ $CurrentPageURLRelative }}">
v{{ .Group }}
</a>
</li>
Expand Down
5 changes: 3 additions & 2 deletions _includes/_common/topnav-documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
{%- if folder.folderitems %} header__menu-item_parent{% endif %}
{%- if folder.url.size>1 and page.url == folder.url %} header__menu-item_active{% endif %}
{%- if folder.url.size>1 and page.url != folder.url and page.url contains folder.url
and page.url != '/documentation/index.html' %} header__menu-item_active{% endif %}
and page.url != '/docs/index.html' %} header__menu-item_active{% endif %}
{%- if folder.title == 'Документация' or folder.title == 'Documentation' %} header__menu-item_active{% endif %}">
{%- if folder.title == 'Документация' or folder.title == 'Documentation' %}
{%- if page.name == '404.md' %}
{%- assign page_name = page.url | split: "/" | last %}
{%- if page_name == '404.html' %}
<a href="{{ folder.url }}">{{ folder.title }}</a>
{%- else %}
<a data-proofer-ignore href="{% raw %}{{ .MenuDocumentationLink }}{% endraw %}">{{ folder.title }}</a>
Expand Down
5 changes: 3 additions & 2 deletions _includes/_common/topnav.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
{% endif %}
{%- if folder.url.size>=1 and page.url == folder.url %} header__menu-item_active{% endif %}
{%- if folder.url.size>1 and page.url != folder.url and page.url contains folder.url
and page.url != '/documentation/index.html' %} header__menu-item_active{% endif %}">
and page.url != '/docs/index.html' %} header__menu-item_active{% endif %}">
{%- comment -%}
{%- if folder.url.size<2 and page.url.size<2 %} header__menu-item_active{% endif %}">
{%- endcomment -%}
{%- if folder.title == 'Документация' or folder.title == 'Documentation' %}
{%- if page.name == '404.md' %}
{%- assign page_name = page.url | split: "/" | last %}
{%- if page_name == '404.html' %}
<a data-proofer-ignore href="{{ folder.url }}">{{ folder.title }}</a>
{%- else %}
<a href="{{ folder.url }}">{{ folder.title }}</a>
Expand Down
2 changes: 1 addition & 1 deletion _includes/_common/version-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{- $prevVersion := "" }}
{{- range (slice .VersionItems 1) }}
<li class="submenu-item">
<a data-proofer-ignore class="submenu-item-link" href="/documentation/{{ .VersionURL }}{{ $CurrentPageURLRelative }}">
<a data-proofer-ignore class="submenu-item-link" href="/docs/{{ .VersionURL }}{{ $CurrentPageURLRelative }}">
<span class="submenu-item-channel"> {{ .Group }}-{{ .Channel }}</span>
<span class="submenu-item-dot{{ if eq $prevVersion .Version }} submenu-item-dot_special{{ end }}"></span>
<span class="submenu-item-release">{{ .Version }}</span>
Expand Down
8 changes: 4 additions & 4 deletions _includes/en/guides/100_basic/10_build.md.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Preliminary steps

Install werf and its dependencies using [this guide]({{ site.url }}/documentation/).
Install werf and its dependencies using [this guide]({{ site.url }}/docs/).

## Create a new repository with the application

Expand All @@ -20,7 +20,7 @@ The primary werf configuration file, `werf.yaml` (in the repository's root) spec

{% include snippetcut_example path="werf.yaml" syntax="yaml" examples=page.examples %}

The `werf.yaml` file can describe the assembly of multiple images at once. There are also some additional settings for building an image. You can learn more about them in the [documentation]({{ site.url }}/documentation/v2/reference/werf_yaml.html#dockerfile-image-section-image).
The `werf.yaml` file can describe the assembly of multiple images at once. There are also some additional settings for building an image. You can learn more about them in the [documentation]({{ site.url }}/docs/v2/reference/werf_yaml.html#dockerfile-image-section-image).

## Building using werf

Expand All @@ -30,7 +30,7 @@ Note that before starting the werf-based build/deploy process, you have to **add

We already did this in the "Creating a new application repository" section above. Normally, however, you have to run the `git add` and `git commit` commands.

Start the build using the [`werf build`]({{ site.url }}/documentation/v2/reference/cli/werf_build.html) command:
Start the build using the [`werf build`]({{ site.url }}/docs/v2/reference/cli/werf_build.html) command:

```shell
werf build
Expand Down Expand Up @@ -80,7 +80,7 @@ Running time 11.02 seconds

## Starting the application

You can run the container locally using the built image via the [werf run]({{ site.url }}/documentation/v2/reference/cli/werf_run.html) command:
You can run the container locally using the built image via the [werf run]({{ site.url }}/docs/v2/reference/cli/werf_run.html) command:

```shell
werf run app --docker-options="-ti --rm -p 8000:8000" -- /app/start.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Your cluster must have Nginx Ingress installed. If it is not installed, you can

### Registry

werf supports [many registry implementations]({{ site.url }}/documentation/v2/advanced/supported_registry_implementations.html).
werf supports [many registry implementations]({{ site.url }}/docs/v2/advanced/supported_registry_implementations.html).

Make sure that your cluster can connect to the registry over the network.

Expand Down
4 changes: 2 additions & 2 deletions _includes/en/guides/100_basic/30_deploy.md.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Deployment resource creates a set of resources for launching the application

Here, we insert the full name of the Docker image of our application using the template engine: {% raw %}`{{ .Values.werf.image.app }}`{% endraw %}. Note that you must use the component name specified in `werf.yaml` (`app` in our case) to access this value.

werf automatically adds full names of the images to build as well as other [service data]({{ site.url }}/documentation/v2/advanced/helm/configuration/values.html#service-values) to values of the Helm Chart (`.Values`). You can access them using the `werf` key.
werf automatically adds full names of the images to build as well as other [service data]({{ site.url }}/docs/v2/advanced/helm/configuration/values.html#service-values) to values of the Helm Chart (`.Values`). You can access them using the `werf` key.

werf only rebuilds images when the added files are changed (those used in the Dockerfile `COPY/ADD` instructions) or if `werf.yaml` itself is changed. The image tag will also change during a rebuild resulting in the Deployment update. If no changes were made to the files mentioned above, the werf would not rebuild the image. The Deployment and the resources it creates will not be redeployed because the latest version of the application is already running in the cluster.

Expand All @@ -28,7 +28,7 @@ The Ingress resource manages *external* access to the cluster (unlike a Service

> Note that you need to go back to the previous chapter and recreate the registry secret if you deleted the application namespace.

The [werf converge]({{ site.url }}/documentation/v2/reference/cli/werf_converge.html) command builds the application and deploys it to Kubernetes:
The [werf converge]({{ site.url }}/docs/v2/reference/cli/werf_converge.html) command builds the application and deploys it to Kubernetes:
```shell
werf converge --repo <DOCKER HUB USERNAME>/werf-guide-app
```
Expand Down
2 changes: 1 addition & 1 deletion _includes/en/guides/100_basic/35_deploy_changes.md.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ werf-guide-app-57f854484f-2xbzl 1/1 Running 0 119m
```
{% endofftopic %}

The number of replicas changed: now, it corresponds to that specified in the Git repository. It happened because werf brought the cluster state to the state described in the current Git commit. This principle is called [**giterminism**](https://en.werf.io/documentation/v2/advanced/giterminism.html).
The number of replicas changed: now, it corresponds to that specified in the Git repository. It happened because werf brought the cluster state to the state described in the current Git commit. This principle is called [**giterminism**](https://en.werf.io/docs/v2/advanced/giterminism.html).

So how do you comply with the principles of **giterminism** and do it all right? Let's set `spec.replicas=4`, but this time we'll do it by describing the application state in Git:

Expand Down
Loading

0 comments on commit 197e614

Please sign in to comment.