deploy.sh 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +36 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +105 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +56 -0
- package/.github/workflows/ci.yml +15 -34
- package/.github/workflows/pages.yml +48 -0
- package/.oxfmtrc.json +7 -0
- package/.oxlintrc.json +11 -0
- package/LICENSE +183 -183
- package/README.md +99 -10
- package/app/actions/deployments.ts +82 -0
- package/app/actions/metrics.ts +13 -0
- package/app/root.tsx +60 -0
- package/app/routes/dashboard/detail/history.tsx +73 -0
- package/app/routes/dashboard/detail/layout.tsx +125 -0
- package/app/routes/dashboard/detail/logs.tsx +85 -0
- package/app/routes/dashboard/detail/overview.tsx +119 -0
- package/app/routes/dashboard/detail/requests.tsx +163 -0
- package/app/routes/dashboard/detail/resources.tsx +268 -0
- package/app/routes/dashboard/detail/shared.tsx +59 -0
- package/app/routes/dashboard/index.tsx +360 -0
- package/app/routes/dashboard/layout.tsx +30 -0
- package/app/routes/docs/architecture.tsx +155 -0
- package/app/routes/docs/cli.tsx +122 -0
- package/app/routes/docs/deploying.tsx +105 -0
- package/app/routes/docs/index.tsx +104 -0
- package/app/routes/docs/layout.tsx +58 -0
- package/app/routes/home.tsx +134 -0
- package/app/routes/root.client.tsx +46 -0
- package/app/routes.ts +21 -0
- package/app/styles.css +15 -0
- package/app/theme.css +134 -0
- package/bin/deploy.js +362 -138
- package/docs-site/404.html +33 -0
- package/docs-site/home.tsx +130 -0
- package/docs-site/index.html +35 -0
- package/docs-site/layout.tsx +57 -0
- package/docs-site/main.tsx +41 -0
- package/docs-site/shell.tsx +34 -0
- package/docs-site/styles.css +4 -0
- package/drizzle.config.js +8 -0
- package/examples/docker/Dockerfile +5 -5
- package/examples/docker/server.js +18 -0
- package/examples/node/package.json +3 -11
- package/examples/node/pnpm-lock.yaml +9 -0
- package/examples/node/server.js +12 -0
- package/examples/static/index.html +41 -15
- package/package.json +40 -64
- package/public/favicon.ico +0 -0
- package/react-router-vite/entry.browser.tsx +49 -0
- package/react-router-vite/entry.rsc.single.tsx +7 -0
- package/react-router-vite/entry.rsc.tsx +36 -0
- package/react-router-vite/entry.ssr.tsx +29 -0
- package/react-router-vite/plugin.ts +114 -0
- package/react-router-vite/types.d.ts +11 -0
- package/react-router.config.ts +5 -0
- package/server/api.test.ts +344 -0
- package/server/api.ts +445 -0
- package/server/docker.ts +268 -0
- package/server/index.ts +17 -0
- package/server/metrics-collector.ts +29 -0
- package/server/schema.ts +56 -0
- package/server/store.test.ts +278 -0
- package/server/store.ts +398 -0
- package/tsconfig.json +21 -0
- package/vite.config.ts +45 -0
- package/vite.docs.config.ts +31 -0
- package/.eslintignore +0 -6
- package/.eslintrc +0 -12
- package/.husky/pre-commit +0 -5
- package/.prettierrc +0 -0
- package/.release-it.json +0 -5
- package/CHANGELOG.md +0 -56
- package/__tests__/fixtures/unknown/.gitkeep +0 -0
- package/__tests__/lib/classifier.test.js +0 -49
- package/__tests__/lib/helpers/util.test.js +0 -57
- package/bin/deploy-delete.js +0 -14
- package/bin/deploy-deploy.js +0 -36
- package/bin/deploy-list.js +0 -40
- package/bin/deploy-login.js +0 -43
- package/bin/deploy-logout.js +0 -16
- package/bin/deploy-logs.js +0 -26
- package/bin/deploy-open.js +0 -26
- package/bin/deploy-register.js +0 -45
- package/bin/deploy-server.js +0 -11
- package/bin/deploy-whoami.js +0 -14
- package/examples/docker/index.js +0 -12
- package/examples/node/index.js +0 -8
- package/examples/static/main.css +0 -9
- package/examples/static/out.gifcd +0 -0
- package/generate-docs.js +0 -55
- package/index.js +0 -69
- package/jsdoc.json +0 -27
- package/lib/classifier.js +0 -63
- package/lib/deploy.js +0 -70
- package/lib/helpers/cli.js +0 -262
- package/lib/helpers/util.js +0 -140
- package/lib/models/deployment.js +0 -474
- package/lib/models/request.js +0 -101
- package/lib/models/user.js +0 -147
- package/lib/server.js +0 -211
- package/lib/static/not-found.html +0 -30
- package/lib/static/page-could-not-load.html +0 -30
- package/lib/static/static-server.js +0 -70
- package/website/README.md +0 -41
- package/website/babel.config.js +0 -3
- package/website/docs/api/_category_.yml +0 -1
- package/website/docs/api/lib/classifier.js.md +0 -11
- package/website/docs/api/lib/deploy.js.md +0 -13
- package/website/docs/api/lib/helpers/cli.js.md +0 -193
- package/website/docs/api/lib/helpers/util.js.md +0 -65
- package/website/docs/api/lib/models/deployment.js.md +0 -171
- package/website/docs/api/lib/models/request.js.md +0 -67
- package/website/docs/api/lib/models/user.js.md +0 -92
- package/website/docs/api/lib/server.js.md +0 -0
- package/website/docs/api/lib/static/static-server.js.md +0 -0
- package/website/docs/intro.md +0 -57
- package/website/docusaurus.config.js +0 -82
- package/website/package-lock.json +0 -25218
- package/website/package.json +0 -39
- package/website/sidebars.js +0 -31
- package/website/src/components/HomepageFeatures/index.js +0 -79
- package/website/src/components/HomepageFeatures/styles.module.css +0 -11
- package/website/src/css/custom.css +0 -39
- package/website/src/pages/index.js +0 -57
- package/website/src/pages/index.module.css +0 -23
- package/website/static/.nojekyll +0 -0
- package/website/static/example.gif +0 -0
- package/website/static/example.mov +0 -0
- package/website/static/img/favicon.ico +0 -0
- package/website/static/img/intro/deploy.png +0 -0
- package/website/static/img/intro/logs.png +0 -0
- package/website/static/img/logo.png +0 -0
- package/website/static/img/logo.pxm +0 -0
- package/website/static/img/logo@2x.png +0 -0
package/lib/server.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import formidable from "formidable";
|
|
3
|
-
import bodyParser from "body-parser";
|
|
4
|
-
|
|
5
|
-
const app = express();
|
|
6
|
-
|
|
7
|
-
import deploy from "./deploy.js";
|
|
8
|
-
import User from "./models/user.js";
|
|
9
|
-
import Deployment from "./models/deployment.js";
|
|
10
|
-
import Request from "./models/request.js";
|
|
11
|
-
|
|
12
|
-
const port = process.env.PORT || 5000;
|
|
13
|
-
|
|
14
|
-
app.use(bodyParser.urlencoded({ extended: false }));
|
|
15
|
-
app.use(bodyParser.json());
|
|
16
|
-
|
|
17
|
-
const asyncMiddleware = (fn) => {
|
|
18
|
-
return (req, res, next) => {
|
|
19
|
-
Promise.resolve(fn(req, res, next)).catch(next);
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const formidablePromise = (req, opts) => {
|
|
24
|
-
return new Promise(function (resolve, reject) {
|
|
25
|
-
var form = new formidable.IncomingForm(opts);
|
|
26
|
-
form.parse(req, function (err, fields, files) {
|
|
27
|
-
if (err) return reject(err);
|
|
28
|
-
resolve({ fields: fields, files: files });
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
app.post(
|
|
34
|
-
"/register",
|
|
35
|
-
asyncMiddleware(async (req, res) => {
|
|
36
|
-
const { username, password } = req.body;
|
|
37
|
-
|
|
38
|
-
console.log(username, password);
|
|
39
|
-
if (!username || !password)
|
|
40
|
-
return res
|
|
41
|
-
.status(500)
|
|
42
|
-
.send({ error: "please provide username and password" });
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
const user = await User.register({ username, password });
|
|
46
|
-
res.status(200).send(user);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.log(error);
|
|
49
|
-
res.status(500).send({ error: "something went wrong" });
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
app.post(
|
|
55
|
-
"/login",
|
|
56
|
-
asyncMiddleware(async (req, res) => {
|
|
57
|
-
const { username, password } = req.body;
|
|
58
|
-
|
|
59
|
-
if (!username || !password)
|
|
60
|
-
return res
|
|
61
|
-
.status(500)
|
|
62
|
-
.send({ error: "please provide username and password" });
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
const user = await User.login({ username, password });
|
|
66
|
-
res.status(200).send(user);
|
|
67
|
-
} catch (error) {
|
|
68
|
-
res.status(500).send({ error });
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
app.post(
|
|
74
|
-
"/upload",
|
|
75
|
-
User.authenticateMiddleware,
|
|
76
|
-
asyncMiddleware(async (req, res) => {
|
|
77
|
-
try {
|
|
78
|
-
const { user } = req;
|
|
79
|
-
const { username, token } = user;
|
|
80
|
-
|
|
81
|
-
const { fields, files } = await formidablePromise(req, {
|
|
82
|
-
type: true,
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const { name } = fields;
|
|
86
|
-
const { bundle } = files;
|
|
87
|
-
|
|
88
|
-
const deployment = await deploy({
|
|
89
|
-
name,
|
|
90
|
-
bundlePath: bundle.filepath,
|
|
91
|
-
token,
|
|
92
|
-
username,
|
|
93
|
-
});
|
|
94
|
-
res.status(200).send({
|
|
95
|
-
success: `application ${name} deployed successfully`,
|
|
96
|
-
deployment,
|
|
97
|
-
});
|
|
98
|
-
} catch (ex) {
|
|
99
|
-
console.log(ex);
|
|
100
|
-
res.status(500).send({ error: ex.stack });
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
app.get(
|
|
106
|
-
"/api/deployments/:name/logs",
|
|
107
|
-
User.authenticateMiddleware,
|
|
108
|
-
asyncMiddleware(async (req, res) => {
|
|
109
|
-
const { name } = req.params;
|
|
110
|
-
const { token, username } = req.user;
|
|
111
|
-
|
|
112
|
-
try {
|
|
113
|
-
const logs = await Deployment.logs({
|
|
114
|
-
name,
|
|
115
|
-
username,
|
|
116
|
-
token,
|
|
117
|
-
});
|
|
118
|
-
res.status(200).send({ logs });
|
|
119
|
-
} catch (ex) {
|
|
120
|
-
res.status(500).send({ ex });
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
app.get(
|
|
126
|
-
"/api/deployments",
|
|
127
|
-
User.authenticateMiddleware,
|
|
128
|
-
asyncMiddleware(async (req, res) => {
|
|
129
|
-
const { token, username } = req.user;
|
|
130
|
-
|
|
131
|
-
try {
|
|
132
|
-
const deployments = await Deployment.getAll({
|
|
133
|
-
username,
|
|
134
|
-
token,
|
|
135
|
-
});
|
|
136
|
-
res.status(200).send({ deployments });
|
|
137
|
-
} catch (error) {
|
|
138
|
-
res.status(500).send({ error });
|
|
139
|
-
}
|
|
140
|
-
})
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
app.delete(
|
|
144
|
-
"/api/deployments/:name",
|
|
145
|
-
User.authenticateMiddleware,
|
|
146
|
-
asyncMiddleware(async (req, res) => {
|
|
147
|
-
const { name } = req.params;
|
|
148
|
-
const { token, username } = req.user;
|
|
149
|
-
|
|
150
|
-
try {
|
|
151
|
-
await Deployment.del({
|
|
152
|
-
name,
|
|
153
|
-
token,
|
|
154
|
-
username,
|
|
155
|
-
});
|
|
156
|
-
res
|
|
157
|
-
.status(200)
|
|
158
|
-
.send({ success: `deployment ${name} successfully deleted` });
|
|
159
|
-
} catch (error) {
|
|
160
|
-
res.status(500).send({ error });
|
|
161
|
-
}
|
|
162
|
-
})
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
app.get(
|
|
166
|
-
"/api/deployments/:name",
|
|
167
|
-
User.authenticateMiddleware,
|
|
168
|
-
asyncMiddleware(async (req, res) => {
|
|
169
|
-
const { name } = req.params;
|
|
170
|
-
const { token, username } = req.user;
|
|
171
|
-
|
|
172
|
-
try {
|
|
173
|
-
const deployment = await Deployment.get({
|
|
174
|
-
username,
|
|
175
|
-
token,
|
|
176
|
-
name,
|
|
177
|
-
});
|
|
178
|
-
res.status(200).send({ deployment });
|
|
179
|
-
} catch (error) {
|
|
180
|
-
res.status(500).send({ error });
|
|
181
|
-
}
|
|
182
|
-
})
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
app.get(
|
|
186
|
-
"/api/logout",
|
|
187
|
-
User.authenticateMiddleware,
|
|
188
|
-
asyncMiddleware(async (req, res) => {
|
|
189
|
-
const { token, username } = req.user;
|
|
190
|
-
|
|
191
|
-
try {
|
|
192
|
-
await User.logout({ username, token });
|
|
193
|
-
res.status(200).send({ success: `${username} successfully deleted` });
|
|
194
|
-
} catch (ex) {
|
|
195
|
-
res.status(500).send({ error: "could not logout from session" });
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
);
|
|
199
|
-
|
|
200
|
-
app.get("/api/user", User.authenticateMiddleware, (req, res) => {
|
|
201
|
-
const { user } = req;
|
|
202
|
-
|
|
203
|
-
delete user["token"];
|
|
204
|
-
res.status(200).send({ user });
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
app.get("*", Request.log, Deployment.proxy);
|
|
208
|
-
|
|
209
|
-
app.listen(port, () => {
|
|
210
|
-
console.log(`⛅️ deploy.sh is running on port ${port}`); // eslint-disable-line
|
|
211
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<style media="screen">
|
|
6
|
-
html, body {
|
|
7
|
-
height: 100%;
|
|
8
|
-
width: 100%;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
11
|
-
.message {
|
|
12
|
-
text-align: center;
|
|
13
|
-
top: 50%;
|
|
14
|
-
width: 100%;
|
|
15
|
-
position: absolute;
|
|
16
|
-
}
|
|
17
|
-
h3 {
|
|
18
|
-
display: inline-block;
|
|
19
|
-
border-right: 1px solid #a2a2a2;
|
|
20
|
-
padding-right: 10px;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
<title>Error</title>
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<div class="message">
|
|
27
|
-
<h3>404</h3> <span> Sorry this page could not be found 🙈 </span>
|
|
28
|
-
</div>
|
|
29
|
-
</body>
|
|
30
|
-
</html>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<style media="screen">
|
|
6
|
-
html, body {
|
|
7
|
-
height: 100%;
|
|
8
|
-
width: 100%;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
11
|
-
.message {
|
|
12
|
-
text-align: center;
|
|
13
|
-
top: 50%;
|
|
14
|
-
width: 100%;
|
|
15
|
-
position: absolute;
|
|
16
|
-
}
|
|
17
|
-
h3 {
|
|
18
|
-
display: inline-block;
|
|
19
|
-
border-right: 1px solid #a2a2a2;
|
|
20
|
-
padding-right: 10px;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
<title>Error</title>
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<div class="message">
|
|
27
|
-
<h3>502</h3> <span> Sorry this page could not be loaded 🙈 </span>
|
|
28
|
-
</div>
|
|
29
|
-
</body>
|
|
30
|
-
</html>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import http from "http";
|
|
2
|
-
import Url from "url";
|
|
3
|
-
import fs from "fs";
|
|
4
|
-
import path from "path";
|
|
5
|
-
|
|
6
|
-
const port = process.env.PORT;
|
|
7
|
-
|
|
8
|
-
const map = {
|
|
9
|
-
".ico": "image/x-icon",
|
|
10
|
-
".html": "text/html",
|
|
11
|
-
".js": "text/javascript",
|
|
12
|
-
".json": "application/json",
|
|
13
|
-
".css": "text/css",
|
|
14
|
-
".png": "image/png",
|
|
15
|
-
".jpg": "image/jpeg",
|
|
16
|
-
".wav": "audio/wav",
|
|
17
|
-
".mp3": "audio/mpeg",
|
|
18
|
-
".svg": "image/svg+xml",
|
|
19
|
-
".pdf": "application/pdf",
|
|
20
|
-
".doc": "application/msword",
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const cache = {};
|
|
24
|
-
|
|
25
|
-
http
|
|
26
|
-
.createServer((req, res) => {
|
|
27
|
-
let { url } = req;
|
|
28
|
-
|
|
29
|
-
if (url === "/") url = "/index.html";
|
|
30
|
-
|
|
31
|
-
console.log(`${req.method} ${url}`); // eslint-disable-line
|
|
32
|
-
|
|
33
|
-
const parsedUrl = Url.parse(url);
|
|
34
|
-
let pathname = `.${parsedUrl.pathname}`;
|
|
35
|
-
|
|
36
|
-
if (cache[pathname]) {
|
|
37
|
-
res.setHeader("Content-Type", cache[pathname]["Content-Type"]);
|
|
38
|
-
return res.end(cache[pathname]["data"]);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const ext = path.parse(pathname).ext;
|
|
42
|
-
|
|
43
|
-
fs.exists(pathname, (exist) => {
|
|
44
|
-
if (!exist) {
|
|
45
|
-
res.statusCode = 404;
|
|
46
|
-
res.end(`File ${pathname} not found!`);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (fs.statSync(pathname).isDirectory()) pathname += "/index" + ext;
|
|
51
|
-
|
|
52
|
-
fs.readFile(pathname, (err, data) => {
|
|
53
|
-
if (err) {
|
|
54
|
-
res.statusCode = 500;
|
|
55
|
-
res.end(`Error getting the file: ${err}.`);
|
|
56
|
-
} else {
|
|
57
|
-
cache[pathname] = {
|
|
58
|
-
"Content-Type": map[ext] || "text/plain",
|
|
59
|
-
data,
|
|
60
|
-
};
|
|
61
|
-
// if the file is found, set Content-type and send data
|
|
62
|
-
res.setHeader("Content-Type", map[ext] || "text/plain");
|
|
63
|
-
res.end(data);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
})
|
|
68
|
-
.listen(parseInt(port), () => {
|
|
69
|
-
console.log(`Server listening on port ${port}`); // eslint-disable-line
|
|
70
|
-
});
|
package/website/README.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Website
|
|
2
|
-
|
|
3
|
-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
|
|
4
|
-
|
|
5
|
-
### Installation
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
$ yarn
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Local Development
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
$ yarn start
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
|
18
|
-
|
|
19
|
-
### Build
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
$ yarn build
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
|
26
|
-
|
|
27
|
-
### Deployment
|
|
28
|
-
|
|
29
|
-
Using SSH:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
$ USE_SSH=true yarn deploy
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Not using SSH:
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
$ GIT_USER=<Your GitHub username> yarn deploy
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
package/website/babel.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
label: API
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<a name="module_lib/classifier"></a>
|
|
2
|
-
|
|
3
|
-
## lib/classifier ⇒ <code>Object</code>
|
|
4
|
-
|
|
5
|
-
classifies what type of deployment is needed for a certain directory
|
|
6
|
-
|
|
7
|
-
**Returns**: <code>Object</code> - the configuration needed to deploy
|
|
8
|
-
|
|
9
|
-
| Param | Type | Description |
|
|
10
|
-
| --------- | ------------------- | ---------------------------------- |
|
|
11
|
-
| directory | <code>String</code> | the directory of which to classify |
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<a name="module_lib/deploy"></a>
|
|
2
|
-
|
|
3
|
-
## lib/deploy
|
|
4
|
-
|
|
5
|
-
handles the deployment of an application tar
|
|
6
|
-
|
|
7
|
-
| Param | Type | Description |
|
|
8
|
-
| ----------------- | ------------------- | ------------------------------------------------------------------ |
|
|
9
|
-
| option | <code>Object</code> | |
|
|
10
|
-
| option.name | <code>String</code> | the name of the the deployment |
|
|
11
|
-
| option.bundlePath | <code>String</code> | the directory of which the tar of the application is located |
|
|
12
|
-
| option.token | <code>String</code> | token associated with the user that want to deploy the application |
|
|
13
|
-
| option.username | <code>String</code> | username of the user the token is associated too |
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
<a name="CLI"></a>
|
|
2
|
-
|
|
3
|
-
## CLI
|
|
4
|
-
|
|
5
|
-
**Kind**: global class
|
|
6
|
-
|
|
7
|
-
- [CLI](#CLI)
|
|
8
|
-
- [new CLI(options)](#new_CLI_new)
|
|
9
|
-
- [.createBundle(directory)](#CLI.createBundle) ⇒ <code>Promise</code>
|
|
10
|
-
- [.removeBundle(directory)](#CLI.removeBundle) ⇒ <code>Promise</code>
|
|
11
|
-
- [.uploadBundle(options)](#CLI.uploadBundle) ⇒ <code>Promise</code>
|
|
12
|
-
- [.login(options)](#CLI.login) ⇒ <code>Promise</code>
|
|
13
|
-
- [.register(options)](#CLI.register) ⇒ <code>Promise</code>
|
|
14
|
-
- [.logout(options)](#CLI.logout) ⇒ <code>Promise</code>
|
|
15
|
-
- [.getLogs(options)](#CLI.getLogs) ⇒ <code>Promise</code>
|
|
16
|
-
- [.getDeployments(options)](#CLI.getDeployments) ⇒ <code>Promise</code>
|
|
17
|
-
- [.deleteDeployment(options)](#CLI.deleteDeployment) ⇒ <code>Promise</code>
|
|
18
|
-
- [.getUserDetails()](#CLI.getUserDetails) ⇒ <code>Promise</code>
|
|
19
|
-
- [.cacheCredentials(options)](#CLI.cacheCredentials) ⇒ <code>Promise</code>
|
|
20
|
-
- [.getCredentials()](#CLI.getCredentials) ⇒ <code>Promise</code>
|
|
21
|
-
|
|
22
|
-
<a name="new_CLI_new"></a>
|
|
23
|
-
|
|
24
|
-
### new CLI(options)
|
|
25
|
-
|
|
26
|
-
the cli instance that holds all options and methods to talk to the deploy.sh service
|
|
27
|
-
|
|
28
|
-
| Param | Type | Description |
|
|
29
|
-
| ------------------- | ------------------- | -------------------------------------------------------------------------------------------- |
|
|
30
|
-
| options | <code>Object</code> | contains defaults and overrides |
|
|
31
|
-
| options.url | <code>String</code> | the url of the remote deploy.sh service |
|
|
32
|
-
| options.application | <code>String</code> | the deployed application name to alter |
|
|
33
|
-
| options.mongo | <code>String</code> | the mongo connection string used by deploy.sh service when running `deploy serve --mongo ''` |
|
|
34
|
-
|
|
35
|
-
<a name="CLI.createBundle"></a>
|
|
36
|
-
|
|
37
|
-
### CLI.createBundle(directory) ⇒ <code>Promise</code>
|
|
38
|
-
|
|
39
|
-
creates a bundle to send to the server for deployment
|
|
40
|
-
|
|
41
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
42
|
-
|
|
43
|
-
| Param | Type | Description |
|
|
44
|
-
| --------- | ------------------- | --------------------------------------------- |
|
|
45
|
-
| directory | <code>String</code> | the directory that is to be turned into a tar |
|
|
46
|
-
|
|
47
|
-
<a name="CLI.removeBundle"></a>
|
|
48
|
-
|
|
49
|
-
### CLI.removeBundle(directory) ⇒ <code>Promise</code>
|
|
50
|
-
|
|
51
|
-
removes the bundle from the given directory
|
|
52
|
-
|
|
53
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
54
|
-
|
|
55
|
-
| Param | Type | Description |
|
|
56
|
-
| --------- | ------------------- | ----------------- |
|
|
57
|
-
| directory | <code>String</code> | path to directory |
|
|
58
|
-
|
|
59
|
-
<a name="CLI.uploadBundle"></a>
|
|
60
|
-
|
|
61
|
-
### CLI.uploadBundle(options) ⇒ <code>Promise</code>
|
|
62
|
-
|
|
63
|
-
Deals with uploading a specified bundle
|
|
64
|
-
|
|
65
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
66
|
-
|
|
67
|
-
| Param | Type | Description |
|
|
68
|
-
| -------------- | ------------------- | ------------------------------------- |
|
|
69
|
-
| options | <code>Object</code> | |
|
|
70
|
-
| options.name | <code>String</code> | the name of the specified application |
|
|
71
|
-
| options.bundle | <code>Stream</code> | a file stream of the tar |
|
|
72
|
-
|
|
73
|
-
<a name="CLI.login"></a>
|
|
74
|
-
|
|
75
|
-
### CLI.login(options) ⇒ <code>Promise</code>
|
|
76
|
-
|
|
77
|
-
calls the login api to get a token to persist for future requests
|
|
78
|
-
|
|
79
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
80
|
-
|
|
81
|
-
| Param | Type | Description |
|
|
82
|
-
| ---------------- | ------------------- | ------------------------------------ |
|
|
83
|
-
| options | <code>Object</code> | |
|
|
84
|
-
| options.username | <code>String</code> | username of the account |
|
|
85
|
-
| options.password | <code>String</code> | password associated with the account |
|
|
86
|
-
|
|
87
|
-
<a name="CLI.register"></a>
|
|
88
|
-
|
|
89
|
-
### CLI.register(options) ⇒ <code>Promise</code>
|
|
90
|
-
|
|
91
|
-
prompts the user to register account
|
|
92
|
-
|
|
93
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
94
|
-
|
|
95
|
-
| Param | Type | Description |
|
|
96
|
-
| ---------------- | ------------------- | ------------------------------------ |
|
|
97
|
-
| options | <code>Object</code> | |
|
|
98
|
-
| options.username | <code>String</code> | username of the account |
|
|
99
|
-
| options.password | <code>String</code> | password associated with the account |
|
|
100
|
-
|
|
101
|
-
<a name="CLI.logout"></a>
|
|
102
|
-
|
|
103
|
-
### CLI.logout(options) ⇒ <code>Promise</code>
|
|
104
|
-
|
|
105
|
-
calls the logout api to invalidate token
|
|
106
|
-
|
|
107
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
108
|
-
|
|
109
|
-
| Param | Type | Description |
|
|
110
|
-
| ---------------- | ------------------- | --------------------------------- |
|
|
111
|
-
| options | <code>Object</code> | |
|
|
112
|
-
| options.token | <code>String</code> | token to make authenticated calls |
|
|
113
|
-
| options.username | <code>String</code> | username linked to the token |
|
|
114
|
-
|
|
115
|
-
<a name="CLI.getLogs"></a>
|
|
116
|
-
|
|
117
|
-
### CLI.getLogs(options) ⇒ <code>Promise</code>
|
|
118
|
-
|
|
119
|
-
gets the application logs
|
|
120
|
-
|
|
121
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
122
|
-
|
|
123
|
-
| Param | Type | Description |
|
|
124
|
-
| ---------------- | ------------------- | --------------------------------- |
|
|
125
|
-
| options | <code>Object</code> | |
|
|
126
|
-
| options.token | <code>String</code> | token to make authenticated calls |
|
|
127
|
-
| options.username | <code>String</code> | username linked to the token |
|
|
128
|
-
| options.name | <code>String</code> | name of the deployment |
|
|
129
|
-
|
|
130
|
-
<a name="CLI.getDeployments"></a>
|
|
131
|
-
|
|
132
|
-
### CLI.getDeployments(options) ⇒ <code>Promise</code>
|
|
133
|
-
|
|
134
|
-
gets the user's deployed applications
|
|
135
|
-
|
|
136
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
137
|
-
|
|
138
|
-
| Param | Type | Description |
|
|
139
|
-
| ---------------- | ------------------- | --------------------------------- |
|
|
140
|
-
| options | <code>Object</code> | |
|
|
141
|
-
| options.token | <code>String</code> | token to make authenticated calls |
|
|
142
|
-
| options.username | <code>String</code> | username linked to the token |
|
|
143
|
-
| [options.name] | <code>String</code> | name of the deployment |
|
|
144
|
-
|
|
145
|
-
<a name="CLI.deleteDeployment"></a>
|
|
146
|
-
|
|
147
|
-
### CLI.deleteDeployment(options) ⇒ <code>Promise</code>
|
|
148
|
-
|
|
149
|
-
deletes the specified deployment
|
|
150
|
-
|
|
151
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
152
|
-
|
|
153
|
-
| Param | Type | Description |
|
|
154
|
-
| ---------------- | ------------------- | --------------------------------- |
|
|
155
|
-
| options | <code>Object</code> | |
|
|
156
|
-
| options.token | <code>String</code> | token to make authenticated calls |
|
|
157
|
-
| options.username | <code>String</code> | username linked to the token |
|
|
158
|
-
| options.name | <code>String</code> | name of the deployment |
|
|
159
|
-
|
|
160
|
-
<a name="CLI.getUserDetails"></a>
|
|
161
|
-
|
|
162
|
-
### CLI.getUserDetails() ⇒ <code>Promise</code>
|
|
163
|
-
|
|
164
|
-
gets the user details
|
|
165
|
-
|
|
166
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
167
|
-
|
|
168
|
-
| Param | Type | Description |
|
|
169
|
-
| ---------------- | ------------------- | --------------------------------- |
|
|
170
|
-
| options.token | <code>String</code> | token to make authenticated calls |
|
|
171
|
-
| options.username | <code>String</code> | username linked to the token |
|
|
172
|
-
|
|
173
|
-
<a name="CLI.cacheCredentials"></a>
|
|
174
|
-
|
|
175
|
-
### CLI.cacheCredentials(options) ⇒ <code>Promise</code>
|
|
176
|
-
|
|
177
|
-
persists the token and username locally
|
|
178
|
-
|
|
179
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
180
|
-
|
|
181
|
-
| Param | Type | Description |
|
|
182
|
-
| ---------------- | ------------------- | --------------------------------- |
|
|
183
|
-
| options | <code>Object</code> | |
|
|
184
|
-
| options.token | <code>String</code> | token to make authenticated calls |
|
|
185
|
-
| options.username | <code>String</code> | username linked to the token |
|
|
186
|
-
|
|
187
|
-
<a name="CLI.getCredentials"></a>
|
|
188
|
-
|
|
189
|
-
### CLI.getCredentials() ⇒ <code>Promise</code>
|
|
190
|
-
|
|
191
|
-
gets the token and username that were persisted locally
|
|
192
|
-
|
|
193
|
-
**Kind**: static method of [<code>CLI</code>](#CLI)
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<a name="module_lib/helpers/util"></a>
|
|
2
|
-
|
|
3
|
-
## lib/helpers/util
|
|
4
|
-
|
|
5
|
-
- [lib/helpers/util](#module_lib/helpers/util)
|
|
6
|
-
- _static_
|
|
7
|
-
- [.mk](#module_lib/helpers/util.mk) ⇒ <code>Promise</code>
|
|
8
|
-
- _inner_
|
|
9
|
-
- [~getPort()](#module_lib/helpers/util..getPort) ⇒ <code>Promise</code>
|
|
10
|
-
- [~hash(length)](#module_lib/helpers/util..hash) ⇒ <code>String</code>
|
|
11
|
-
- [~contains(arr, contains)](#module_lib/helpers/util..contains) ⇒ <code>Boolean</code>
|
|
12
|
-
|
|
13
|
-
<a name="module_lib/helpers/util.mk"></a>
|
|
14
|
-
|
|
15
|
-
### lib/helpers/util.mk ⇒ <code>Promise</code>
|
|
16
|
-
|
|
17
|
-
makes a directory recursively
|
|
18
|
-
|
|
19
|
-
**Kind**: static constant of [<code>lib/helpers/util</code>](#module_lib/helpers/util)
|
|
20
|
-
|
|
21
|
-
| Param | Type | Description |
|
|
22
|
-
| --------- | ------------------- | ------------------------ |
|
|
23
|
-
| directory | <code>String</code> | path to future directory |
|
|
24
|
-
|
|
25
|
-
<a name="module_lib/helpers/util..getPort"></a>
|
|
26
|
-
|
|
27
|
-
### lib/helpers/util~getPort() ⇒ <code>Promise</code>
|
|
28
|
-
|
|
29
|
-
gets an open port
|
|
30
|
-
|
|
31
|
-
**Kind**: inner method of [<code>lib/helpers/util</code>](#module_lib/helpers/util)
|
|
32
|
-
<a name="module_lib/helpers/util..hash"></a>
|
|
33
|
-
|
|
34
|
-
### lib/helpers/util~hash(length) ⇒ <code>String</code>
|
|
35
|
-
|
|
36
|
-
gets a lowercase random string with specified length
|
|
37
|
-
|
|
38
|
-
**Kind**: inner method of [<code>lib/helpers/util</code>](#module_lib/helpers/util)
|
|
39
|
-
|
|
40
|
-
| Param | Type | Description |
|
|
41
|
-
| ------ | ------------------- | ----------------------------------------- |
|
|
42
|
-
| length | <code>Number</code> | the specified length of the random string |
|
|
43
|
-
|
|
44
|
-
<a name="module_lib/helpers/util..contains"></a>
|
|
45
|
-
|
|
46
|
-
### lib/helpers/util~contains(arr, contains) ⇒ <code>Boolean</code>
|
|
47
|
-
|
|
48
|
-
contains is a function that takes an array and see if the condition matches
|
|
49
|
-
|
|
50
|
-
**Kind**: inner method of [<code>lib/helpers/util</code>](#module_lib/helpers/util)
|
|
51
|
-
**Returns**: <code>Boolean</code> - - responds back with a boolean value
|
|
52
|
-
|
|
53
|
-
| Param | Type | Description |
|
|
54
|
-
| -------- | ------------------ | ------------------------------------------------- |
|
|
55
|
-
| arr | <code>Array</code> | array to check with rules |
|
|
56
|
-
| contains | <code>Array</code> | rules to make sure the arr contains the following |
|
|
57
|
-
|
|
58
|
-
**Example**
|
|
59
|
-
|
|
60
|
-
```js
|
|
61
|
-
contains(
|
|
62
|
-
["index.html", "main.css"],
|
|
63
|
-
["index.html", "!Dockerfile", "!package.json"]
|
|
64
|
-
);
|
|
65
|
-
```
|