Skip to content

Commit c783436

Browse files
committed
Address comments on publish usage
* addresses possible confusion with publish command * adds a note on build and publish functions to refactor at a later date into a struct Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 8539c86 commit c783436

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ The main commands supported by the CLI are:
7777
* `faas-cli push` - pushes Docker images into a registry
7878
* `faas-cli deploy` - deploys the functions into a local or remote OpenFaaS gateway
7979

80+
* `faas-cli publish` - build and push multi-arch images for CI and release artifacts
81+
8082
* `faas-cli remove` - removes the functions from a local or remote OpenFaaS gateway
8183
* `faas-cli invoke` - invokes the functions and reads from STDIN for the body of the request
8284
* `faas-cli store` - allows browsing and deploying OpenFaaS store functions

builder/build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
const AdditionalPackageBuildArg = "ADDITIONAL_PACKAGE"
2424

2525
// BuildImage construct Docker image from function parameters
26+
// TODO: refactor signature to a struct to simplify the length of the method header
2627
func BuildImage(image string, handler string, functionName string, language string, nocache bool, squash bool, shrinkwrap bool, buildArgMap map[string]string, buildOptions []string, tagMode schema.BuildFormat, buildLabelMap map[string]string, quietBuild bool, copyExtraPaths []string) error {
2728

2829
if stack.IsValidTemplate(language) {

builder/publish.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
)
1515

1616
// PublishImage will publish images as multi-arch
17+
// TODO: refactor signature to a struct to simplify the length of the method header
1718
func PublishImage(image string, handler string, functionName string, language string, nocache bool, squash bool, shrinkwrap bool, buildArgMap map[string]string,
1819
buildOptions []string, tagMode schema.BuildFormat, buildLabelMap map[string]string, quietBuild bool, copyExtraPaths []string, platforms string, extraTags []string) error {
1920

commands/publish.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,16 @@ var publishCmd = &cobra.Command{
6666
[--copy-extra PATH]
6767
[--tag <sha|branch|describe>]
6868
[--platforms linux/arm/v7]`,
69-
Short: "Builds and pushes multi-arch OpenFaaS functions",
70-
Long: `Builds and pushes multi-arch OpenFaaS functions using Docker buildx.
71-
A multi-arch template is required. Images will not be available in the
72-
local Docker library. This command only works when a YAML file is specified.
69+
Short: "Builds and pushes multi-arch OpenFaaS container images",
70+
Long: `Builds and pushes multi-arch OpenFaaS container images using Docker buildx.
71+
Most users will want faas-cli build or faas-cli up for development and testing.
72+
This command is designed to make releasing and publishing multi-arch container
73+
images easier.
74+
75+
A stack.yaml file is required, and any images that are built will not be
76+
available in the local Docker library. This is due to technical constraints in
77+
Docker and buildx. You must use a multi-arch template to use this command with
78+
correctly configured TARGETPLATFORM and BUILDPLATFORM arguments.
7379
7480
See also: faas-cli build`,
7581
Example: ` faas-cli publish --platforms linux/amd64,linux/arm64,linux/arm/7

0 commit comments

Comments
 (0)