Skip to content

Commit

Permalink
Bump vendir docs
Browse files Browse the repository at this point in the history
Signed-off-by: Praveen Rewar <[email protected]>
  • Loading branch information
praveenrewar committed Oct 11, 2023
1 parent 3649ca8 commit 374af36
Show file tree
Hide file tree
Showing 19 changed files with 667 additions and 10 deletions.
5 changes: 3 additions & 2 deletions site/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,16 @@ params:
name: vendir
short_name: vendir
root_link: /vendir/
latest_docs_link: /vendir/docs/v0.34.x/
latest_docs_link: /vendir/docs/v0.35.x/
github_url: https://github.com/carvel-dev/vendir
search: true
search_index_name: carvel-vendir
search_api_key: a38560864c2e9128ae57d5734df438ff
versioning: true
version_latest: v0.34.x
version_latest: v0.35.x
versions:
- develop
- v0.35.x
- v0.34.x
- v0.33.x
- v0.32.0
Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/]

title: "About vendir"
toc: "false"
cascade:
Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/github-release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/github-release]

title: Github Release
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/install.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/install]

title: Install
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/security.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/security]

title: Security
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/sync.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/sync]

title: Sync command
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/vendir-lock-spec.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/vendir-lock-spec]

title: vendir.lock.yml spec
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/vendir-spec.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/vendir-spec]

title: vendir.yml spec
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/vendir/docs/v0.34.x/versions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/vendir/docs/latest/versions]

title: Versions
---

Expand Down
25 changes: 25 additions & 0 deletions site/content/vendir/docs/v0.35.x/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
aliases: [/vendir/docs/latest/]
title: "About vendir"
toc: "false"
cascade:
version: v0.35.x
toc: "true"
type: docs
layout: docs
---

vendir allows to declaratively state what should be in a directory. It was designed to easily manage libraries for [ytt](/ytt); however, it is a generic tool and does not care how files within managed directories are used.

Supported sources for fetching:

- git
- hg (Mercurial)
- http
- image (image from OCI registry)
- imgpkgBundle (bundle from OCI registry)
- githubRelease
- helmChart
- directory

