diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index e452ee22..03b9472c 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -41,7 +41,7 @@ jobs: run: make install - name: Push run: | - timoni push ./examples/podinfo oci://localhost:5000/podinfo \ + timoni mod push ./examples/podinfo oci://localhost:5000/podinfo \ --version 1.0.0 - name: Template run: | diff --git a/README.md b/README.md index 2a496537..37e6e468 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,8 @@ A module example can be found at [examples/podinfo](examples/podinfo). Commands for working with local modules: -- `timoni lint ` +- `timoni mod init ` +- `timoni mod lint ` - `timoni build -n ` - `timoni apply -f --dry-run --diff` @@ -62,8 +63,8 @@ Timoni modules are distributed as OCI artifacts and can be stored in container r Commands for working with remote modules: -- `timoni push oci:// -v ` -- `timoni pull oci:// -v -o ` +- `timoni mod push oci:// -v ` +- `timoni mod pull oci:// -v -o ` To learn more about modules, please read the [docs](https://timoni.sh/#timoni-modules). @@ -90,9 +91,8 @@ values: { Commands for working with instances: -- `timoni install oci:// -v -n ` -- `timoni upgrade oci:// -v -f ` -- `timoni uninstall -n ` +- `timoni apply oci:// -v -f ` +- `timoni delete -n ` - `timoni list -n ` - `timoni inspect [module|values|resources] ` diff --git a/cmd/timoni/inspect_test.go b/cmd/timoni/inspect_test.go index b5d9a143..6abf81b5 100644 --- a/cmd/timoni/inspect_test.go +++ b/cmd/timoni/inspect_test.go @@ -33,7 +33,7 @@ func TestInspect(t *testing.T) { // Package the module as an OCI artifact and push it to registry _, err := executeCommand(fmt.Sprintf( - "push %s %s -v %s", + "mod push %s %s -v %s", modPath, modURL, modVer, diff --git a/cmd/timoni/pull.go b/cmd/timoni/mod_pull.go similarity index 96% rename from cmd/timoni/pull.go rename to cmd/timoni/mod_pull.go index db723958..da7ce403 100644 --- a/cmd/timoni/pull.go +++ b/cmd/timoni/mod_pull.go @@ -33,7 +33,7 @@ var pullCmd = &cobra.Command{ Long: `The pull command downloads the module from a container registry and extract its contents the specified directory.`, Example: ` # Pull a module version from GitHub Container Registry - timoni pull oci://ghcr.io/org/manifests/app --version 1.0.0 \ + timoni mod pull oci://ghcr.io/org/manifests/app --version 1.0.0 \ --output ./path/to/module \ --creds timoni:$GITHUB_TOKEN `, @@ -54,7 +54,7 @@ func init() { "The directory path where the module content should be extracted.") pullCmd.Flags().Var(&pullArgs.creds, pullArgs.creds.Type(), pullArgs.creds.Description()) - rootCmd.AddCommand(pullCmd) + modCmd.AddCommand(pullCmd) } func pullCmdRun(cmd *cobra.Command, args []string) error { diff --git a/cmd/timoni/pull_test.go b/cmd/timoni/mod_pull_test.go similarity index 96% rename from cmd/timoni/pull_test.go rename to cmd/timoni/mod_pull_test.go index 1361dd68..afa9e9a4 100644 --- a/cmd/timoni/pull_test.go +++ b/cmd/timoni/mod_pull_test.go @@ -35,7 +35,7 @@ func Test_Pull(t *testing.T) { // Package the module as an OCI artifact and push it to registry _, err := executeCommand(fmt.Sprintf( - "push %s oci://%s -v %s", + "mod push %s oci://%s -v %s", modPath, modURL, modVer, @@ -45,7 +45,7 @@ func Test_Pull(t *testing.T) { // Pull the OCI artifact from registry and extract the module to tmp tmpDir := t.TempDir() _, err = executeCommand(fmt.Sprintf( - "pull oci://%s -v %s -o %s", + "mod pull oci://%s -v %s -o %s", modURL, modVer, tmpDir, diff --git a/cmd/timoni/push.go b/cmd/timoni/mod_push.go similarity index 96% rename from cmd/timoni/push.go rename to cmd/timoni/mod_push.go index 49346201..a54dc152 100644 --- a/cmd/timoni/push.go +++ b/cmd/timoni/mod_push.go @@ -39,12 +39,12 @@ var pushCmd = &cobra.Command{ container registry using the version as the image tag.`, Example: ` # Push a module to Docker Hub using the credentials from '~/.docker/config.json' echo $DOCKER_PAT | docker login --username timoni --password-stdin - timoni push ./path/to/module oci://docker.io/org/app \ + timoni mod push ./path/to/module oci://docker.io/org/app \ --source="$(git config --get remote.origin.url)" \ --version=1.0.0 # Push a module to GitHub Container Registry using a GitHub token - timoni push ./path/to/module oci://ghcr.io/org/modules/app \ + timoni mod push ./path/to/module oci://ghcr.io/org/modules/app \ --source="$(git config --get remote.origin.url)" \ --version=1.0.0 \ --creds timoni:$GITHUB_TOKEN @@ -71,7 +71,7 @@ func init() { pushCmd.Flags().StringVarP(&pushArgs.output, "output", "o", "", "The format in which the artifact digest should be printed, can be 'yaml' or 'json'.") - rootCmd.AddCommand(pushCmd) + modCmd.AddCommand(pushCmd) } func pushCmdRun(cmd *cobra.Command, args []string) error { diff --git a/cmd/timoni/push_test.go b/cmd/timoni/mod_push_test.go similarity index 98% rename from cmd/timoni/push_test.go rename to cmd/timoni/mod_push_test.go index 9aba877e..e56f186a 100644 --- a/cmd/timoni/push_test.go +++ b/cmd/timoni/mod_push_test.go @@ -36,7 +36,7 @@ func Test_Push(t *testing.T) { // Push the module to registry output, err := executeCommand(fmt.Sprintf( - "push %s oci://%s -v %s", + "mod push %s oci://%s -v %s", modPath, modURL, modVer, diff --git a/docs/github-actions.md b/docs/github-actions.md index 7b609d4a..4fc3f664 100644 --- a/docs/github-actions.md +++ b/docs/github-actions.md @@ -50,13 +50,13 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Lint run: | - timoni lint ./modules/my-module - - name: Test build + timoni mod lint ./modules/my-module + - name: Test instance build run: | timoni build -n testing test ./modules/my-module - name: Push run: | - timoni push ./modules/my-module \ + timoni mod push ./modules/my-module \ oci://ghcr.io/${{ github.repository_owner }}/modules/my-module \ --version ${{ github.ref_name }} \ --creds ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} @@ -93,13 +93,13 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Push run: | - timoni push ./modules/my-module \ + timoni mod push ./modules/my-module \ oci://docker.io/my-org/my-module \ --version ${{ github.ref_name }} - name: Pull run: | mkdir -p /tmp/my-module - timoni pull oci://docker.io/my-org/my-module \ + timoni mod pull oci://docker.io/my-org/my-module \ --version ${{ github.ref_name }} \ --output /tmp/my-module ``` diff --git a/docs/index.md b/docs/index.md index 96dd5c07..f4c4682c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -47,7 +47,8 @@ Module structure: Commands for working with local modules: -- `timoni lint ` +- `timoni mod init ` +- `timoni mod lint ` - `timoni build -n ` - `timoni apply -f --dry-run --diff` @@ -60,8 +61,8 @@ the version of a module is used as the OCI artifact tag. Commands for working with remote modules: -- `timoni push oci:// -v ` -- `timoni pull oci:// -v -o ` +- `timoni mod push oci:// -v ` +- `timoni mod pull oci:// -v -o ` Timoni produces artifacts compatible with Docker Hub, GitHub Container Registry, Azure Container Registry, Amazon Elastic Container Registry, Google Artifact Registry, @@ -94,6 +95,7 @@ Commands for working with module instances: - `timoni upgrade oci:// -v -f ` - `timoni uninstall -n ` - `timoni list -n ` +- `timoni inspect [module|values|resources] ` The `install` and `upgrade` commands are aliases of `timoni apply`. To apply the Kubernetes resources belonging to a module instance, diff --git a/docs/quickstart.md b/docs/quickstart.md index 759de617..a76dd18b 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -47,7 +47,10 @@ waiting for 3 resource(s) to become ready... all resources are ready ``` +## List and inspect instances + You can list all instances in a cluster with `timoni ls -A`. + To get more information on an instance, you can use the `timoni inspect` sub-commands: ```console @@ -60,7 +63,7 @@ version: 6.3.3 To learn more about the available commands, use `timoni inspect --help`. -## Configure an module instance +## Configure a module instance To customise an instance, you can supply the configuration values using `values.cue` files. @@ -81,7 +84,7 @@ Apply the config to the podinfo module to perform an upgrade: ```shell timoni -n test apply podinfo \ - oci://ghcr.io/stefanprodan/modules/podinfo -v 6.3.3 \ + oci://ghcr.io/stefanprodan/modules/podinfo -v 6.3.4 \ --values qos-values.cue ```