Skip to content

Commit bc9005c

Browse files
committed
Updated packages
1 parent d3ec57f commit bc9005c

File tree

7 files changed

+1216
-798
lines changed

7 files changed

+1216
-798
lines changed

.eslintrc.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
'extends': 'airbnb-base',
2+
extends: 'airbnb-base',
33
rules: {
44
'comma-dangle': ['error', 'never'],
55

@@ -12,16 +12,15 @@ module.exports = {
1212
ignoreStrings: true,
1313
ignoreTemplateLiterals: true
1414
}],
15-
// enforce consistent line breaks inside function parentheses
15+
// enforce consistent line breaks inside function parentheses
1616
// https://eslint.org/docs/rules/function-paren-newline
1717
'function-paren-newline': ['error', 'multiline'],
18-
'import/no-unresolved': [{commonjs: true}],
19-
'no-unused-expressions': ["error", { 'allowShortCircuit': true, 'allowTernary': true }],
20-
'object-curly-newline': ['error', { 'multiline': true }],
18+
'import/no-unresolved': ['error', { commonjs: true }],
19+
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
20+
'object-curly-newline': ['error', { multiline: true }],
21+
'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 0, maxEOF: 1 }],
2122
// For logging:
2223
'no-console': 'off'
2324
},
24-
env: {
25-
'node': true
26-
}
25+
env: { node: true }
2726
};

cloud/app-slave-provisioner/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Doc: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ECS.html
2-
const ECS = require('aws-sdk/clients/ecs');
2+
const ECS = require('aws-sdk/clients/ecs'); // eslint-disable-line import/no-unresolved
33

44
const internals = {};
55

