You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The serverless package command with the --package option creates a serverless-state.json file in the artifact directory. This file is part of the artifacts as well as the cf template json files and must be available in the folder.
Great. all works well. Thanks for the input!
serverless package --stage staging -p ./templates/beta
serverless deploy --stage staging --package ./templates/beta
For some reason, I'm still getting the No serverless-state.json file found in the package path you provided. error even though I see the file exists in the directory I'm passing to --package
The serverless package command with the --package option creates a serverless-state.json with absolute path for functions artifacts. And when you use custom path it is anyway pointed to .serverless folder. This is useless fo CI when you have to create artifacts and archive in build job and then restore in deploy job to workspace with different absolute path. Of course you can use "sed" before run sls. But why absolute path?
Thanks @ostov based on your feedback I've managed to solve this issue #4188#5297
I don't understand why an absolute path is necessary (or being used at all) it's not a good practice.
simply removing the line with the abolute path reference in the state json fixed the problem
Here is what i ended up doing I hope it will help others. this method ensures the package can be deployed anywhere.
Build
yarn version --new-version $MAJOR_VERSION.$MINOR_VERSION.$BUILD_NUMBER
yarn install
sls package --package dist
sed -i '/Part_of_Path_To_Remove/d' ./dist/serverless-state.json
tar -czf $ARTIFACT_ID-$MAJOR_VERSION.$MINOR_VERSION.$BUILD_NUMBER.tar.gz dist
Deployment
wget tar.gz
tar zxvf ...
sls deploy -s dev -p dist
Activity
HyperBrain commentedon Apr 26, 2017
The parameter is
--packagenot--pathto reference an artifact directory. Could you try with that?srikanna commentedon Apr 26, 2017
Nope that didnt work either
HyperBrain commentedon Apr 26, 2017
The
serverless packagecommand with the--packageoption creates aserverless-state.jsonfile in the artifact directory. This file is part of the artifacts as well as the cf template json files and must be available in the folder.srikanna commentedon Apr 26, 2017
Great. all works well. Thanks for the input!
serverless package --stage staging -p ./templates/beta
serverless deploy --stage staging --package ./templates/beta
pmuens commentedon Apr 27, 2017
Glad to hear that it's working @srikanna 👍
@HyperBrain thanks for helping here!
jml6m commentedon Jan 22, 2018
For some reason, I'm still getting the
No serverless-state.json file found in the package path you provided.error even though I see the file exists in the directory I'm passing to--packageMunter commentedon Oct 26, 2018
I'm getting the same thing as @jml6m
What is the fix?
ostov commentedon Nov 26, 2018
The serverless package command with the --package option creates a serverless-state.json with absolute path for functions artifacts. And when you use custom path it is anyway pointed to .serverless folder. This is useless fo CI when you have to create artifacts and archive in build job and then restore in deploy job to workspace with different absolute path. Of course you can use "sed" before run sls. But why absolute path?
Idanatcox commentedon Jan 10, 2019
Thanks @ostov based on your feedback I've managed to solve this issue #4188 #5297
I don't understand why an absolute path is necessary (or being used at all) it's not a good practice.
simply removing the line with the abolute path reference in the state json fixed the problem
Here is what i ended up doing I hope it will help others. this method ensures the package can be deployed anywhere.
Build
Deployment