-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the `serverless-plugin-scripts` plugin and insert our own custom serverless plugin.
- Loading branch information
Showing
7 changed files
with
98 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/vendor | ||
/.idea | ||
/.phplambda | ||
/node_modules | ||
/.serverless | ||
/bin | ||
/tests/Bridge/Symfony/cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
|
||
const execSync = require('child_process').execSync; | ||
|
||
class PhpServerlessPlugin { | ||
constructor(serverless, options) { | ||
this.serverless = serverless; | ||
this.options = options; | ||
this.hooks = { | ||
'deploy:createDeploymentArtifacts': this.build.bind(this), | ||
}; | ||
} | ||
|
||
/** | ||
* Build step. | ||
*/ | ||
build() { | ||
const service = this.serverless.service; | ||
const scripts = service.custom && service.custom.phpbuild; | ||
|
||
// Download PHP binary | ||
execSync('vendor/bin/phplambda package', {stdio: 'inherit' }); | ||
|
||
// If there are build hooks, execute them | ||
if (scripts instanceof Array) { | ||
for (const script of scripts) { | ||
execSync(script, {stdio: 'inherit' }); | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = PhpServerlessPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
|
||
const execSync = require('child_process').execSync; | ||
|
||
class PhpServerlessPlugin { | ||
constructor(serverless, options) { | ||
this.serverless = serverless; | ||
this.options = options; | ||
this.hooks = { | ||
'deploy:createDeploymentArtifacts': this.build.bind(this), | ||
}; | ||
} | ||
|
||
/** | ||
* Build step. | ||
*/ | ||
build() { | ||
const service = this.serverless.service; | ||
const scripts = service.custom && service.custom.phpbuild; | ||
|
||
// Download PHP binary | ||
execSync('vendor/bin/phplambda package', {stdio: 'inherit' }); | ||
|
||
// If there are build hooks, execute them | ||
if (scripts instanceof Array) { | ||
for (const script of scripts) { | ||
execSync(script, {stdio: 'inherit' }); | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = PhpServerlessPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters