Skip to content

Commit

Permalink
Update documentation and CI steps to use the new mkpcli attach command
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <[email protected]>
  • Loading branch information
Pete Wall committed May 25, 2022
1 parent e62abf2 commit fcd98c7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions ci/tasks/test-chart-product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ run:
VERSION=$(cat version/version)
# Upload a chart
mkpcli chart attach --product "${PRODUCT_SLUG}" --product-version "${VERSION}" --create-version \
--chart chart/*.tgz --readme "helm install it"
mkpcli attach chart --product "${PRODUCT_SLUG}" --product-version "${VERSION}" --create-version \
--chart chart/*.tgz --instructions "helm install it"
# Get the list of charts
mkpcli chart list --product "${PRODUCT_SLUG}" --product-version "${VERSION}" | grep -v "Total count: 0"
4 changes: 2 additions & 2 deletions ci/tasks/test-container-image-product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ run:
VERSION=$(cat version/version)
# Upload a docker image
mkpcli container-image attach --product "${PRODUCT_SLUG}" --product-version "${VERSION}" --create-version \
mkpcli attach image --product "${PRODUCT_SLUG}" --product-version "${VERSION}" --create-version \
--image-repository "${TEST_IMAGE_REPO}" --tag "${TEST_IMAGE_TAG}" --tag-type FIXED \
--deployment-instructions "docker run ${TEST_IMAGE_REPO}:${TEST_IMAGE_TAG}"
--instructions "docker run ${TEST_IMAGE_REPO}:${TEST_IMAGE_TAG}"
# Get the list of container images
mkpcli container-image list --product "${PRODUCT_SLUG}" --product-version "${VERSION}" | grep "${TEST_IMAGE_REPO} *${TEST_IMAGE_TAG}"
2 changes: 1 addition & 1 deletion ci/tasks/test-vm-product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ run:
VM_FILE=$(find vm -type f -name '*.iso' -or -name '*.ova')
# Attach a virtual machine file
mkpcli vm attach --product "${PRODUCT_SLUG}" --product-version "${VERSION}" --create-version \
mkpcli attach vm --product "${PRODUCT_SLUG}" --product-version "${VERSION}" --create-version \
--file "${VM_FILE}"
# Get the list of virtual machine files
Expand Down
6 changes: 3 additions & 3 deletions cmd/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func init() {
AttachChartCmd.Flags().StringVarP(&AttachProductVersion, "product-version", "v", "", "Product version (default to latest version)")
AttachChartCmd.Flags().StringVarP(&AttachChartURL, "chart", "c", "", "path to to chart, either local tgz or public URL (required)")
_ = AttachChartCmd.MarkFlagRequired("chart")
AttachChartCmd.Flags().StringVar(&AttachInstructions, "instructions", "", "readme information")
AttachChartCmd.Flags().StringVar(&AttachInstructions, "instructions", "", "chart deployment instructions")
_ = AttachChartCmd.MarkFlagRequired("instructions")
AttachChartCmd.Flags().BoolVar(&AttachCreateVersion, "create-version", false, "create the product version, if it doesn't already exist")

Expand All @@ -54,8 +54,8 @@ func init() {
_ = AttachContainerImageCmd.MarkFlagRequired("tag")
AttachContainerImageCmd.Flags().StringVar(&AttachContainerImageTagType, "tag-type", "", "container repository tag type (fixed or floating)")
_ = AttachContainerImageCmd.MarkFlagRequired("tag-type")
AttachContainerImageCmd.Flags().StringVarP(&AttachInstructions, "deployment-instructions", "i", "", "deployment instructions")
_ = AttachContainerImageCmd.MarkFlagRequired("deployment-instructions")
AttachContainerImageCmd.Flags().StringVarP(&AttachInstructions, "instructions", "i", "", "image deployment instructions")
_ = AttachContainerImageCmd.MarkFlagRequired("instructions")
AttachContainerImageCmd.Flags().BoolVar(&AttachCreateVersion, "create-version", false, "create the product version, if it doesn't already exist")

AttachVMCmd.Flags().StringVarP(&AttachProductSlug, "product", "p", "", "Product slug (required)")
Expand Down
4 changes: 2 additions & 2 deletions docs/ConcourseExample.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
- |
VERSION=$(cat version/version)
mkpcli chart attach \
mkpcli attach chart \
--product "${PRODUCT_SLUG}" \
--product-version "${VERSION}" --create-version \
--chart hyperspace-db-chart/*.tgz \
--readme "helm install it"
--instructions "helm install it"
mkpcli chart list --product "${PRODUCT_SLUG}" --product-version "${VERSION}"
```
8 changes: 4 additions & 4 deletions docs/PublishingChartProducts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ The CLI can either upload a local chart (in a directory or tgz format), or attac
will attach the reference to the product.

## Example
To do this, you can use the `mkpcli chart attach` command:
To do this, you can use the `mkpcli attach chart` command:

### Upload a local chart

```bash
mkpcli chart attach --product hyperspace-database-chart --product-version 1.0.1 --chart charts/hyperspace-db-1.0.1.tgz --readme 'helm install it'
mkpcli attach chart --product hyperspace-database-chart --product-version 1.0.1 --chart charts/hyperspace-db-1.0.1.tgz --instructions 'helm install it'
```

### Attaching a remote chart

```bash
mkpcli chart attach --product hyperspace-database-chart --product-version 1.0.1 --chart https://astro-widgets.example.com/charts/hyperspace-db-1.0.1.tgz --readme 'helm install it'
mkpcli attach chart --product hyperspace-database-chart --product-version 1.0.1 --chart https://astro-widgets.example.com/charts/hyperspace-db-1.0.1.tgz --instructions 'helm install it'
```

If this version is a new version for the product, pass the `--create-version` flag:

```bash
mkpcli chart attach --product hyperspace-database-chart --product-version 1.0.1 --create-version --chart charts/hyperspace-db-1.0.1.tgz --readme 'helm install it'
mkpcli attach chart --product hyperspace-database-chart --product-version 1.0.1 --create-version --chart charts/hyperspace-db-1.0.1.tgz --instructions 'helm install it'
```
6 changes: 3 additions & 3 deletions docs/PublishingContainerImageProducts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ The container image must be referenced by a publicly accessible repository, tag,
The tag type is either `FIXED` or `FLOATING`

## Example
To do this, you can use the `mkpcli container-image attach` command:
To do this, you can use the `mkpcli attach image` command:

```bash
mkpcli container-image attach --product hyperspace-database --version 1.0.1 --image-repository astrowidgets/hyperspacedb --tag 1.0.1 --tag-type FIXED --deployment-instructions 'docker run astrowidgets/hyperspacedb:1.0.1'
mkpcli attach image --product hyperspace-database --version 1.0.1 --image-repository astrowidgets/hyperspacedb --tag 1.0.1 --tag-type FIXED --instructions 'docker run astrowidgets/hyperspacedb:1.0.1'
```

If this version is a new version for the product, pass the `--create-version` flag:

```bash
mkpcli container-image attach --product hyperspace-database --version 1.0.1 --create-version --image-repository astrowidgets/hyperspacedb --tag 1.0.1 --tag-type FIXED --deployment-instructions 'docker run astrowidgets/hyperspacedb:1.0.1'
mkpcli attach image --product hyperspace-database --version 1.0.1 --create-version --image-repository astrowidgets/hyperspacedb --tag 1.0.1 --tag-type FIXED --instructions 'docker run astrowidgets/hyperspacedb:1.0.1'
```
6 changes: 3 additions & 3 deletions docs/PublishingVirtualMachineProducts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ The Marketplace CLI can update products that host virtual machine images (both I
The CLI will upload the image to the Marketplace, and then attach the reference to the product.

## Example
To do this, you can use the `mkpcli vm attach` command:
To do this, you can use the `mkpcli attach vm` command:

```bash
mkpcli vm attach --product hyperspace-database-vm --product-version 1.0.1 --file vm/hyperspace-db-1.0.1-1526e30ba.iso
mkpcli attach vm --product hyperspace-database-vm --product-version 1.0.1 --file vm/hyperspace-db-1.0.1-1526e30ba.iso
```

If this version is a new version for the product, pass the `--create-version` flag:

```bash
mkpcli vm attach --product hyperspace-database-vm --product-version 1.0.1 --create-version --file vm/hyperspace-db-1.0.1-1526e30ba.iso
mkpcli attach vm --product hyperspace-database-vm --product-version 1.0.1 --create-version --file vm/hyperspace-db-1.0.1-1526e30ba.iso
```

0 comments on commit fcd98c7

Please sign in to comment.