Replies: 1 comment 1 reply
-
Creating a plugin to skip deployments as soon as possible in the Serverless Framework can be a bit tricky because the framework itself is designed to follow a specific deployment process, which includes multiple hooks and stages. To achieve your goal of skipping the deployment as soon as possible based on whether there are changes in the last git commit, you can follow these steps: Install the required npm packages for Git interaction and make sure you have git installed on your system. const simpleGit = require('simple-git/promise'); class ServerlessSkipPlugin {
} async skipDeployment() {
} beforePackageInitialize() { module.exports = ServerlessSkipPlugin; Modify your serverless.yml to include the plugin and add a custom command to skip the deployment. plugins:
custom: functions: ...Add this custom command to your serverless.ymlcustom: Now, you can use the serverless skip command to check for changes in the last Git commit and skip the deployment if no changes are found. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to create a plugin to skip deployments as soon as possible?
I tried the following, but the
shouldNotDeploy
variable is reseted by theaws:deploy:deploy:checkForChange
hook.I want to create a plugin that checks if last git commit had changes to the service, otherwise I want to skip the deployment ASAP.
Beta Was this translation helpful? Give feedback.
All reactions