@@ -76,7 +76,7 @@ internals.deploySlaves = async (dTOItems, {
7676

7777
const ecs = new ECS({ region: process.env.AWS_REGION });
7878

79-
const browserCounts = dTOItems.map(cV => cV.browser).reduce((accumulator, currentValue) => {
79+
const browserCounts = dTOItems.map((cV) => cV.browser).reduce((accumulator, currentValue) => {
8080
accumulator[currentValue] = 1 + (accumulator[currentValue] || 0);
8181
return accumulator;
8282
}, {});
@@ -100,14 +100,14 @@ internals.deploySlaves = async (dTOItems, {
100100
return itemClone;
101101
});
102102
console.info(`The value of itemsWithExtras is: ${JSON.stringify(itemsWithExtras)}`);
103-
const appItemsWithExtras = itemsWithExtras.map(item => ({
103+
const appItemsWithExtras = itemsWithExtras.map((item) => ({
104104
containerName: item.appSlaveContainerName,
105105
taskDefinition: item.appSlaveTaskDefinition,
106106
ecsServiceName: item.appEcsServiceName,
107107
serviceDiscoveryServiceArn: item.appServiceDiscoveryServiceArn,
108108
containerPort: 8080
109109
}));
110-
const seleniumItemsWithExtras = itemsWithExtras.map(item => ({
110+
const seleniumItemsWithExtras = itemsWithExtras.map((item) => ({
111111
containerName: item.seleniumContainerName,
112112
taskDefinition: item.seleniumTaskDefinition,
113113
ecsServiceName: item.seleniumEcsServiceName,
@@ -117,7 +117,7 @@ internals.deploySlaves = async (dTOItems, {
117117
const splitItemsWithExtras = [...appItemsWithExtras, ...seleniumItemsWithExtras];
118118
console.info(`The value of splitItemsWithExtras is: ${JSON.stringify(splitItemsWithExtras)}`);
119119

120-
const promisedResponses = splitItemsWithExtras.map(cV => ecs.createService({
120+
const promisedResponses = splitItemsWithExtras.map((cV) => ecs.createService({
121121
cluster: customerClusterArn,
122122
serviceName: cV.ecsServiceName,
123123
taskDefinition: cV.taskDefinition,
@@ -133,7 +133,7 @@ internals.deploySlaves = async (dTOItems, {
133133
try {
134134
const resolved = await promiseAllTimeout(promisedResponses, s2ProvisioningTimeout);
135135
console.info(`The data objects returned from calling ecs.createService were: ${JSON.stringify(resolved)}`);
136-
resolved.every(e => !e) && (result.error = 'Timeout exceeded: App Slave container(s) took too long to start. Although they timed out, they may have still started.');
136+
resolved.every((e) => !e) && (result.error = 'Timeout exceeded: App Slave container(s) took too long to start. Although they timed out, they may have still started.');
137137
} catch (e) {
138138
console.error('Exception occurred, details follow:');
139139
console.error(e);

cloud/s2-deprovisioner/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Doc: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ECS.html
2-
const ECS = require('aws-sdk/clients/ecs');
2+
const ECS = require('aws-sdk/clients/ecs'); // eslint-disable-line import/no-unresolved
33

44
const internals = {};
55

@@ -55,7 +55,7 @@ internals.downContainers = async (ecsServiceNames, { clientContext: { Custom: {
5555
const { promiseAllTimeout, s2ProvisioningTimeout } = internals;
5656
const ecs = new ECS({ region: process.env.AWS_REGION });
5757

58-
const promisedResponses = ecsServiceNames.map(sN => ecs.deleteService({
58+
const promisedResponses = ecsServiceNames.map((sN) => ecs.deleteService({
5959
cluster: customerClusterArn,
6060
service: sN,
6161
force: true
@@ -64,7 +64,7 @@ internals.downContainers = async (ecsServiceNames, { clientContext: { Custom: {
6464

6565
console.info(`These are the values returned from ecs.deleteService: ${JSON.stringify(resolved)}`);
6666

67-
return resolved.every(e => !!e)
67+
return resolved.every((e) => !!e)
6868
? { item: `Stage Two ECS services (${JSON.stringify(ecsServiceNames)}) have been brought down.` }
6969
: { error: `Timeout exceeded while attempting to bring the ECS service(s) (${ecsServiceNames}) down. One or more may still be running.` };
7070
};

local/s2-deprovisioner/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ internals.downContainers = async (containerNames) => {
5555
const http = axios.create({ /* default is 0 (no timeout) */ baseURL: 'http://docker-compose-ui:5000/api/v1', headers: { 'Content-type': 'application/json' } });
5656
const s2ProjectNames = [...containerNames];
5757

58-
const promisedResponses = s2ProjectNames.map(pN => http.post('/down', { id: pN }));
58+
const promisedResponses = s2ProjectNames.map((pN) => http.post('/down', { id: pN }));
5959
const resolved = await promiseAllTimeout(promisedResponses, s2ProvisioningTimeout);
6060

61-
return resolved.every(e => !!e)
61+
return resolved.every((e) => !!e)
6262
? { item: `Stage Two projects (${s2ProjectNames}) have been brought down.` }
6363
: { error: `Timeout exceeded while attempting to bring the Stage Two projects (${s2ProjectNames}) down. One or more may still be running.` };
6464
};

local/selenium-standalone-provisioner/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ internals.deploySeleniumStandalones = async (dTOItems) => {
5959

6060
const http = axios.create({ /* default is 0 (no timeout) */ baseURL: 'http://docker-compose-ui:5000/api/v1', headers: { 'Content-type': 'application/json' } });
6161

62-
const browserCounts = dTOItems.map(cV => cV.browser).reduce((accumulator, currentValue) => {
62+
const browserCounts = dTOItems.map((cV) => cV.browser).reduce((accumulator, currentValue) => {
6363
accumulator[currentValue] = 1 + (accumulator[currentValue] || 0);
6464
return accumulator;
6565
}, {});
6666

67-
const promisedResponses = Object.keys(browserCounts).map(b => http.put('/services', { service: b, project: 'selenium-standalone', num: browserCounts[b] }));
67+
const promisedResponses = Object.keys(browserCounts).map((b) => http.put('/services', { service: b, project: 'selenium-standalone', num: browserCounts[b] }));
6868
const resolved = await promiseAllTimeout(promisedResponses, s2ProvisioningTimeout);
6969

70-
resolved.every(e => !e) && (result.error = 'Timeout exceeded: Selenium Standalone container(s) took too long to start. Although they timed out, they may have still started. Also check that docker-compose-ui is up.');
70+
resolved.every((e) => !e) && (result.error = 'Timeout exceeded: Selenium Standalone container(s) took too long to start. Although they timed out, they may have still started. Also check that docker-compose-ui is up.');
7171

7272
const numberOfSeleniumStandaloneServiceNamesToAdd = { ...browserCounts };
7373
const runningCountOfSeleniumStandaloneServiceNamesLeftToAdd = { ...browserCounts };

0 commit comments

Comments
 (0)