Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
- adds api and cli action to be able retrieve logs
- deals with cleaning up old images
- deletes image and container when application is being redeployed
- further consolidates deployment logic into the deployment model
- starts up containers from cold start
- shuts down containers when process is closing
- adds caching to static-server
- abstract models into their own files and their own collections
- fixes the middleware request logger
- fixes CLI responses
- adds whoami functionality that will show the current logged in user (deploy whoami)
  • Loading branch information
gabrielcsapo committed Aug 13, 2017
1 parent 5e79857 commit dc89a0a
Show file tree
Hide file tree
Showing 29 changed files with 2,918 additions and 558 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Unreleased
# 0.1.0

- adds caching to static-server
- adds api and cli action to be able retrieve logs
- deals with cleaning up old images
- deletes image and container when application is being redeployed
- further consolidates deployment logic into the deployment model
- starts up containers from cold start
- shuts down containers when process is closing
- adds caching to static-server
- abstract models into their own files and their own collections
- fixes the middleware request logger
- fixes CLI responses
Expand Down
8 changes: 5 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
- [x] be able to persist data
- [x] Once there is a way to store metadata, have an in memory store of a proxy routing to deal with subrouting application.
- [ ] be able retrieve logs
- [x] be able retrieve logs
- [ ] add timing metrics to cli calls (maybe add just overall function call tracing)
- [ ] add lamba functionality
- [ ] add web gui
- [ ] deal with shutting down and cleaning up old images
- [ ] store most recent tars and metadata somewhere to make sure when the service starts back up it will start those sub services also
- [x] deal with shutting down
- [x] deal with cleaning up old images
- [x] store most recent tars and metadata somewhere to make sure when the service starts back up it will start those sub services also
- [ ] have a pull command that retrieves the contents of a deployed instance
48 changes: 48 additions & 0 deletions bin/deploy-logs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env node

const Async = require('async');
const ora = require('ora');

const program = require('commander');
program
.option('-u, --url [url]', 'The endpoint of the deploy.sh server', 'http://localhost:5000')
.parse(process.argv);

const name = program.args[0];
const { getLogs, getCredentials } = require('../lib/helpers/cli')(program.url);

const spinner = ora(`Opening up url to deployment instance`).start();

Async.waterfall([
function(callback) {
spinner.text = 'Getting deploy keys';

getCredentials()
.then((credentials) => callback(null, credentials))
.catch((ex) => callback(ex, null));
},
function(credentials, callback) {
spinner.text = 'Calling log API';

const { token, username } = credentials;

getLogs({ token, username, name })
.then((response) => callback(null, response))
.catch((error) => callback(error, null));
}
], (ex, result) => {
if (ex) return spinner.fail(`API call failed 🙈 ${JSON.stringify({
ex
}, null, 4)}`);

spinner.stop();
const { logs } = result;

console.log( // eslint-disable-line
logs.map((l) => {
let log = l.split(' ');
log.unshift('-');
return log.join(' ');
}).join('')
);
});
1 change: 1 addition & 0 deletions bin/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ program
.command('login', 'login to access deploy and deployment functionality')
.command('logout', 'logout and invalidate token')
.command('open [project]', 'open the deployment instance in the browser')
.command('logs [project]', 'shows the logs for the specificed project')
.command('server', 'starts a server instance locally')
.parse(process.argv);
4 changes: 2 additions & 2 deletions docs/code/classifier.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<label for="nav-trigger" class="overlay"></label>

<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_deployment-Deployment.html">Deployment</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_request-Request.html">Request</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_user-User.html">User</a></span></li><li class="nav-heading">Modules</li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_classifier.html">lib/classifier</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_deploy.html">lib/deploy</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html">lib/helpers/cli</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~cacheCredentials">cacheCredentials</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~createBundle">createBundle</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getCredentials">getCredentials</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getDeployments">getDeployments</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~login">login</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~logout">logout</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~register">register</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~uploadBundle">uploadBundle</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_helpers_util.html">lib/helpers/util</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~contains">contains</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~getPort">getPort</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~hash">hash</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_deployment.html">models/deployment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~getDeployments">getDeployments</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~getProxy">getProxy</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~updateDeployments">updateDeployments</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_request.html">models/request</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_request.html#~log">log</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_user.html">models/user</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~authenticate">authenticate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~get">get</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~login">login</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~logout">logout</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~register">register</a></span></li>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_deployment.Deployment.html">Deployment</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_request-Request.html">Request</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="module-models_user.User.html">User</a></span></li><li class="nav-heading">Modules</li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_classifier.html">lib/classifier</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_deploy.html">lib/deploy</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html">lib/helpers/cli</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~cacheCredentials">cacheCredentials</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~createBundle">createBundle</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getCredentials">getCredentials</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getDeployments">getDeployments</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~getLogs">getLogs</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~login">login</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~logout">logout</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~register">register</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_cli.html#~uploadBundle">uploadBundle</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-lib_helpers_util.html">lib/helpers/util</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~contains">contains</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~getPort">getPort</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-lib_helpers_util.html#~hash">hash</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_deployment.html">models/deployment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~get">get</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~proxy">proxy</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~remove">remove</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~start">start</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~stop">stop</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_deployment.html#~update">update</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_request.html">models/request</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_request.html#~log">log</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-models_user.html">models/user</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~authenticate">authenticate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~get">get</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~login">login</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~logout">logout</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-models_user.html#~register">register</a></span></li>
</nav>

<div id="main">
Expand Down Expand Up @@ -107,7 +107,7 @@ <h1 class="page-title">classifier.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Fri Aug 11 2017 00:05:36 GMT-0700 (PDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sun Aug 13 2017 16:16:41 GMT-0700 (PDT) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
Loading

0 comments on commit dc89a0a

Please sign in to comment.