Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrage committed Aug 21, 2020
1 parent 627c2fc commit fa709ab
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions pkg/odo/cli/component/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,24 @@ var EnvFilePath = filepath.Join(LocalDirectoryDefaultLocation, envFile)
// ConfigFilePath is the path of config.yaml for s2i component
var ConfigFilePath = filepath.Join(LocalDirectoryDefaultLocation, configFile)

var createLongDesc = ktemplates.LongDesc(`Create a configuration describing a component.
var createLongDesc = ktemplates.LongDesc(`Create a configuration describing a component.`)

If a component name is not provided, it'll be auto-generated.
var createExample = ktemplates.Examples(`# Create a new Node.JS component with existing sourcecode as well as specifying a name
%[1]s nodejs mynodejs
A full list of component types that can be deployed is available using: 'odo catalog list components'
By default, builder images (component type) will be used from the current namespace. You can explicitly supply a namespace by using: odo create namespace/name:version
If version is not specified by default, latest will be chosen as the version.`)
# Name is not required and will be automatically generated if not passed
%[1]s nodejs
var createExample = ktemplates.Examples(` # Create new Node.js component with the source in current directory.
# List all available components before deploying
odo catalog list components
%[1]s java-quarkus
Note: When you use odo with experimental mode enabled and create devfile component, if you want to use existing devfile the first argument will be the component name
# Create new Node.js component with existing devfile
%[1]s mynodejs (devfile exists in current working directory)
%[1]s mynodejs --devfile ./devfile.yaml (devfile exists in any other directory)
%[1]s mynodejs --devfile https://raw.githubusercontent.com/elsony/devfile-registry/master/devfiles/nodejs/devfile.yaml (devfile exists in network)
# Download an example devfile and application before deploying
%[1]s nodejs --starter
# Create new Node.js component
%[1]s nodejs
# Using a specific devfile
%[1]s mynodejs --devfile ./devfile.yaml
%[1]s mynodejs --devfile https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/devfile.yaml
# Create new Node.js component named 'frontend' with the source in './frontend' directory
%[1]s nodejs frontend --context ./frontend
Expand All @@ -136,10 +135,7 @@ Note: When you use odo with experimental mode enabled and create devfile compone
%[1]s nodejs --git https://github.com/openshift/nodejs-ex.git
# Create new Node.js component with custom ports and environment variables
%[1]s nodejs --port 8080,8100/tcp,9100/udp --env key=value,key1=value1
# Create new Node.js component and download the sample project named nodejs-starter
%[1]s nodejs --starter=nodejs-starter`)
%[1]s nodejs --port 8080,8100/tcp,9100/udp --env key=value,key1=value1`)

const defaultStarterProjectName = "devfile-starter-project-name"

Expand Down

0 comments on commit fa709ab

Please sign in to comment.