How to deploy web app in cumulocity by providing credentials inline

What product/components do you use and which version/fix level are you on?

Cumulocity IOT

Is your question related to the free trial, or to a production (customer) instance?

Free Trial

What are you trying to achieve? Please describe it in detail.

Hi, I am trying to deploy the web app using c8ycli. Now I know that I can just create the build and deploy using the commands. When you run the c8ycli deploy command, it asks you for the credentials in another line. Is it possible to provide the credentials inline? like c8ycli deploy --app.tenant = someTenant --app.url = envURL --app.username = User --app.password = pass
so that it doesnt ask for the details and verify it from the inline and directly deploy it on the provided tenant.

There’s nothing in the documentation that suggests this is possible, and c8ycli help says the same thing.

Hi Samanyu,

you can provide credentials inline by using following command options:

'-u, --url [url]',
'-U, --user [user name]',
'-P, --password [password]',

For example:

npx c8ycli deploy -u {{C8Y_Instance}} -U {{username}} -P {{password}}

best regards

1 Like

Hi Christian,

Thank you so much for your response.

Best Regards,
Samanyu

Hi Christian,

Is there an option to provide the app path as well along with all the details?

Regards,
Samanyu

You can check the help output for that command:

c8ycli deploy --help
Usage: cli deploy [options] [appPaths...]

Deploys apps from the specified paths

Options:
  -T, --tenant [tenant]      Tenant
  -U, --user [user name]     Username
  -P, --password [password]  Password
  -s, --silent               does not prompt for additional inputs
  --tag [tag]                A custom tag which will be added to the package version
  -h, --help                 output usage information

So yes you can specify a local path to the built application using appPaths

1 Like

Hi Tristan,

Can you please provide an example for the same like npx c8ycli deploy -u {{C8Y_Instance}} -U {{username}} -P {{password}} C:/app/projectName
I tried this but it isn’t working also tried with --app.contextPath but no luck
So is there any other prefix for the path or like how can I mention the path of my project root folder.

Best Regards,
Samanyu

You can add the context path to the command without specifying a command option. For example, if your application has the context path my-application, you add it to the end of your command:

npx c8ycli deploy -u {{C8Y_Instance}} -U {{username}} -P {{password}} my-application




Christian Guether

sag-fast-track-service-690x88px-en-may23-v2-2

Hi Christian,

Thank you for your response.

Regards,
Samanyu

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.