Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ underlying Git version control system.
First, let's fetch the _kpt package_ from Git to your local filesystem:

```shell
kpt pkg get https://github.com/kptdev/kpt/package-examples/nginx@v1.0.0-beta.59
kpt pkg get https://github.com/kptdev/kpt/package-examples/nginx@v1.0.0-beta.61
```

Subsequent commands are run from the `nginx` directory:
Expand Down
34 changes: 10 additions & 24 deletions documentation/content/en/book/03-packages/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ fork the package to use it.
Let's revisit the Wordpress example:

```shell
kpt pkg get https://github.com/kptdev/kpt.git/package-examples/wordpress@v1.0.0-beta.59
kpt pkg get https://github.com/kptdev/kpt.git/package-examples/wordpress@v1.0.0-beta.61
```

A package in a Git repo can be fetched by specifying a branch, tag, or commit SHA. In this case, we are specifying tag
`v1.0.0-beta.59`.
`v1.0.0-beta.61`.

Refer to the [get command reference](../../reference/cli/pkg/get/) for usage.

Expand All @@ -42,14 +42,14 @@ upstream:
git:
repo: https://github.com/kptdev/kpt
directory: /package-examples/wordpress
ref: v1.0.0-beta.59
ref: v1.0.0-beta.61
updateStrategy: resource-merge
upstreamLock:
type: git
git:
repo: https://github.com/kptdev/kpt
directory: /package-examples/wordpress
ref: package-examples/wordpress/v1.0.0-beta.59
ref: package-examples/wordpress/v1.0.0-beta.61
commit: b9ea0bca019dafa9f9f91fd428385597c708518c
info:
emails:
Expand Down Expand Up @@ -113,7 +113,7 @@ It is possible to specify a different local directory name to the `get` command.
For example, the following fetches the packages to a directory named `mywordpress`:

```shell
kpt pkg get https://github.com/kptdev/kpt.git/package-examples/wordpress@v1.0.0-beta.59 mywordpress
kpt pkg get https://github.com/kptdev/kpt.git/package-examples/wordpress@v1.0.0-beta.61 mywordpress
```

The _name of a package_ is given by its directory name. Since the Kptfile is a KRM resource and follows the familiar
Expand Down Expand Up @@ -281,7 +281,7 @@ upstream:
git:
repo: https://github.com/kptdev/kpt
directory: /package-examples/wordpress
# Change this from v1.0.0-beta.59 to main
# Change this from v1.0.0-beta.61 to main
ref: main
updateStrategy: resource-merge
```
Expand Down Expand Up @@ -314,22 +314,14 @@ git add .; git commit -m "Updated wordpress to main"
```
## Creating a package

Creating a new package is simple: create a new directory and [author resources](#editing-a-package):

```shell
mkdir awesomeapp
# Create resources in awesomeapp/
```

For convenience, you can use `pkg init` command to create a minimal `Kptfile`
and `README` files:
Creating a new package is simple. Use the `pkg init` command to create a package directory with a minimal `Kptfile` and `README` files:

```shell
kpt pkg init awesomeapp
writing Kptfile
writing README.md
```

This will create the `awesomeapp` directory if it doesn't exist, and initialize it with the necessary files.

Refer to the [init command reference](../../reference/cli/pkg/init/) for usage.

The `info` section of the `Kptfile` contains some optional package metadata you
Expand Down Expand Up @@ -394,20 +386,14 @@ approaches:

### Create a new package

Create the directory:

```shell
mkdir wordpress/mysql
```

Initialize the package:

```shell
kpt pkg init wordpress/mysql
# author resources in mysql
```

This creates a [dependent package](#getting-a-package).
This will create the `wordpress/mysql` directory if it doesn't exist, and initialize it as a [dependent package](#getting-a-package).

### Get an existing package

Expand Down
6 changes: 3 additions & 3 deletions documentation/content/en/book/09-ci-user-guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ optional gated apply.
To keep the example concrete, we use the WordPress package. You can fetch it locally with:

```shell
$ kpt pkg get https://github.com/kptdev/kpt/package-examples/wordpress@v1.0.0-beta.59
$ kpt pkg get https://github.com/kptdev/kpt/package-examples/wordpress@v1.0.0-beta.61
```

### Render-only build
Expand Down Expand Up @@ -224,7 +224,7 @@ steps:
kpt fn render ${_PACKAGE_DIR}

substitutions:
_KPT_VERSION: v1.0.0-beta.59
_KPT_VERSION: v1.0.0-beta.61
_PACKAGE_DIR: wordpress
```

Expand Down Expand Up @@ -266,7 +266,7 @@ steps:
KUBECONFIG=/workspace/kubeconfig kpt live apply ${_PACKAGE_DIR}

substitutions:
_KPT_VERSION: v1.0.0-beta.59
_KPT_VERSION: v1.0.0-beta.61
_PACKAGE_DIR: wordpress

# Define where the secret comes from
Expand Down
Loading