Skip to content

Commit edddabf

Browse files
doc-site: core-concept and life-cycle explanation (#401)
* doc-site: core-concept and life-cycle explanation * Update doc-site/docs/concepts/project-life-cycle.md Co-authored-by: Bill Monkman <[email protected]> * Update doc-site/docs/concepts/core-concepts.md Co-authored-by: Bill Monkman <[email protected]> * fixup! Update doc-site/docs/concepts/core-concepts.md Co-authored-by: Bill Monkman <[email protected]>
1 parent de0f78d commit edddabf

File tree

5 files changed

+44
-13
lines changed

5 files changed

+44
-13
lines changed

doc-site/docs/about/overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ Security: Properly configured access-control to resources/security groups, using
7070
[real-world-usage]: ./real-world-usage
7171
[technology-choices]: ./technology-choices
7272
[learning-resources]: ../reference/learning-resources
73-
[docs-infra]: /docs/modules/aws-eks-stack/
74-
[docs-backend-go]: /docs/modules/backend-go/
75-
[docs-backend-nodejs]: /docs/modules/backend-nodejs/
76-
[docs-frontend-react]: /docs/modules/frontend-react/
73+
[docs-infra]: https://getzero.dev/docs/modules/aws-eks-stack/
74+
[docs-backend-go]: https://getzero.dev/docs/modules/backend-go/
75+
[docs-backend-nodejs]: https://getzero.dev/docs/modules/backend-nodejs/
76+
[docs-frontend-react]: https://getzero.dev/docs/modules/frontend-react/
7777
<!-- links -->
7878

7979

doc-site/docs/concepts/core-concepts.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@ title: Core Concepts
33
sidebar_label: Core Concepts
44
sidebar_position: 1
55
---
6+
7+
## Project
8+
A project defines a set of **modules** to use, along with a full set of config parameters for each module which were entered by the user during the `zero init` step. These config options are stored in `zero-project.yml`.
9+
10+
The project manifest (`zero-project.yml`) is the source of truth for the commands `create` and `apply`. It determines from where to fetch the modules, the execution order of modules, whether it will push your project to version control, module configuration, and other project information. Both staging and production environments are provisioned using the same manifest to ensure the environments are reproducible and controlled.
11+
12+
## Module
13+
A module is a useful bundle of code and/or resources that can be templated out during the `create` step, then executes a provisioning flow. This could be templating out terraform infrastructure as code then provisioning the resources, or creating a backend application, making API calls to set up a build pipeline, and then deploying it.
14+
15+
A module is defined by the **module manifest** (`zero-module.yml`) in its root folder. It contains all the parameters required to render the templated files (during `zero create`) and execute any provisioning steps, and declares it's requirements and the commands to execute during provisioning (`zero apply`).
16+
17+
Modules can declare their dependencies, for example a backend that will be deployed can declare its dependency on the infrastructure repository so that the infrastructure will already exist by the time we want to deploy to it.

doc-site/docs/concepts/module-life-cycle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

doc-site/docs/concepts/project-life-cycle.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,27 @@ title: Project Life Cycle
33
sidebar_label: Project Life Cycle
44
sidebar_position: 2
55
---
6+
7+
## zero init
8+
The goal of the `init` step is to create the project manifest (`zero-project.yml`).
9+
10+
`zero init` will fetch each **module** defined in `zero-project.yml` from their remote repository, and prompt the user through a series of questions to fill in parameters required by each module. In this phase, the module definition will be parsed and provide defaults, options, and extra context to guide users through filling in their project details.
11+
12+
:::note
13+
It's recommended to review the `zero-project.yml` and make adjustments as needed before running `zero create` and `zero apply`.
14+
:::
15+
16+
## zero create
17+
`zero create` is run in the same folder as `zero-project.yml`. It will template out each module specified in the project manifest as the basis of your repositories, then push them to your version control repository (Github).
18+
19+
During the `create` step, Zero will also conditionally include or exclude certain sets of files, as defined by each module. For example, it will not scaffold the authentication examples if you opted not to use this feature.
20+
21+
## zero apply
22+
`zero apply` is the provisioning step that starts to make real-world changes. By default, it runs a command defined by the module to check for any dependencies, and then runs a command to actually apply any changes.
23+
24+
### Check
25+
`check` is run for all the modules in your project before attempting to do the `run` step, so if a dependent's `check` fails it will not start the actual provisioning for any of the modules. This is useful to check for missing binaries or API token permissions before starting to apply any changes.
26+
27+
### Apply
28+
By default, the run step is to execute `make` in the root of the module, but that can be overridden in the module definition. Run should be the one-time setup commands that allow the module to function.
29+
For example, in the infrastructure repository, this would be to **run terraform**, and for the backend repository, this could be to **make API calls to CircleCI to set up your build pipeline**.

doc-site/sidebars.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ module.exports = {
1212
type: 'autogenerated',
1313
dirName: 'getting-started',
1414
}],
15-
"Reference": [{
16-
type: 'autogenerated',
17-
dirName: 'reference',
18-
}],
1915
"Concepts": [{
2016
type: 'autogenerated',
2117
dirName: 'concepts',
2218
}],
19+
"Reference": [{
20+
type: 'autogenerated',
21+
dirName: 'reference',
22+
}],
2323
},
2424
sidebarsNavModules(config),
2525
]

0 commit comments

Comments
 (0)