Skip to content

Commit d10ee2d

Browse files
authored
Add ability to view documentation by version (#2628)
**What this PR does / why we need it**: ![Screen Shot 2021-10-13 at 13 54 47](https://user-images.githubusercontent.com/1751755/137069823-dc10f77a-5447-487e-bc9c-68b9fd030233.png) Which files should be reviewed? - docs/config.toml - docs/assets/js/navbar-version-selector.js - https://github.com/pipe-cd/pipe/blob/7fdbcd88298d9026e41c980e9c43a68287cd16d5/hack/prepare-release.sh#L39-L77 **Which issue(s) this PR fixes**: Fixes # **Does this PR introduce a user-facing change?**: <!-- If no, just write "NONE" in the release-note block below. --> ```release-note NONE ``` This PR was merged by Kapetanios.
1 parent db38c1c commit d10ee2d

File tree

144 files changed

+10031
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+10031
-8
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(function ($) {
2+
'use strict';
3+
4+
var Selector = {
5+
init: function () {
6+
$(document).ready(function () {
7+
const paths = window.location.pathname.split("/").filter(p => p)
8+
if (paths.length === 0) {
9+
return
10+
}
11+
const version = paths[0].replace('docs', '').replace("-", '');
12+
if (version) {
13+
$('.navbar-version-menu')[0].text = version;
14+
};
15+
});
16+
},
17+
};
18+
19+
Selector.init();
20+
}(jQuery));

docs/config.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ privacy_policy = "https://github.com/pipe-cd/pipe/blob/master/LICENSE"
8686

8787
# Menu title if your navbar has a versions selector to access old versions of your site.
8888
# This menu appears only if you have at least one [params.versions] set.
89-
version_menu = "Releases"
89+
version_menu = ""
9090

9191
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
9292
github_repo = "https://github.com/pipe-cd/pipe"
@@ -159,3 +159,13 @@ no = 'Sorry to hear that. Please <a href="https://github.com/pipe-cd/pipe/issues
159159
url = "mailto:pipecd.dev@gmail.com"
160160
icon = "fa fa-envelope"
161161
desc = "Discuss development issues around the project"
162+
163+
# Append the release versions here.
164+
[[params.versions]]
165+
version = "dev"
166+
githubbranch = "master"
167+
url = "/docs-dev/"
168+
169+
[[params.versions]]
170+
version = "v0.18.0"
171+
url = "/docs-v0.18.0/"

docs/content/en/docs-dev/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "Welcome to PipeCD"
3+
linkTitle: "Documentation [dev]"
4+
type: docs
5+
---
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: "Concepts"
3+
linkTitle: "Concepts"
4+
weight: 2
5+
description: >
6+
This page describes several core concepts in PipeCD.
7+
---
8+
9+
### Piped
10+
11+
`piped` (the ’d’ is short for ’daemon’) is a single binary component you run in your cluster, your local network to handle the deployment tasks.
12+
It can be run inside a Kubernetes cluster by simply starting a Pod or a Deployment.
13+
This component is designed to be stateless, so it can also be run in a single VM or even your local machine.
14+
15+
### Control Plane
16+
17+
A centralized component managing deployment data and provides gPRC API for connecting `piped`s as well as all web-functionalities of PipeCD such as
18+
authentication, showing deployment list/details, application list/details, delivery insights...
19+
20+
### Project
21+
22+
A project is a logical group of applications to be managed by a group of users.
23+
Each project can have multiple `piped` instances from different clouds or environments.
24+
25+
There are three types of project roles:
26+
27+
- **Viewer** has only permissions of viewing to deployment and application in the project.
28+
- **Editor** has all viewer permissions, plus permissions for actions that modify state such as manually trigger/cancel the deployment.
29+
- **Admin** has all editor permissions, plus permissions for managing project data, managing project `piped`.
30+
31+
### Application
32+
33+
A collect of resources (containers, services, infrastructure components...) and configurations that are managed together.
34+
PipeCD supports multiple kinds of applications such as `KUBERNETES`, `TERRAFORM`, `ECS`, `CLOUDRUN`, `LAMBDA`...
35+
36+
### Environment
37+
38+
An environment is a logical group of applications of a project. A project can have multiple environments.
39+
Each application must belong to one and only one environment. While each piped must belong to at least one environment.
40+
41+
### Deployment
42+
43+
A deployment is a process that does transition from the current state (running state) to the desired state (specified state in Git) of a specific application.
44+
When the deployment is success, it means the running state is synced with the desired state specified in the target commit.
45+
46+
### Deployment Configuration
47+
48+
A `.pipe.yaml` yaml file that contains configuration data to define how to deploy the application.
49+
Each application requires one deployment configuration file at application directory in the Git repository.
50+
51+
### Application Directory
52+
53+
A directory in Git repository containing deployment configuration file (`.pipe.yaml`) and application manifests.
54+
Each application must have one application directory.
55+
56+
### Quick Sync
57+
58+
Quick sync is a fast way to sync application to the state specified in a Git commit without any progressive strategy or manual approving. Its pipeline contains just only one predefined `SYNC` stage. For examples:
59+
- quick sync a Kubernetes application is just applying all manifests
60+
- quick sync a Terraform application is automatically applying all detected changes
61+
- quick sync a CloudRun/Lambda application is rolling out the new version and routing all traffic to it
62+
63+
### Pipeline
64+
65+
A list of stages specified by user in the deployment configuration file that tells `piped` how the application should be deployed. If the pipeline is not specified, the application will be deployed by Quick Sync way.
66+
67+
### Stage
68+
69+
A temporary middle state between current state and desired state of a deployment process.
70+
71+
### Cloud Provider
72+
73+
PipeCD supports multiple clouds and multiple kinds of applications.
74+
Cloud Provider defines which cloud and where application should be deployed to.
75+
76+
Currently, PipeCD is supporting these five cloud providers: `KUBERNETES`, `ECS`, `TERRAFORM`, `CLOUDRUN`, `LAMBDA`.
77+
78+
### Analysis Provider
79+
An external product that provides metrics/logs to evaluate deployments, such as `Prometheus`, `Datadog`, `Stackdriver`, `CloudWatch` and so on.
80+
It is mainly used in the [Automated deployment analysis](/docs/user-guide/automated-deployment-analysis/) context.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Contributor Guide"
3+
linkTitle: "Contributor Guide"
4+
weight: 6
5+
description: >
6+
This guide is for anyone who want to contribute to PipeCD project. We are so excited to have you!
7+
---
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: "Architectural overview"
3+
linkTitle: "Architectural overview"
4+
weight: 3
5+
description: >
6+
This page describes the architecture of PipeCD.
7+
---
8+
9+
![](/images/architecture-overview.png)
10+
<p style="text-align: center;">
11+
Component Architecture
12+
</p>
13+
14+
### Piped
15+
16+
A single binary component runs in your cluster, your local network to handle the deployment tasks.
17+
It can be run inside a Kubernetes cluster by simply starting a Pod or a Deployment.
18+
This component is designed to be stateless, so it can also be run in a single VM or even your local machine.
19+
20+
### Control Plane
21+
22+
A centralized component manages deployment data and provides gPRC API for connecting `piped`s as well as all web-functionalities of PipeCD such as
23+
authentication, showing deployment list/details, application list/details, delivery insights...
24+
25+
Control Plane contains the following components:
26+
- `server`: a service to provide api for piped, web and serve static assets for web.
27+
- `cache`: a redis cache service for caching internal data.
28+
- `datastore`: data storage for storing deployment, application data
29+
- this can be a fully-managed service such as `Firestore`, `Cloud SQL`...
30+
- or a self-managed such as `MySQL`
31+
- `filestore`: file storage for storing logs, application states
32+
- this can a fully-managed service such as `GCS`, `S3`...
33+
- or a self-managed service such as `Minio`
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: "Contributing"
3+
linkTitle: "Contributing"
4+
weight: 1
5+
description: >
6+
This page describes how to contribute to PipeCD.
7+
---
8+
9+
PipeCD is an open source project that anyone in the community can use, improve, and enjoy. We'd love you to join us!
10+
11+
## Contributor License Agreement
12+
13+
Contributions to this project must be accompanied by a Contributor License Agreement ("CLA") described at [pipe-cd/pipe/master/CLA.md](https://github.com/pipe-cd/pipe/blob/master/CLA.md). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.
14+
15+
You generally only need to sign a CLA once, so if you've already signed one, you probably don't need to do it again.
16+
17+
In case you have not signed yet, [pipecd-bot](https://github.com/pipecd-bot) will guide you to sign the CLA _when you send the first pull request to [pipe-cd/pipe](https://github.com/pipe-cd/pipe) repository_.
18+
19+
## Creating an issue
20+
21+
If you've found a problem, please create an issue in the [pipe-cd/pipe](https://github.com/pipe-cd/pipe/issues) repository.
22+
23+
## Creating a pull request
24+
25+
Look at our [help wanted issues](https://github.com/pipe-cd/pipe/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted") or our [good first issues](https://github.com/pipe-cd/pipe/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue") for finding some good issues for your first pull request.
26+
27+
### Small tips
28+
29+
The pull request title is used to generate our release changelog. Therefore, it would be great if you write the title that is easier to understand from the user's point of view.
30+
31+
## Code reviews
32+
33+
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) for more information on using pull requests.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: "Control plane development"
3+
linkTitle: "Control plane development"
4+
weight: 5
5+
description: >
6+
This page describes where to find control-plane source code and how to run it locally for debugging.
7+
---
8+
9+
## Source code structure
10+
11+
- [cmd/pipecd](https://github.com/pipe-cd/pipe/tree/master/cmd/pipecd): entrypoint for binary of control-plane server.
12+
- [pkg/app/api](https://github.com/pipe-cd/pipe/tree/master/pkg/app/api): contains source code for control-plane api.
13+
- [pkg/app/web](https://github.com/pipe-cd/pipe/tree/master/pkg/app/web): contains source code for control-plane web.
14+
- [pkg](https://github.com/pipe-cd/pipe/tree/master/pkg): contains shared source code for all components of both `piped` and `control-plane`.
15+
16+
## How to run control-plane locally
17+
18+
### Prerequisites
19+
- Installing [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
20+
- Running a local Kubernetes cluster by `make kind-up`. (Cluster that is no longer used can be deleted by `make kind-down`.)
21+
22+
### Pushing the images to local container registry
23+
24+
``` console
25+
make push
26+
```
27+
28+
**NOTE: Since it uses the commit hash as an image tag, you need to make a new commit whenever you change the source code.**
29+
30+
This command compiles the local source code to build the docker images for `pipecd`, `piped` and then pushes them to the local container registery which was enabled by `make kind-up`.
31+
32+
### Rendering the local manifests
33+
34+
Because the `manifests` directory at [pipe-cd/pipe](https://github.com/pipe-cd/pipe) are just containing the manifest templates, they cannot be used to install directly. The following command helps rendering those templates locally. The installable manifests will be stored at `.rendered-manifests` directory.
35+
36+
``` console
37+
make render-manifests
38+
```
39+
40+
#### Installing control-plane into the local cluster
41+
42+
Now, you can use the rendered manifests at `.rendered-manifests` to install control-plane to the local cluster.
43+
44+
Here is the command to install [quickstart](/docs/quickstart/)'s control-plane:
45+
46+
``` console
47+
helm -n pipecd install pipecd .rendered-manifests/pipecd --dependency-update --create-namespace --values ./quickstart/control-plane-values.yaml
48+
```
49+
50+
Once all components are running up, use `kubectl port-forward` to expose the installed control-plane on your localhost:
51+
52+
``` console
53+
kubectl -n pipecd port-forward svc/pipecd 8080
54+
```
55+
56+
Point your web browser to [http://localhost:8080](http://localhost:8080) to login with the configured static admin account: project = `quickstart`,
57+
username = `hello-pipecd`, password = `hello-pipecd`.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "Development"
3+
linkTitle: "Development"
4+
weight: 2
5+
description: >
6+
This page describes how to build, test PipeCD source code at your local environment.
7+
---
8+
9+
## Prerequisites
10+
11+
Only `bazel` is required to build and test `PipeCD` project, but you don't need to install `bazel` directly.
12+
Instead of that we are using [`bazelisk`](https://github.com/bazelbuild/bazelisk) for automatically picking a good version of Bazel for building `PipeCD` project.
13+
14+
You can install `bazelisk` by `go get` as the following:
15+
```
16+
go get github.com/bazelbuild/bazelisk
17+
```
18+
19+
or directly install its [binary](https://github.com/bazelbuild/bazelisk/releases) from the release page.
20+
For more information, you might want to read the [installation notes of `bazelisk`](https://github.com/bazelbuild/bazelisk#requirements).
21+
22+
## Repositories
23+
- [pipe](https://github.com/pipe-cd/pipe): contains all source code and documentation of PipeCD project.
24+
- [manifests](https://github.com/pipe-cd/manifests): contains all automatically generated release manifests for both `piped` and `control-plane` components.
25+
- [examples](https://github.com/pipe-cd/examples): contains various generated examples to demonstrate how to use PipeCD.
26+
27+
## Build and test with Bazel
28+
29+
- `make build`: builds all binaries in tree.
30+
- `make test`: runs all unit tests.
31+
- `make dep`: updates `go.mod` and bazel `WORKSPACE`. Run this command after adding a new go dependency or update the version of a dependency.
32+
- `make gazelle`: generates `BUILD.bazel` files for go code. Run this command after adding a new `import` in go code or adding a new go file.
33+
- `make buildifier`: formats bazel BUILD and .bzl files with a standard convention.
34+
- `make clean`: cleans all bazel cache.
35+
- `make expose-generated-go`: exposes generated Go files (`.pb.go`, `.mock.go`...) to editors and IDEs.
36+
- `make site`: runs PipeCD site (https://pipecd.dev) locally (requires [hugo](https://github.com/gohugoio/hugo) with `_extended` version `0.88.1` or later to be installed).
37+
38+
**NOTE**: The first time of running a bazel command will take some minutes because bazel needs to download all required dependencies. From the second time it will be very fast.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: "Piped development"
3+
linkTitle: "Piped development"
4+
weight: 4
5+
description: >
6+
This page describes where to find piped source code and how to run it locally for debugging.
7+
---
8+
9+
## Source code structure
10+
11+
- [pkg/app/piped](https://github.com/pipe-cd/pipe/tree/master/pkg/app/piped): contains source code for only `piped`.
12+
- [cmd/piped](https://github.com/pipe-cd/pipe/tree/master/cmd/piped): entrypoint for `piped` binary.
13+
- [pkg](https://github.com/pipe-cd/pipe/tree/master/pkg): contains shared source code for all components of both `piped` and `control-plane`.
14+
15+
## How to run it locally
16+
17+
1. Prepare the piped configuration file `piped-config.yaml`
18+
19+
2. Ensure that your `kube-context` is connecting to the right kubernetes cluster
20+
21+
2. Run the following command to start running `piped`
22+
23+
``` console
24+
bazelisk run --run_under="cd $PWD && " //cmd/piped:piped -- piped \
25+
--tools-dir=/tmp/piped-bin \
26+
--config-file=piped-config.yaml
27+
```
28+
29+
## How to run it locally as docker container
30+
31+
``` bash
32+
# Compile the current source code to build a new Docker image
33+
# and then load it into the local docker client as bazel/cmd/piped:image.
34+
make load-piped-image
35+
36+
docker run bazel/cmd/piped:image --help
37+
```

0 commit comments

Comments
 (0)