Comparing version 0.2.2 to 0.3.1
@@ -50,3 +50,3 @@ const util = require('./util/util'); | ||
}) | ||
.then(() => deployLifecycle.deployServicesInLevel(serviceDeployers, environmentContext, preDeployContexts, deployContexts, deployOrder, currentLevel)) //TODO - MAKE SURE WE ARE RETURNING THE CORRECT THING HERE | ||
.then(() => deployLifecycle.deployServicesInLevel(serviceDeployers, environmentContext, preDeployContexts, deployContexts, deployOrder, currentLevel)) | ||
.then(levelDeployResults => { | ||
@@ -67,3 +67,2 @@ for(let serviceName in levelDeployResults) { | ||
function setupEventBindings(serviceDeployers, environmentContext, deployContexts) { | ||
winston.info("Setting up event bindings between services (if any)"); | ||
return consumeEventsLifecycle.consumeEvents(serviceDeployers, environmentContext, deployContexts) | ||
@@ -118,3 +117,53 @@ .then(consumeEventsContexts => { | ||
exports.deploy = function(newAccountConfig, handelFilePath, environmentsToDeploy, deployVersion) { | ||
exports.check = function(handelFile, environmentsToDeploy, deployVersion) { | ||
//Use fake account config | ||
config({ | ||
account_id: 111111111111, | ||
region: 'us-west-2', | ||
vpc: 'vpc-aaaaaaaa', | ||
public_subnets: [ | ||
'subnet-ffffffff', | ||
'subnet-44444444' | ||
], | ||
private_subnets: [ | ||
'subnet-00000000', | ||
'subnet-77777777' | ||
], | ||
data_subnets: [ | ||
'subnet-eeeeeeee', | ||
'subnet-99999999' | ||
], | ||
ecs_ami: 'ami-66666666', | ||
ssh_bastion_sg: 'sg-44444444', | ||
on_prem_cidr: '10.10.10.10/0' | ||
}).getAccountConfig(); | ||
//Load all the currently implemented service deployers from the 'services' directory | ||
let serviceDeployers = util.getServiceDeployers(); | ||
//Load Handel file from path and validate it | ||
winston.info("Validating and parsing Handel file"); | ||
let handelFileParser = util.getHandelFileParser(handelFile); | ||
handelFileParser.validateHandelFile(handelFile, serviceDeployers); | ||
let foundErrors = false; | ||
for(let environmentToCheck in handelFile.environments) { | ||
let environmentContext = createEnvironmentContext(handelFile, handelFileParser, environmentToCheck, "1"); //Use fake version of deploy_version | ||
let errors = checkLifecycle.checkServices(serviceDeployers, environmentContext); | ||
if(errors.length > 0) { | ||
winston.error(`The following errors were found for env ${environmentToCheck}`); | ||
console.log(" " + errors.join("\n ")); | ||
foundErrors = true; | ||
} | ||
} | ||
if(!foundErrors) { | ||
winston.info("No errors were found when checking Handel file"); | ||
} | ||
} | ||
exports.delete = function() { | ||
} | ||
exports.deploy = function(newAccountConfig, handelFile, environmentsToDeploy, deployVersion) { | ||
return new Promise((resolve, reject) => { | ||
@@ -133,3 +182,2 @@ try { | ||
winston.info("Validating and parsing Handel file"); | ||
let handelFile = util.readYamlFileSync(handelFilePath); | ||
let handelFileParser = util.getHandelFileParser(handelFile); | ||
@@ -136,0 +184,0 @@ handelFileParser.validateHandelFile(handelFile, serviceDeployers); |
@@ -9,3 +9,2 @@ const winston = require('winston'); | ||
_.forEach(environmentContext.serviceContexts, function(serviceContext) { | ||
winston.info(`Checking service ${serviceContext.serviceName}`); | ||
let serviceDeployer = serviceDeployers[serviceContext.serviceType]; | ||
@@ -12,0 +11,0 @@ let checkErrors = serviceDeployer.check(serviceContext); |
@@ -6,4 +6,4 @@ const iamCalls = require('../aws/iam-calls'); | ||
const fs = require('fs'); | ||
const uuid = require('uuid'); | ||
const util = require('../util/util'); | ||
const os = require('os'); | ||
@@ -153,3 +153,3 @@ /** | ||
if (fileStats.isDirectory()) { //Zip up artifact | ||
let zippedPath = `/tmp/${s3FileName}.zip`; | ||
let zippedPath = `${os.tmpdir()}/${s3FileName}.zip`; | ||
return util.zipDirectoryToFile(pathToArtifact, zippedPath) | ||
@@ -156,0 +156,0 @@ .then(() => { |
{ | ||
"name": "handel", | ||
"version": "0.2.2", | ||
"version": "0.3.1", | ||
"description": "Simple orchestration of your AWS deployments", | ||
@@ -20,6 +20,6 @@ "main": "lib/handel.js", | ||
"bluebird": "^3.5.0", | ||
"commander": "^2.9.0", | ||
"handlebars": "^4.0.6", | ||
"js-yaml": "3.7.0", | ||
"lodash": "^4.17.4", | ||
"minimist": "^1.2.0", | ||
"rand-token": "^0.3.0", | ||
@@ -26,0 +26,0 @@ "request": "^2.81.0", |
@@ -8,2 +8,3 @@ const accountConfig = require('../lib/util/account-config')(`${__dirname}/test-account-config.yml`).getAccountConfig(); | ||
const PreDeployContext = require('../lib/datatypes/pre-deploy-context'); | ||
const util = require('../lib/util/util'); | ||
const sinon = require('sinon'); | ||
@@ -32,4 +33,4 @@ const expect = require('chai').expect; | ||
let deployServicesInlevelStub = sandbox.stub(deployLifecycle, 'deployServicesInLevel').returns({}); | ||
return handel.deploy(`${__dirname}/test-account-config.yml`, `${__dirname}/test-handel.yml`, ["dev", "prod"], "1") | ||
let handelFile = util.readYamlFileSync(`${__dirname}/test-handel.yml`); | ||
return handel.deploy(`${__dirname}/test-account-config.yml`, handelFile, ["dev", "prod"], "1") | ||
.then(results => { | ||
@@ -36,0 +37,0 @@ expect(checkServicesStub.calledTwice).to.be.true; |
Sorry, the diff of this file is not supported yet
689808
134
11211
17
+ Addedminimist@^1.2.0
- Removedcommander@^2.9.0
- Removedcommander@2.20.3(transitive)