Skip to content

Commit 1de53a5

Browse files
committed
formatting js properly
1 parent 5bf0b5e commit 1de53a5

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

index.js

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,41 @@ var AWS_ACCESS_KEY_ID = core.getInput('aws-access-key-id');
1010
var AWS_SECRET_ACCESS_KEY = core.getInput('aws-secret-access-key');
1111

1212

13-
// Exeq Vars
14-
var installDocker = exeq([
15-
'echo Installing docker...',
16-
'sudo apt-get install docker.io -y',
17-
'sudo systemctl unmask docker',
18-
'sudo systemctl start docker'
19-
]);
20-
21-
var installServerlessAndPlugins = exeq([
22-
'echo Installing Serverless and plugins...',
23-
'sudo npm i serverless -g',
24-
'sudo npm i serverless-python-requirements',
25-
'sudo npm i serverless-plugin-canary-deployments'
26-
]);
27-
28-
var runServerlessDeploy = exeq([
29-
`echo Running sudo sls deploy ${ARGS}...`,
30-
`sudo sls config credentials --provider aws --key ${AWS_ACCESS_KEY_ID} --secret ${AWS_SECRET_ACCESS_KEY} ${ARGS}`,
31-
`sudo sls deploy ${ARGS}`
32-
]);
13+
// Reinstalls Docker on Ubuntu
14+
async function installDocker() {
15+
await exeq(
16+
'echo Installing docker...',
17+
'sudo apt-get install docker.io -y',
18+
'sudo systemctl unmask docker',
19+
'sudo systemctl start docker'
20+
);
21+
}
22+
23+
24+
// Installs Serverless and specified plugins
25+
async function installServerlessAndPlugins() {
26+
await exeq(
27+
'echo Installing Serverless and plugins...',
28+
'sudo npm i serverless -g',
29+
'sudo npm i serverless-python-requirements',
30+
'sudo npm i serverless-plugin-canary-deployments'
31+
);
32+
}
33+
34+
35+
// Runs Serverless deploy including any provided args
36+
async function runServerlessDeploy() {
37+
await exeq(
38+
`echo Running sudo sls deploy ${ARGS}...`,
39+
`sudo sls config credentials --provider aws --key ${AWS_ACCESS_KEY_ID} --secret ${AWS_SECRET_ACCESS_KEY} ${ARGS}`,
40+
`sudo sls deploy ${ARGS}`
41+
);
42+
}
3343

3444

3545
// Main function
3646
if (require.main === module) {
37-
installDocker.q.on('done', function() {});
38-
installServerlessAndPlugins.q.on('done', function() {});
39-
runServerlessDeploy.q.on('done', function() {});
47+
installDocker();
48+
installServerlessAndPlugins();
49+
runServerlessDeploy();
4050
}

0 commit comments

Comments
 (0)