Examples could be found in [carvel-vendir's `examples/` directory](https://github.com/vmware-tanzu/carvel-vendir/tree/develop/examples).
17 changes: 17 additions & 0 deletions site/content/vendir/docs/v0.35.x/github-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
aliases: [/vendir/docs/latest/github-release]
title: Github Release
---

vendir supports downloading software stored as a Github release. See [`vendir.yml` spec](vendir-spec.md) for how to configure.

## Github API Rate Limiting

If your public IP address is shared by multiple machines (e.g. workstations in an office), you may run into [Github rate limiting errors](https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting). vendir as of v0.8.0 supports providing "Personal access token" to increase Github API rate limits. You can specify it via an environment variable:

```bash
$ export VENDIR_GITHUB_API_TOKEN=ghp_8c0a3...
$ vendir sync
```

To obtain personal access token go to [Github.com: Settings / Developer Settings / Personal access tokens](https://github.com/settings/tokens). During token creation, you will be prompted for selection of scopes, and in most cases there is no need to select any scopes because this token only used to identify API usage. For organizations that enable SSO, you will need to "Enable SSO" for created token.
58 changes: 58 additions & 0 deletions site/content/vendir/docs/v0.35.x/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
aliases: [/vendir/docs/latest/install]
title: Install
---

## Via script (macOS or Linux)

(Note that `install.sh` script installs other Carvel tools as well.)

Install binaries into specific directory:

```bash
$ mkdir local-bin/
$ curl -L https://carvel.dev/install.sh | K14SIO_INSTALL_BIN_DIR=local-bin bash

$ export PATH=$PWD/local-bin/:$PATH
$ vendir version
```

Or system wide:

```bash
$ wget -O- https://carvel.dev/install.sh > install.sh

# Inspect install.sh before running...
$ sudo bash install.sh
$ vendir version
```

## Via Homebrew (macOS or Linux)

Based on [github.com/vmware-tanzu/homebrew-carvel](https://github.com/vmware-tanzu/homebrew-carvel).

```bash
$ brew tap vmware-tanzu/carvel
$ brew install vendir
$ vendir version
```

## Specific version from a GitHub release

To download, click on one of the assets in a [chosen GitHub release](https://github.com/vmware-tanzu/carvel-vendir/releases), for example for 'vendir-darwin-amd64'.

```bash
# **Compare binary checksum** against what's specified in the release notes
# (if checksums do not match, binary was not successfully downloaded)
$ shasum -a 256 ~/Downloads/vendir-darwin-amd64
08b25d21675fdc77d4281c9bb74b5b36710cc091f30552830604459512f5744c /Users/pivotal/Downloads/vendir-darwin-amd64

# Move binary next to your other executables
$ mv ~/Downloads/vendir-darwin-amd64 /usr/local/bin/vendir

# Make binary executable
$ chmod +x /usr/local/bin/vendir

# Check its version
$ vendir version
```
8 changes: 8 additions & 0 deletions site/content/vendir/docs/v0.35.x/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
aliases: [/vendir/docs/latest/security]
title: Security
---

## Vulnerability Disclosure

If you believe you have found a security issue in `vendir`, please privately and responsibly disclose it by following the directions in our [security policy](/shared/docs/latest/security-policy).
76 changes: 76 additions & 0 deletions site/content/vendir/docs/v0.35.x/sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
aliases: [/vendir/docs/latest/sync]
title: Sync command
---

## Overview

`vendir sync` command looks for [`vendir.yml`](vendir-spec.md) file in current directory for its configuration. `vendir.yml` specifies source of files for each managed directory.

```
# Run to sync directory contents as specified by vendir.yml
$ vendir sync
```

See [`vendir.yml` spec](vendir-spec.md) for its schema.

## Sync with local changes override

As of v0.7.0 you can use `--directory` flag to override contents of particular directories by pointing them to local directories. When this flag is specified other directories will not be synced (hence lock config is not going to be updated).

```
$ vendir sync --directory vendor/local-dir=local-dir-dev
```

## Sync with locks

`vendir sync` writes [`vendir.lock.yml`](vendir-lock-spec.md) (next to `vendir.yml`) that contains resolved references:

- for `git`, resolved SHAs are recorded
- for `hg`, resolved SHAs are recorded
- for `http`, nothing is recorded
- for `image`, resolved URL as a digest reference
- for `githubRelease`, permanent links are recorded
- for `helmChart`, resolved version
- for `directory`, nothing is recorded
- for `manual`, nothing is recorded

To use these resolved references on top of `vendir.yml`, use `vendir sync -l`.

## Syncing from different directory

As of v0.22.0, you can use `--chdir` flag with `vendir sync` command to change current working directory of vendir before any syncing occurs. All other paths provided to `vendir sync` should be relative to the changed directory.

## Caching

`vendir` allows the users to cache OCI Images in their disk so as not to rely on access to the registry all the time.
To activate this feature the users need to set the environment variable `VENDIR_CACHE_DIR`. This variable should point
to the path where they want to store the OCI Images.

```bash-plain
$ mkdir -p ~/.vendir/cache
$ export VENDIR_CACHE_DIR=~/.vendir/cache
$ vendir sync
```

**Note:** Not all images can be cached. Only images that are referenced by SHA can be cached.

The user can also specify what is the maximum size of the content to be cached, by setting the environment variable
`VENDIR_MAX_CACHE_SIZE`. The default value, when the variable is not provided is `1Mi` (1 Megabyte).

The following are some accepted values:
```
1 = 1 Byte
1Ki = 1 Kilobyte
1Mi = 1 Megabyte
1Gi = 1 Gigabyte
```

Example of usage:

```bash-plain
$ mkdir -p ~/.vendir/cache
$ export VENDIR_CACHE_DIR=~/.vendir/cache
$ export VENDIR_MAX_CACHE_SIZE=1Ki
$ vendir sync
```
69 changes: 69 additions & 0 deletions site/content/vendir/docs/v0.35.x/vendir-lock-spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
aliases: [/vendir/docs/latest/vendir-lock-spec]
title: vendir.lock.yml spec
---

Lock file is generated by `vendir sync` and is placed next to related `vendir.yml`.

```yaml
apiVersion: vendir.k14s.io/v1alpha1
kind: LockConfig

directories:
- path: config/_ytt_lib
contents:
- path: github.com/cloudfoundry/cf-k8s-networking

# present if this is managed manually
manual: {}

# present if git
git:
# resolved checked out commit SHA
sha: 2b009b61fa8afb330a4302c694ee61b11104c54c
# resolved checked out commit title
commitTitle: 'feat: add /metrics prometheus scrapable endpoint...'
# resolved to a set of tags pointing to sha (v0.11.0+)
tags:
- "4.0.0"

# present if hg (v0.22.0+)
hg:
# resolved checked out change SHA
sha: 180c776fe29448afa8c756ab572bab7a1cf17a06
# resolved checked out change title
changeSetTitle: 'Prevent wrapping filenames to preserve whitespace'

# present if github release
githubRelease:
# resolved release url
url: https://api.github.com/repos/pivotal/kpack/releases/22747441

# present if helm chart (v0.11.0+)
helmChart:
appVersion: "5.0.7"
version: "10.5.7"

# present if http
http: {}

# present if image (v0.11.0+)
image:
# fully resolve image URL with digest
url: index.docker.io/dkalinin/consul-helm@sha256:d1cdbd46561a144332f0744302d45f27583fc0d75002cba473d840f46630c9f7
# included if image URL included a tag (v0.22.0+)
tag: "some-tag"

# present if imgpkgBundle (v0.16.0+)
imgpkgBundle:
# fully resolve image URL with digest
image: index.docker.io/dkalinin/consul-helm@sha256:d1cdbd46561a144332f0744302d45f27583fc0d75002cba473d840f46630c9f7
# included if image URL included a tag (v0.22.0+)
tag: "some-tag"

# present if inline (v0.11.0+)
inline: {}

# present if this was sourced from local directory
directory: {}
```
Loading

0 comments on commit 374af36

Please sign in to comment.