From ed0099c40dfcb230bf5f05c7ee794404738e7e86 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Wed, 14 Dec 2022 22:21:48 +0000 Subject: [PATCH] docs: some more minor fixes to ci Signed-off-by: Ramkumar Chinchani --- .github/workflows/ci.yml | 11 +-------- .github/workflows/commit-msg.yaml | 38 +++++++++++++++++++++++++++++++ .github/workflows/dco.yml | 24 +++++++++++++++++++ docs/reference/stacker_file.md | 22 +++++++++--------- material/overrides/home.html | 1 + material/overrides/main.html | 9 ++++++++ 6 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/commit-msg.yaml create mode 100644 .github/workflows/dco.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8460f50..afcb1e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,16 +35,7 @@ jobs: - name: Install Python dependencies run: | - pip install \ - "pillow<10" \ - "cairosvg>=2.5" \ - "mkdocs-material" \ - "mkdocs-material-extensions" \ - "mkdocs-git-committers-plugin-2>=1.1.1" \ - "mkdocs-git-revision-date-localized-plugin>=1.0" \ - "mkdocs-minify-plugin>=0.3" \ - "mkdocs-rss-plugin>=1.2" \ - "mkdocs-redirects>=1.0" + pip install -r requirements.txt - name: Build Docs run: | diff --git a/.github/workflows/commit-msg.yaml b/.github/workflows/commit-msg.yaml new file mode 100644 index 0000000..2dda471 --- /dev/null +++ b/.github/workflows/commit-msg.yaml @@ -0,0 +1,38 @@ +name: 'Check commit message style' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + push: + branches: + - main + +jobs: + check-commit-message-style: + name: Check commit message style + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Check Commit Type + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?(!)?(: (.*\s*)*))' + flags: 'gm' + error: 'Your first line has to the Conventional Commits specification.' + excludeDescription: 'true' # optional: this excludes the description body of a pull request + excludeTitle: 'true' # optional: this excludes the title of a pull request + checkAllCommitMessages: 'true' + accessToken: ${{ secrets.GITHUB_TOKEN }} + - name: Check Line Length + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^[^#].{1,74}' + error: 'The maximum line length of 74 characters is exceeded.' + excludeDescription: 'true' # optional: this excludes the description body of a pull request + excludeTitle: 'true' # optional: this excludes the title of a pull request + checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request + accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml new file mode 100644 index 0000000..5123a88 --- /dev/null +++ b/.github/workflows/dco.yml @@ -0,0 +1,24 @@ +# .github/workflows/dco.yml +name: DCO +on: + pull_request: + branches: + - main + +permissions: read-all + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.x + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Check DCO + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip3 install -U dco-check + dco-check diff --git a/docs/reference/stacker_file.md b/docs/reference/stacker_file.md index 11d69e7..965555f 100644 --- a/docs/reference/stacker_file.md +++ b/docs/reference/stacker_file.md @@ -36,7 +36,7 @@ available for reference: run: echo "Your layer is ${STACKER_LAYER_NAME}" ``` -#### `from` +### `from` The `from` directive describes the base image that stacker will start from. It takes the form: @@ -61,7 +61,7 @@ Hub. `built`: `tag` is required, everything else is ignored. `built` bases this layer on a previously specified layer in the stacker file. -#### `import` +### `import` The `import` directive describes what files should be made available in `/stacker` during the `run` phase. There are three forms of importing supported @@ -128,7 +128,7 @@ to be available under container's /usr/local/ and all the files/dirs from the ho /path/to/directory2 to be available under container's / -#### `environment`, `labels`, `working_dir`, `volumes`, `cmd`, `entrypoint`, `user` +### `environment`, `labels`, `working_dir`, `volumes`, `cmd`, `entrypoint`, `user` These all correspond exactly to the similarly named bits in the [OCI image config @@ -136,7 +136,7 @@ spec](https://github.com/opencontainers/image-spec/blob/master/config.md#propert and are available for users to pass things through to the runtime environment of the image. -#### `generate_labels` +### `generate_labels` The `generate_labels` entry is similar to `run` in that it contains a list of commands to run inside the generated rootfs. It runs after the `run` section is @@ -145,7 +145,7 @@ done, and its mutations to the filesystem are not recorded, except in one case file, and the name of the file will be the OCI label name, and the content will be the label content. -#### `build_env` and `build_env_passthrough` +### `build_env` and `build_env_passthrough` By default, environment variables do not pass through (pollute) the build environment. @@ -164,21 +164,21 @@ https_proxy, ftp_proxy`. Values in the `build_env` override values passed through via -#### `full_command` +### `full_command` Because of the odd behavior of `cmd` and `entrypoint` (and the inherited nature of these from previous stacker layers), `full_command` provides a way to set the full command that will be executed in the image, clearing out any previous `cmd` and `entrypoint` values that were set in the image. -#### `build_only` +### `build_only` `build_only`: indicates whether or not to include this layer in the final OCI image. This can be useful in conjunction with an import from this layer in another image, if you want to isolate the build environment for a binary but not include all of its build dependencies. -#### `binds` +### `binds` `binds`: specifies bind mounts from the host to the container. There are two formats: @@ -193,7 +193,7 @@ Right now there is no awareness of change for any of these bind mounts, so --no-cache should be used to re-build if the content of the bind mount has changed. -#### `config` +### `config` `config` key is a special type of entry in the root in the `stacker.yaml` file. It cannot contain a layer definition, it is used to provide configuration @@ -204,7 +204,7 @@ applicable for building all the layers defined in this file. For example, - ../folder2/stacker.yaml - ../folder3/stacker.yaml -##### `prerequisites` +#### `prerequisites` If the `prerequisites` list is present under the `config` key, stacker will make sure to build all the layers in the stacker.yaml files found at the paths @@ -219,7 +219,7 @@ When `stacker build -f parent/folder1/stacker.yaml` is invoked, stacker would se for the other two stacker.yaml files and build them first, before building the stacker.yaml specified in the command line. -##### `annotations` +#### `annotations` `annotations` is a user-specified key value map that will be included in the final OCI image. Note that these annotations are included in the image manifest diff --git a/material/overrides/home.html b/material/overrides/home.html index f985511..fb8e3c1 100644 --- a/material/overrides/home.html +++ b/material/overrides/home.html @@ -17,6 +17,7 @@

Stacker Build

User Guide +

Pair this with zot, an OCI-native Image Registry

diff --git a/material/overrides/main.html b/material/overrides/main.html index db23bb5..df25182 100644 --- a/material/overrides/main.html +++ b/material/overrides/main.html @@ -23,6 +23,7 @@ + {% endblock %} {% block announce %} @@ -63,3 +64,11 @@ {{ super() }} {% endblock %} +{% block outdated %} + You're not viewing the latest version. + + + + Click here to go to latest. + +{% endblock %}