CI CD for serverless framework
npm install serverless-codepipeline```
yarn add serverless-codepipeline
add plugin to the serverless.yml
``
plugins:
modules:
- serverless-codepipeline
Add following configuration in serverless.yml file
``
custom:
cicd:
branch: 'master'
owner: '${REPOSITORY OWNER}'
repository: '${REPOSITORY NAMW}'
githubtoken: 'asdas'
policy: '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"elasticbeanstalk:*"
],
"Resource": "*"
}
]
}'
Add buildspec.yml to folder, codebuild use buildspec.yml to deploy application
most common example of buildspec.yml is
``
version: 0.1
phases:
install:
commands:
- npm install
- npm install -g serverless
build:
commands:
- serverless deploy --stage prod
----------
Open an issue first to discuss potential changes/additions. If you have questions with the guide, feel free to leave them as issues in the repository. If you find a typo, create a pull request. The idea is to keep the content up to date and use github’s native feature to help tell the story with issues and PR’s, which are all searchable via google. Why? Because odds are if you have a question, someone else does too! You can learn more here at about how to contribute.
By contributing to this repository you are agreeing to make your content available subject to the license of this repository.
Use this guide. Attributions are appreciated._
Copyright (c) 2014-2015 Tushar Borole
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.