I am new to CI/CD and trying to deploy a simple serverless function through Jenkins and getting error.
Here are my steps
- Create a new project using dotnet new serverless.AspNetCoreWebAPI
- Configured Git source {GitHub} where this project is located.
Added following lines in Build Step
`export PATH=$PATH:/usr/local/share/dotnet:/usr/local/bin
dotnet lambda deploy-serverless`
After running the above command I get the error
/usr/local/share/dotnet/dotnet lambda deploy-serverless Could not execute because the specified command or file was not found. Possible reasons for this include:
You misspelled a built-in dotnet command.
You intended to execute a .NET Core program, but dotnet-lambda does not exist.
You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
Build step 'Execute shell' marked build as failure Finished: FAILURE
Needless to say I can successfully run dotnet lambda deploy-serverless if using terminal window.
Any idea what's wrong here?