1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

docs(cnbBuild): fix containerImageAlias examples (#4171)

This commit is contained in:
Pavel Busko 2022-12-21 16:47:22 +01:00 committed by GitHub
parent 6f9e3dbb04
commit 6201e9bd96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -223,7 +223,7 @@ func addCnbBuildFlags(cmd *cobra.Command, stepConfig *cnbBuildOptions) {
cmd.Flags().StringVar(&stepConfig.ContainerImageName, "containerImageName", os.Getenv("PIPER_containerImageName"), "Name of the container which will be built\n`cnbBuild` step will try to identify a containerImageName using the following precedence:\n\n 1. `containerImageName` parameter.\n 2. `project.id` field of a `project.toml` file.\n 3. `git/repository` parameter of the `commonPipelineEnvironment`.\n 4. `github/repository` parameter of the `commonPipelineEnvironment`.\n\nIf none of the above was found - an error will be raised.\n")
cmd.Flags().StringVar(&stepConfig.ContainerImageAlias, "containerImageAlias", os.Getenv("PIPER_containerImageAlias"), "Logical name used for this image.\n")
cmd.Flags().StringVar(&stepConfig.ContainerImageTag, "containerImageTag", os.Getenv("PIPER_containerImageTag"), "Tag of the container which will be built")
cmd.Flags().StringVar(&stepConfig.ContainerRegistryURL, "containerRegistryUrl", os.Getenv("PIPER_containerRegistryUrl"), "Container registry where the image should be pushed to")
cmd.Flags().StringVar(&stepConfig.ContainerRegistryURL, "containerRegistryUrl", os.Getenv("PIPER_containerRegistryUrl"), "Container registry where the image should be pushed to.\n\n**Note**: `containerRegistryUrl` should include only the domain. If you want to publish an image under `docker.io/example/my-image`, you must set `containerRegistryUrl: \"docker.io\"` and `containerImageName: \"example/my-image\"`.\n")
cmd.Flags().StringSliceVar(&stepConfig.Buildpacks, "buildpacks", []string{}, "List of custom buildpacks to use in the form of `$HOSTNAME/$REPO[:$TAG]`.")
cmd.Flags().StringVar(&stepConfig.Path, "path", os.Getenv("PIPER_path"), "Glob that should either point to a directory with your sources or one artifact in zip format.\nThis property determines the input to the buildpack.\n")

View File

@ -83,7 +83,10 @@ spec:
- name: dockerRegistryUrl
type: string
mandatory: true
description: Container registry where the image should be pushed to
description: |
Container registry where the image should be pushed to.
**Note**: `containerRegistryUrl` should include only the domain. If you want to publish an image under `docker.io/example/my-image`, you must set `containerRegistryUrl: "docker.io"` and `containerImageName: "example/my-image"`.
scope:
- GENERAL
- PARAMETERS
@ -217,16 +220,16 @@ spec:
```yaml
containerImageTag: latest
containerRegistryUrl: docker.io/example
containerRegistryUrl: docker.io
dockerConfigJsonCredentialsId: CREDENTIALS
multipleImages:
- containerImageName: java-app
alias: java
- containerImageName: example/java-app
containerImageAlias: java
buildpacks:
- "gcr.io/paketo-buildpacks/java"
path: "source/java"
- containerImageName: nodejs-app
alias: nodejs
- containerImageName: example/nodejs-app
containerImageAlias: nodejs
containerImageTag: v1.0.0
buildpacks:
- "gcr.io/paketo-buildpacks/nodejs"