Skip to content

Commit 9ad6ec2

Browse files
committed
Merge branch 'develop', prepare 6.0.2
2 parents 5377e20 + 4052eff commit 9ad6ec2

File tree

13 files changed

+73
-5206
lines changed

13 files changed

+73
-5206
lines changed

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ language: node_js
22

33
node_js: lts/erbium
44

5-
cache: yarn
5+
cache: npm
66

77
script:
8-
- yarn test
9-
- yarn lint
8+
- npm test
9+
- npm run lint
1010

1111
after_success:
12-
- yarn coveralls
13-
- yarn build
14-
- yarn package
12+
- npm run coveralls
13+
- npm run build
14+
- npm run package
1515

1616
deploy:
1717
- provider: releases
18-
skip_cleanup: true
18+
edge: true
1919
api_key:
2020
secure: cX62q8fanA+1BXidpVobsx6vkmD7mI7STJN2b/zD9TxLKa7EY4MpSI8t3JFnW0EaUxbiIwTJEjeftfDJhxey0kPvPgUxEAf3h5V7IoO6KSmCZ0I8xYdnNbMtKNBJqNj5USHupWyK5geZbIQ+GtjCr0k07G7Sm1zz9SaV3pmB/FZpPFsev8TukUPrGMyfa6AThS32EJXrNSTDEcewaxrCQN+5PylWlACKZ72v1MUBa9Lzxs7Rfd9god0jFqw29EBuCkpqmvgpThdG2sT0wFgAlodBFnW/DeVRyyfciAbLiMUKPTErNCbH51Hcndh3Wi7lGpjqhk+UeU9rMuF7br+BnmHy0eqr+vBAFSaVxnornrsebX0qO+Vgd/accM0VgI6UzIbrEZeRtKYpkZAf1y+gYFOA3ThafEp3PBBSJz1RI6hP03VuPx4GS2qCDfLm9nWBHR/pKMc9MAUuGiaEmeSXWwUGxLpM+B/9vzJGHrywSUXM/9NLb0Tqd35HElPKp2Vv39dYSASC/XQIhW696Gt2Ewkrg4Cqx5RTn7WlJBWXAvryVMDtOiZzgdaqk5aOUMie3Qe5bH5M6lwEGp/Rbo9rCFtSXDPQMbxiQrUuBVt3u0lX4BTynKVWagpDDfuOTm1Fl4CY50dwvmuZZmmtK0GLLQ/POL7LiOhX1XUoL4WL1sU=
2121
file:
@@ -27,15 +27,15 @@ deploy:
2727
repo: exoframejs/exoframe
2828
- provider: npm
2929
30-
skip_cleanup: true
30+
edge: true
3131
api_key:
3232
secure: qAIUnXMdpq7+rEch+hhWehdEpDMd1ZxjMwvlr3QuNkYH3SAgmB9aDeAgcjcOR/gZysH5dXU5s/7paMAur/CnHD7fqapkk01QWjusi4Z+xzznnX0srvysaYg2Eaev6SM666aWtrzxVSZw8aX1BH5k8wjzoNLQ5ARGSKpMRtjXsWkz9RczglgY6vSyz8vuJ+Bw5qlFfiIHt3tI7Ns5NgqkdSTSexX6YaKzZqdv0SNvZu8bCFhUPrE4VmgLVtKGno4ML7sodFEOEs65fPRrznjQW0M5mO9hYGmfU36W4VwXoDr8miBb/dXSjb9Hm/nX3vtf90HtuIb2noxCPLGWku7/NQj76JSzp9PS1X17w7glj/+b5tJsG5V2VRwO0Ta+MnO/0mH2Wbk9K57ZprTVnNirrRX4hYMfn1QPAJEpdSsNpOgTr/LyXbDf1sG84F6337tbJWr3bq1v9go3W3c87Ara32c006NzfXtqC+79+chJi9YqEG6kla6PLj2pdYR9yr2QsYRJo61DG5+xUeHQXQDCLy/f9kpaS24DRlziilqfIzgET+l+TeRtNN18aZAjKFNCKPdtAfPlIWA03LLwG+2KGAP4UfzRIrdIROPDZ9k6Y9/bFKNM3UNF7GBHP9p3rFAQ6yhuOL7BzA/U27E57sU+ZtJQP0iVT9EmjNzQyg/vkzU=
3333
on:
3434
tags: true
3535
repo: exoframejs/exoframe
3636
- provider: npm
3737
38-
skip_cleanup: true
38+
edge: true
3939
tag: next
4040
api_key:
4141
secure: qAIUnXMdpq7+rEch+hhWehdEpDMd1ZxjMwvlr3QuNkYH3SAgmB9aDeAgcjcOR/gZysH5dXU5s/7paMAur/CnHD7fqapkk01QWjusi4Z+xzznnX0srvysaYg2Eaev6SM666aWtrzxVSZw8aX1BH5k8wjzoNLQ5ARGSKpMRtjXsWkz9RczglgY6vSyz8vuJ+Bw5qlFfiIHt3tI7Ns5NgqkdSTSexX6YaKzZqdv0SNvZu8bCFhUPrE4VmgLVtKGno4ML7sodFEOEs65fPRrznjQW0M5mO9hYGmfU36W4VwXoDr8miBb/dXSjb9Hm/nX3vtf90HtuIb2noxCPLGWku7/NQj76JSzp9PS1X17w7glj/+b5tJsG5V2VRwO0Ta+MnO/0mH2Wbk9K57ZprTVnNirrRX4hYMfn1QPAJEpdSsNpOgTr/LyXbDf1sG84F6337tbJWr3bq1v9go3W3c87Ara32c006NzfXtqC+79+chJi9YqEG6kla6PLj2pdYR9yr2QsYRJo61DG5+xUeHQXQDCLy/f9kpaS24DRlziilqfIzgET+l+TeRtNN18aZAjKFNCKPdtAfPlIWA03LLwG+2KGAP4UfzRIrdIROPDZ9k6Y9/bFKNM3UNF7GBHP9p3rFAQ6yhuOL7BzA/U27E57sU+ZtJQP0iVT9EmjNzQyg/vkzU=

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "exoframe",
3-
"version": "6.0.1",
3+
"version": "6.0.6-dev",
44
"description": "Exoframe is a self-hosted tool that allows simple one-command deployments using Docker",
55
"main": "dist/index.js",
66
"repository": "[email protected]:exoframejs/exoframe.git",
@@ -23,24 +23,24 @@
2323
},
2424
"dependencies": {},
2525
"devDependencies": {
26-
"@zeit/ncc": "^0.20.5",
26+
"@zeit/ncc": "^0.21.0",
2727
"apache-md5": "^1.1.2",
2828
"babel-eslint": "^10.0.3",
29-
"chalk": "^2.4.2",
29+
"chalk": "^3.0.0",
3030
"cli-table3": "^0.5.1",
3131
"coveralls": "^3.0.7",
3232
"eslint": "^6.6.0",
3333
"eslint-config-prettier": "^6.5.0",
3434
"eslint-config-standard": "^14.1.0",
3535
"eslint-plugin-import": "^2.18.2",
36-
"eslint-plugin-node": "^10.0.0",
36+
"eslint-plugin-node": "^11.0.0",
3737
"eslint-plugin-prettier": "^3.1.1",
3838
"eslint-plugin-promise": "^4.2.1",
3939
"eslint-plugin-standard": "^4.0.1",
40-
"got": "^9.6.0",
40+
"got": "^10.4.0",
4141
"highland": "^2.13.5",
4242
"inquirer": "^7.0.0",
43-
"jest": "^24.9.0",
43+
"jest": "^25.1.0",
4444
"js-yaml": "^3.13.1",
4545
"jsonwebtoken": "^8.5.1",
4646
"latest-version": "^5.1.0",
@@ -52,9 +52,9 @@
5252
"pkg": "^4.4.0",
5353
"prettier": "^1.18.2",
5454
"semver-diff": "^3.1.1",
55-
"sinon": "^7.5.0",
55+
"sinon": "^8.1.1",
5656
"tar-fs": "^2.0.0",
57-
"yargs": "^14.2.0"
57+
"yargs": "^15.1.0"
5858
},
5959
"jest": {
6060
"testEnvironment": "node"

src/commands/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ exports.handler = async (args = {}) => {
257257
} catch (e) {
258258
spinner && spinner.fail('Deployment failed!');
259259
// if authorization is expired/broken/etc
260-
if (e.statusCode === 401) {
260+
if (e.response.statusCode === 401) {
261261
logout(userConfig);
262262
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
263263
return process.exit(1);

src/commands/list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports.handler = async () => {
2121
headers: {
2222
Authorization: `Bearer ${userConfig.token}`,
2323
},
24-
json: true,
24+
responseType: 'json',
2525
};
2626
// try sending request
2727
let containers = [];

src/commands/login.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ exports.handler = async ({key, passphrase, url}) => {
8989
let phrase;
9090
let loginReqId;
9191
try {
92-
const {body} = await got(remoteUrl, {json: true});
92+
const {body} = await got(remoteUrl, {responseType: 'json'});
9393
phrase = body.phrase;
9494
loginReqId = body.uid;
9595
if (!phrase || !loginReqId) {
@@ -137,12 +137,13 @@ exports.handler = async ({key, passphrase, url}) => {
137137
try {
138138
const user = {username};
139139
const {body} = await got(remoteUrl, {
140-
body: {
140+
method: 'POST',
141+
json: {
141142
user,
142143
token: reqToken,
143144
requestId: loginReqId,
144145
},
145-
json: true,
146+
responseType: 'json',
146147
});
147148
// check for errors
148149
if (!body || !body.token) {

src/commands/remove.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ exports.handler = async (args = {}) => {
3737
headers: {
3838
Authorization: `Bearer ${authToken}`,
3939
},
40-
body: {},
41-
json: true,
40+
json: {},
4241
};
4342
// try sending request
4443
try {
@@ -50,14 +49,14 @@ exports.handler = async (args = {}) => {
5049
}
5150
} catch (e) {
5251
// if authorization is expired/broken/etc
53-
if (e.statusCode === 401) {
52+
if (e.response.statusCode === 401) {
5453
logout(userConfig);
5554
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
5655
return;
5756
}
5857

5958
// if container was not found
60-
if (e.statusCode === 404) {
59+
if (e.response.statusCode === 404) {
6160
console.log(
6261
chalk.red('Error: container or function was not found!'),
6362
'Please, check deployment ID and try again.'

src/commands/secrets.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exports.handler = async args => {
4545
headers: {
4646
Authorization: `Bearer ${userConfig.token}`,
4747
},
48-
json: true,
48+
responseType: 'json',
4949
};
5050
// try sending request
5151
let secrets = [];
@@ -54,7 +54,7 @@ exports.handler = async args => {
5454
secrets = body.secrets;
5555
} catch (e) {
5656
// if authorization is expired/broken/etc
57-
if (e.statusCode === 401) {
57+
if (e.response.statusCode === 401) {
5858
logout(userConfig);
5959
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
6060
return;
@@ -114,15 +114,15 @@ exports.handler = async args => {
114114
headers: {
115115
Authorization: `Bearer ${userConfig.token}`,
116116
},
117-
json: true,
117+
responseType: 'json',
118118
};
119119
let secret;
120120
try {
121121
const {body} = await got(`${remoteUrl}/${selectedSecret}`, options);
122122
secret = body.secret;
123123
} catch (e) {
124124
// if authorization is expired/broken/etc
125-
if (e.statusCode === 401) {
125+
if (e.response.statusCode === 401) {
126126
logout(userConfig);
127127
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
128128
return;
@@ -147,8 +147,8 @@ exports.handler = async args => {
147147
headers: {
148148
Authorization: `Bearer ${userConfig.token}`,
149149
},
150-
json: true,
151-
body: {
150+
responseType: 'json',
151+
json: {
152152
secretName: selectedSecret,
153153
},
154154
};
@@ -161,7 +161,7 @@ exports.handler = async args => {
161161
console.log(chalk.green('Deployment secret successfully removed!'));
162162
} catch (e) {
163163
// if authorization is expired/broken/etc
164-
if (e.statusCode === 401) {
164+
if (e.response.statusCode === 401) {
165165
logout(userConfig);
166166
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
167167
return;
@@ -206,8 +206,8 @@ exports.handler = async args => {
206206
headers: {
207207
Authorization: `Bearer ${userConfig.token}`,
208208
},
209-
json: true,
210-
body: {
209+
responseType: 'json',
210+
json: {
211211
secretName,
212212
secretValue,
213213
},
@@ -223,7 +223,7 @@ exports.handler = async args => {
223223
console.log(chalk.green('DONE!'));
224224
} catch (e) {
225225
// if authorization is expired/broken/etc
226-
if (e.statusCode === 401) {
226+
if (e.response.statusCode === 401) {
227227
logout(userConfig);
228228
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
229229
return;

src/commands/setup.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports.handler = async args => {
3232
headers: {
3333
Authorization: `Bearer ${userConfig.token}`,
3434
},
35-
json: true,
35+
responseType: 'json',
3636
};
3737

3838
console.log(chalk.bold('Setting new deployment using recipe at:'), userConfig.endpoint);
@@ -55,9 +55,10 @@ exports.handler = async args => {
5555
// ask for questions for this recipe
5656
const options = Object.assign({}, baseOptions, {
5757
method: 'GET',
58-
query: {
58+
searchParams: {
5959
recipeName,
6060
},
61+
responseType: 'json',
6162
});
6263

6364
// show loader
@@ -93,10 +94,11 @@ exports.handler = async args => {
9394
// send answers and execute recipe
9495
const answerOptions = Object.assign({}, baseOptions, {
9596
method: 'POST',
96-
body: {
97+
json: {
9798
recipeName,
9899
answers,
99100
},
101+
responseType: 'json',
100102
});
101103

102104
const {body: finalBody} = await got(remoteUrl, answerOptions);
@@ -119,7 +121,7 @@ exports.handler = async args => {
119121
} catch (e) {
120122
spinner.fail('Recipe execution failed!');
121123
// if authorization is expired/broken/etc
122-
if (e.statusCode === 401) {
124+
if (e.response.statusCode === 401) {
123125
logout(userConfig);
124126
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
125127
return;

src/commands/template.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ exports.handler = async args => {
3535
headers: {
3636
Authorization: `Bearer ${userConfig.token}`,
3737
},
38-
json: true,
38+
responseType: 'json',
3939
};
4040

4141
// if remove or ls - fetch tokens from remote, then do work
@@ -48,11 +48,11 @@ exports.handler = async args => {
4848
// try sending request
4949
let templates = [];
5050
try {
51-
const {body} = await got(remoteUrl, baseOptions);
51+
const {body} = await got(remoteUrl, {...baseOptions});
5252
templates = body;
5353
} catch (e) {
5454
// if authorization is expired/broken/etc
55-
if (e.statusCode === 401) {
55+
if (e.response.statusCode === 401) {
5656
logout(userConfig);
5757
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
5858
return;
@@ -98,12 +98,14 @@ exports.handler = async args => {
9898
const {rmTemplate} = await inquirer.prompt(prompts);
9999

100100
// construct shared request params
101-
const rmOptions = Object.assign(baseOptions, {
101+
const rmOptions = {
102+
...baseOptions,
102103
method: 'DELETE',
103-
body: {
104+
json: {
104105
templateName: rmTemplate,
105106
},
106-
});
107+
responseType: 'json',
108+
};
107109
try {
108110
const {body} = await got(remoteUrl, rmOptions);
109111
if (!body.removed) {
@@ -119,7 +121,7 @@ exports.handler = async args => {
119121
console.log(chalk.green('Template successfully removed!'));
120122
} catch (e) {
121123
// if authorization is expired/broken/etc
122-
if (e.statusCode === 401) {
124+
if (e.response.statusCode === 401) {
123125
logout(userConfig);
124126
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
125127
return;
@@ -146,12 +148,14 @@ exports.handler = async args => {
146148
const {templateName} = await inquirer.prompt(prompts);
147149

148150
// construct shared request params
149-
const options = Object.assign(baseOptions, {
151+
const options = {
152+
...baseOptions,
150153
method: 'POST',
151-
body: {
154+
json: {
152155
templateName,
153156
},
154-
});
157+
responseType: 'json',
158+
};
155159

156160
// show loader
157161
const spinner = ora('Installing new template...').start();
@@ -176,7 +180,7 @@ exports.handler = async args => {
176180
} catch (e) {
177181
spinner.fail('Template install failed!');
178182
// if authorization is expired/broken/etc
179-
if (e.statusCode === 401) {
183+
if (e.response.statusCode === 401) {
180184
logout(userConfig);
181185
console.log(chalk.red('Error: authorization expired!'), 'Please, relogin and try again.');
182186
return;

0 commit comments

Comments
 (0)