Skip to content

Commit

Permalink
Add python packaging call
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansb committed Jan 23, 2016
1 parent 54055d1 commit d0f2a10
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions lib/actions/FunctionDeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,22 +268,20 @@ module.exports = function(SPlugin, serverlessPath) {
func = _this.S.state.getFunctions({ paths: [path] })[0];
if (!func) throw new SError(`Function could not be found: ${path}`);

let newEvt = {
options: {
stage: _this.evt.options.stage,
region: region,
path: path
}
};

// Nodejs
if (func.getRuntime() === 'nodejs') {

let newEvt = {
options: {
stage: _this.evt.options.stage,
region: region,
path: path
}
};

// Package Code
return _this.S.actions.codePackageLambdaNodejs(newEvt)
.bind(_this)
.then(function(result) {

let newEvt = {
options: {
stage: result.options.stage,
Expand All @@ -297,6 +295,27 @@ module.exports = function(SPlugin, serverlessPath) {
// Deploy Code
return _this.S.actions.codeDeployLambdaNodejs(newEvt);
});
} else if (func.getRuntime() === 'python2.7') {
// Python time
return _this.S.actions.codePackageLambdaPython2(newEvt)
.bind(_this)
.then(function(result) {
let newEvt = {
options: {
stage: result.options.stage,
region: result.options.region,
path: path,
pathDist: result.data.pathDist,
pathsPackaged: result.data.pathsPackaged
}
};

// Deploy Code
return null;
return _this.S.actions.codeDeployLambdaPython2(newEvt);
});
} else {
SCli.log('Function runtime not detected - cannot deploy function');
}
})
.then(function(result) {
Expand Down

0 comments on commit d0f2a10

Please sign in to comment.