Skip to content

Commit

Permalink
Migrate docs site (#1219)
Browse files Browse the repository at this point in the history
Move zarf-docs website into the zarf repository
  • Loading branch information
bdfinst authored Jan 27, 2023
1 parent 99933f0 commit edde791
Show file tree
Hide file tree
Showing 71 changed files with 27,962 additions and 106 deletions.
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Continuous Delivery is core to our development philosophy. Check out [https://mi

Specifically:

- We do trunk-based development (`main`) with short-lived feature branches that originate from the trunk, get merged to the trunk, and are deleted after the merge
- We do trunk-based development (`main`) with short-lived feature branches that originate from the trunk, get merged into the trunk, and are deleted after the merge
- We don't merge code into `main` that isn't releasable
- We perform automated testing on all changes before they get merged to `main`
- We create immutable release artifacts
Expand All @@ -23,15 +23,15 @@ Specifically:

1. :key: Set up your Git config to GPG sign all commits. [Here's some documentation on how to set it up](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). You won't be able to merge your PR if you have any unverified commits.

1. Create a Draft Pull Request as soon as you are able to, even if it is just 5 minutes after you started working on it. We lean towards working in the open as much as we can. If you're not sure what to put in the PR description, just put a link to the issue you're working on. If you're not sure what to put in the PR title, just put "WIP" (Work In Progress) and we'll help you out with the rest.
1. Create a Draft Pull Request as soon as you can, even if it is just 5 minutes after you started working on it. We lean towards working in the open as much as we can. If you're not sure what to put in the PR description, just put a link to the issue you're working on. If you're not sure what to put in the PR title, just put "WIP" (Work In Progress) and we'll help you out with the rest.

1. :key: Automated tests will begin based on the paths you have edited in your Pull Request. More information on these tests can be found [here](https://docs.zarf.dev/docs/developer-guide/testing).

> ⚠️ **NOTE:** _If you are an external third-party contributor, the pipelines won't run until a [CODEOWNER](https://github.com/defenseunicorns/zarf/blob/main/CODEOWNERS) approves the pipeline run._
1. :key: Be sure to use the [needs-adr,needs-docs,needs-tests](https://github.com/defenseunicorns/zarf/labels?q=needs) labels as appropriate for the PR. Once you have addressed all of the needs, remove the label.

1. Once review is complete and approved, a core-member of the zarf project will merge your PR. If you are an external third-party contributor, two core-members of the zarf project will be required to approve the PR.
1. Once review is complete and approved, a core member of the zarf project will merge your PR. If you are an external third-party contributor, two core members of the zarf project will be required to approve the PR.

1. Close the issue if it is fully resolved by your PR. _Hint: You can add "Fixes #XX" to the PR description to automatically close an issue when the PR is merged._

Expand All @@ -41,16 +41,16 @@ This section dives deeper into how we test Zarf

### (Optional) Pre-Commit Hooks and Linting

In this repo you can optinally use [pre-commit](https://pre-commit.com/) hooks for automated validation and linting, but if not CI will run these checks for you.
In this repo you can optionally use [pre-commit](https://pre-commit.com/) hooks for automated validation and linting, but if not CI will run these checks for you.

### Code Testing

Our E2E tests can be found in the `/test` folder and follow the journey of someone as they would use the Zarf CLI. In CI these tests run against our currently supported cluster distros, and are the primary way that Zarf code is tested.
Our E2E tests can be found in the `/test` folder and follow the journey of someone as they would use the Zarf CLI. In CI these tests run against our currently supported cluster distros and are the primary way that Zarf code is tested.

Our Unit tests can be found as `*_test.go` files inside the package that they are designed to test. These are also run in CI and are designed to test small functions with clear interfaces that would be difficult to test otherwise. As a general rule, we are limiting unit tests to the `src/pkg/*` folder.

All of our tests should be able to be run locally or in CI.
You can learn more about testing of Zarf [here](https://docs.zarf.dev/docs/developer-guide/testing).
You can learn more about the testing of Zarf [here](https://docs.zarf.dev/docs/developer-guide/testing).

## Documentation

Expand All @@ -59,7 +59,7 @@ You can learn more about testing of Zarf [here](https://docs.zarf.dev/docs/devel
We've chosen to use ADRs to document architecturally significant decisions. We primarily use the guidance found in [this article by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions) with a couple of tweaks:

- The criteria for when an ADR is needed is undefined. The team will decide when the team needs an ADR.
- We will use the tool [adr-tools](https://github.com/npryce/adr-tools) to make it easier on ourselves to create and maintain ADRs.
- We will use the tool [adr-tools](https://github.com/npryce/adr-tools) to make it easier on us to create and maintain ADRs.
- We will keep ADRs in the repository under `docs/adr/NNNN-name-of-adr.md`. `adr-tools` is configured with a dotfile to automatically use this directory and format.

### How to use `adr-tools`
Expand All @@ -68,7 +68,7 @@ We've chosen to use ADRs to document architecturally significant decisions. We p
# Create a new ADR titled "Use Bisquick for all waffle making"
adr new Use Bisquick for all waffle making

# Create a new ADR that supersedes a previous one. Let's say for example that the previous ADR about Bisquick was ADR number 9.
# Create a new ADR that supersedes a previous one. Let's say, for example, that the previous ADR about Bisquick was ADR number 9.
adr new -s 9 Use scratch ingredients for all waffle making

# Create a new ADR that amends a previous one. Let's say the previous one was ADR number 15
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ ci-release: init-package
build-examples: ## Build all of the example packages
@test -s $(ZARF_BIN) || $(MAKE) build-cli

@test -s ./build/zarf-package-dos-games-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/game -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-dos-games-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/dos-games -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-component-actions-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/component-actions -o build -a $(ARCH) --confirm

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<img align="right" alt="zarf logo" src=".images/zarf-logo.png" height="256" />

Zarf eliminates the [complexity of air gap software delivery](https://www.itopstimes.com/contain/air-gap-kubernetes-considerations-for-running-cloud-native-applications-without-the-cloud/) for Kubernetes clusters and cloud native workloads using a declarative packaging strategy to support DevSecOps in offline and semi-connected environments.
Zarf eliminates the [complexity of air gap software delivery](https://www.itopstimes.com/contain/air-gap-kubernetes-considerations-for-running-cloud-native-applications-without-the-cloud/) for Kubernetes clusters and cloud-native workloads using a declarative packaging strategy to support DevSecOps in offline and semi-connected environments.

📦 Out of the Box Features

Expand All @@ -21,7 +21,7 @@ Zarf eliminates the [complexity of air gap software delivery](https://www.itopst
- Builtin git server with [Gitea](https://gitea.com/)
- Builtin docker registry
- Builtin [K9s Dashboard](https://k9scli.io/) for managing a cluster from the terminal
- [Mutating Webhook](adr/0005-mutating-webhook.md) to automatically update Kubernetes pods image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references
- [Mutating Webhook](adr/0005-mutating-webhook.md) to automatically update Kubernetes pod's image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references
- Builtin [command to find images](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_prepare_find-images) and resources from a helm chart
- Tunneling capability to [connect to Kuberenetes resources](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_connect) without network routing, DNS, TLS or Ingress configuration required

Expand All @@ -37,15 +37,15 @@ Zarf eliminates the [complexity of air gap software delivery](https://www.itopst

[![preview](.images/zarf-v0.21-preview.gif)](https://www.youtube.com/watch?v=WnOYlFVVKDE)

_https://www.youtube.com/watch?v=WnOYlFVVKDE_
_<https://www.youtube.com/watch?v=WnOYlFVVKDE>_

## Getting Started

To try Zarf out for yourself, visit the ["Try It Now"](https://zarf.dev/install) section on our website, and if you want to learn more about Zarf and its use cases visit [docs.zarf.dev](https://docs.zarf.dev/docs/zarf-overview).

From the docs you can learn more about [installation](https://docs.zarf.dev/docs/operator-manual/set-up-and-install), [using the CLI](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/), [making packages](https://docs.zarf.dev/docs/user-guide/zarf-packages/), and the [Zarf package schema](https://docs.zarf.dev/docs/user-guide/zarf-schema).

Using Zarf in Github workflows? Checkout the [setup-zarf](https://github.com/defenseunicorns/setup-zarf) action. Install any version of Zarf and it's `init` package with zero added dependencies.
Using Zarf in Github workflows? Check out the [setup-zarf](https://github.com/defenseunicorns/setup-zarf)](https://github.com/defenseunicorns/setup-zarf) action. Install any version of Zarf and its `init` package with zero added dependencies.

## Developing

Expand Down
10 changes: 10 additions & 0 deletions docs-website/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public
static
.cache
content
.history
dist
docs
_debug.js
_deploy.js
__mocks__
98 changes: 98 additions & 0 deletions docs-website/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"extends": [
"airbnb",
"prettier",
"react-app",
"react-app/jest",
"plugin:testing-library/react",
"plugin:jest-dom/recommended"
],
"plugins": [
"prettier",
"react-hooks",
"etc",
"jest",
"jest-dom",
"testing-library"
],
"overrides": [
{
"files": [
"**/*.js"
]
}
],
"env": {
"jest/globals": true
},
"ignorePatterns": [
"/build/**/*.js",
"cypress/*"
],
"rules": {
"semi": 0,
"etc/no-commented-out-code": "error",
"prettier/prettier": [
"error",
{
"semi": false,
"endOfLine": "auto"
}
],
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx"
]
}
],
"react/jsx-props-no-spreading": "off",
"react/prop-types": [
"error"
],
"no-underscore-dangle": 0,
"import/imports-first": [
"error",
"absolute-first"
],
"import/newline-after-import": "error",
"import/no-cycle": [
2,
{
"maxDepth": 1
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
"react-hooks/rules-of-hooks": "error", // Check rules of hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"react/forbid-prop-types": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"jest/no-mocks-import": "off"
},
"globals": {
"window": true,
"document": true,
"localStorage": true,
"FormData": true,
"FileReader": true,
"Blob": true,
"navigator": true
},
"settings": {
"import/resolver": {
"node": {
"paths": [
"src"
]
}
}
}
}
23 changes: 23 additions & 0 deletions docs-website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Code Editor
.vscode/settings.json
8 changes: 8 additions & 0 deletions docs-website/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public
static
.cache
.history
dist
coverage
docs/app
__mocks__
9 changes: 9 additions & 0 deletions docs-website/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80,
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid"
}
25 changes: 25 additions & 0 deletions docs-website/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": "stylelint-config-recommended-scss",
"rules": {
"color-named": "never",
"font-family-name-quotes": "always-where-required",
"font-weight-notation": "named-where-possible",
"function-url-no-scheme-relative": true,
"function-url-quotes": "always",
"string-quotes": "single",
"value-keyword-case": "lower",
"unit-blacklist": [],
"max-empty-lines": 2,
"no-descending-specificity": true,
"no-duplicate-selectors": true,
"font-family-no-missing-generic-family-keyword": null,
"property-no-unknown": [
true,
{
"ignoreProperties": ["/^lost-/"]
}
]
},
"ignoreFiles": ["node_modules/*", "src/assets/**"],
"defaultSeverity": "error"
}
77 changes: 77 additions & 0 deletions docs-website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Zarf - Docs Site

[![Zarf Slack Channel](https://img.shields.io/badge/k8s%20slack-zarf-40a3dd)](https://kubernetes.slack.com/archives/C03B6BJAUJ3)
[![Zarf Website](https://img.shields.io/badge/web-zarf.dev-6d87c3)](https://zarf.dev/)
[![Zarf Documentation](https://img.shields.io/badge/docs-docs.zarf.dev-775ba1)](https://docs.zarf.dev/)

This is the docs site for [Zarf](https://github.com/defenseunicorns/zarf), a declarative air gap solution for Kubernetes. This site is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator created by Facebook.

### Prerequisites

This site requires `nodejs` and `npm` so install it if you haven't already.

``` shell
# FOR LINUX (Ubuntu)
$ sudo apt update
$ sudo apt install nodejs
$ sudo apt install npm

# FOR MAC (Homebrew)
$ brew install nodejs
```

### Installation

To install required dependencies run the following:

``` shell
$ npm ci
```

### Updating Zarf `docs` Files

The markdown files for Zarf are held in the main Zarf repo and are pulled into this repo using a submodule. The current versions will be cloned as part of the `postinstall` script. To update the reference to those docs run the following command:

``` shell
$ git submodule update --remote --recursive main
```

To checkout a specific tag within the submodule you can do the following after updating:

``` shell
$ cd main
$ git checkout <tag>
$ cd ..
```

You may also find it useful to switch to a different branch for the submodule. You can do this by adding a `branch` to `.gitmodules`:

```
[submodule "main"]
path = main
url = https://github.com/defenseunicorns/zarf.git
branch = <your-branch-here>
```

### Running

There are two ways to run the site locally, the simplest being the following:

``` shell
$ npm run start
```

This will open a browser window that will let you see the built site.

> ⚠️ *Note, `npm run start` will not perform some link checking or build the search index.*
To perform a full build and to run it locally you should run the following:

``` shell
$ npm run build
$ npm run serve
```

### Deployment

To deploy the site, push your changes into a branch and open a PR. [Netlify](https://www.netlify.com/) will generate a preview for you and a PR approver to see your changes. Once the approver is happy with the changes they can approve and merge the PR and it will be pushed to production.
3 changes: 3 additions & 0 deletions docs-website/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Loading

0 comments on commit edde791

Please sign in to comment.