ProjectCreate: Remove apiFunctionAlias from project.stage.region objects.

Project/Stage/Region: Replace projectBucket term w/ regionBucket
This commit is contained in:
Austen Collins 2015-12-04 16:35:26 -08:00
parent 5766cc8772
commit cd281f62a9
3 changed files with 12 additions and 19 deletions

View File

@ -350,7 +350,7 @@ class ProjectCreate extends SPlugin {
}
// Set Serverless Regional Bucket
this._projectBucket = SUtils.generateRegionBucketName(this.evt.region, this.evt.domain);
this._regionBucket = SUtils.generateRegionBucketName(this.evt.region, this.evt.domain);
return BbPromise.resolve();
}
@ -404,8 +404,8 @@ class ProjectCreate extends SPlugin {
*/
_createProjectBucket() {
SCli.log('Creating a project region bucket on S3: ' + this._projectBucket + '...');
return this.S3.sCreateBucket(this._projectBucket);
SCli.log('Creating a project region bucket on S3: ' + this._regionBucket + '...');
return this.S3.sCreateBucket(this._regionBucket);
}
/**
@ -419,7 +419,7 @@ class ProjectCreate extends SPlugin {
SERVERLESS_DATA_MODEL_STAGE=${stage}`;
return this.S3.sPutEnvFile(
this._projectBucket,
this._regionBucket,
this.evt.name,
this.evt.stage,
envFileContents);
@ -432,7 +432,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`;
_putCfFile() {
return this.CF.sPutCfFile(
this._projectRootPath,
this._projectBucket,
this._regionBucket,
this.evt.name,
this.evt.stage,
'resources');
@ -502,8 +502,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`;
prjJson.stages[_this.evt.stage] = [{
region: _this.evt.region,
iamRoleArnLambda: iamRoleArnLambda || '',
regionBucket: _this._projectBucket,
apiFunctionAlias: 'LATEST',
regionBucket: _this._regionBucket
}];
prjJson.name = _this.evt.name;

View File

@ -311,13 +311,8 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`;
region: _this.evt.region,
iamRoleArnLambda: '',
regionBucket: _this.evt.projectBucket,
apiFunctionAlias: 'LATEST',
};
// Get apiFunctionAlias from another region in this stage
let region = _this.S._projectJson.stages[_this.evt.stage][0];
if (region.apiFunctionAlias) regionObj.apiFunctionAlias = region.apiFunctionAlias;
if (cfStackData) {
for (let i = 0; i < cfStackData.Outputs.length; i++) {
if (cfStackData.Outputs[i].OutputKey === 'IamRoleArnLambda') {

View File

@ -260,9 +260,9 @@ usage: serverless stage create`,
_createProjectBucket() {
this._projectBucket = SUtils.generateRegionBucketName(this.evt.stage, this.evt.region, this.S._projectJson.domain);
SCli.log('Creating a region bucket on S3: ' + this._projectBucket + '...');
return this.S3.sCreateBucket(this._projectBucket);
this._regionBucket = SUtils.generateRegionBucketName(this.evt.stage, this.evt.region, this.S._projectJson.domain);
SCli.log('Creating a region bucket on S3: ' + this._regionBucket + '...');
return this.S3.sCreateBucket(this._regionBucket);
}
@ -278,7 +278,7 @@ usage: serverless stage create`,
SERVERLESS_DATA_MODEL_STAGE=${stage}`;
return this.S3.sPutEnvFile(
this._projectBucket,
this._regionBucket,
this.S._projectJson.name,
this.evt.stage,
envFileContents);
@ -291,7 +291,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`;
_putCfFile() {
return this.CF.sPutCfFile(
this.S._projectRootPath,
this._projectBucket,
this._regionBucket,
this.S._projectJson.name,
this.evt.stage,
'resources');
@ -345,8 +345,7 @@ SERVERLESS_DATA_MODEL_STAGE=${stage}`;
regionObj = {
region: _this.evt.region,
iamRoleArnLambda: '',
regionBucket: _this._projectBucket,
apiFunctionAlias: 'LATEST',
regionBucket: _this._regionBucket,
};
if (cfStackData) {