Serverless Plugin Scripts

1.0.2 · abandoned · verified Tue Apr 21

serverless-plugin-scripts is a utility plugin for the Serverless Framework that extends its capabilities by allowing users to define custom shell commands and attach scripts to existing Serverless lifecycle events directly within their `serverless.yml` configuration files. The latest stable version, 1.0.2, was released in October 2017. As the project has not seen any updates or commits since then, it is considered abandoned and is no longer actively maintained. While it might still function with older Serverless Framework versions (specifically pre-v2, and likely struggling with v3+), it lacks compatibility with recent major Serverless releases and modern JavaScript/TypeScript project setups. There is no active release cadence, and users should be aware of potential security vulnerabilities or runtime issues due to its age. Its key differentiator was offering a simple, declarative way to embed shell commands into the Serverless deployment and development workflow, mitigating the need for external build scripts for simple operations. However, for robust CI/CD or complex build processes, more modern and maintained alternatives are recommended.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to install `serverless-plugin-scripts`, configure custom CLI commands and lifecycle hooks in `serverless.yml`, and execute them using the Serverless CLI.

# serverless.yml
service: my-serverless-app

plugins:
  - serverless-plugin-scripts

custom:
  scripts:
    commands:
      hello: echo "Hello from ${self:service} service at $(date) using Serverless Framework!"
      greet:
        handler: echo "Greeting from serverless-plugin-scripts. The first argument is $1"
        description: "Greets with an optional argument"
    hooks:
      'deploy:createDeploymentArtifacts': npm run build-frontend # Example build step
      'package:createPackage': echo "Packaging started for ${self:service} at $(date)"
      'after:deploy:deploy': echo "Deployment completed for ${self:service}! All resources are up."

# Terminal commands to run after setting up serverless.yml
npm install --save serverless-plugin-scripts
serverless hello
serverless greet --param myName # Note: arguments are passed positionally as $1, $2, etc.
serverless deploy

view raw JSON →