Skip to content

Commit 68238d0

Browse files
committed
Merge branch 'develop', prepare 5.0 release
2 parents 6c86b84 + b47f490 commit 68238d0

23 files changed

+1355
-608
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ exoframe-linux
66
exoframe-macos
77
exoframe-win.exe
88
.idea/
9+
.DS_Store
10+

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ node_js: lts/dubnium
44

55
cache: yarn
66

7+
script:
8+
- yarn test
9+
- yarn lint
10+
711
after_success:
812
- yarn coveralls
913
- yarn package

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Exoframe is a self-hosted tool that allows simple one-command deployments using
2222
- Basic HTTP Auth support \*
2323
- Simple access to the logs of deployments
2424
- Docker-compose support
25+
- Simple function deployments
2526
- Multiple deployment endpoints and multi-user support
2627
- Simple update procedure for client, server and Traefik
2728
- Optional automatic subdomain assignment (i.e. every deployment gets its own subdomain)
@@ -71,8 +72,9 @@ You can find a list of all commands and options in the [docs](./docs/README.md).
7172
- [Server Installation](docs/ServerInstallation.md)
7273
- [Server Configuration](docs/ServerConfiguration.md)
7374
- [Advanced topics](docs/Advanced.md)
75+
- [Function deployments](docs/Functions.md)
7476
- [FAQ](docs/FAQ.md)
75-
- [Contribution Guideline](docs/Contributing.md)
77+
- [Contribution Guidelines](docs/Contributing.md)
7678
- [Templates guide](docs/TemplatesGuide.md)
7779
- [Recipes guide](docs/RecipesGuide.md)
7880
- [Using nightly versions](docs/Nightly.md)

docs/Advanced.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,36 @@ Deploying using docker compose works almost the same as using a normal docker co
3939

4040
Any of the [configuration options](https://docs.traefik.io/configuration/backends/docker/#on-containers) for the default Traefik docker setup can be used.
4141

42-
If you have a docker-compose.yml file, __any domain set in exoframe.json will be ignored__.
42+
If you have a docker-compose.yml file, **any domain set in exoframe.json will be ignored**.
43+
44+
For the most part, Exoframe doesn't pass anything from `exoframe.json` to the compose.
45+
However, one thing that is being passed is environmental variables.
46+
You can use any variables defined in `exoframe.json` in your compose file.
47+
First, define them in your `exoframe.json`:
48+
49+
```json
50+
{
51+
"name": "test-compose-deploy",
52+
"env": {
53+
"CUSTOM_LABEL": "custom-value",
54+
"CUSTOM_SECRET": "@test-secret"
55+
}
56+
}
57+
```
58+
59+
Then use them inside your `docker-compose.yml`:
60+
61+
version: '2'
62+
services:
63+
web:
64+
build: .
65+
labels:
66+
traefik.frontend.rule: 'Host:test.dev'
67+
traefik.port: 8080 # default: 80
68+
custom.envvar: "${CUSTOM_LABEL}"
69+
custom.secret: "${CUSTOM_SECRET}"
70+
redis:
71+
image: "redis:alpine"
4372

4473
## Rate limiting
4574

docs/Basics.md

Lines changed: 105 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,71 +7,83 @@
77

88
## Requirements
99

10-
Exoframe CLI is not particularly demanding and consumes at max ~50mb of RAM.
10+
Exoframe CLI is not particularly demanding and consumes at max ~50mb of RAM
1111
Most intensive task from CLI side is packaging the project and streaming that to the server - it doesn't affect RAM usage that much and mostly relies on CPU and network.
1212

1313
Running Exoframe server on its own also doesn't require too much resources:
1414

1515
- Exoframe Server consumes ~50mb of RAM
1616
- Traefik started along with server consumes ~60mb of RAM
1717

18-
Be aware though - execution of deployments will result in (1) new Docker images being built and (2) new Docker containers being started.
19-
Depending on your project's complexity, this might require significant amount of resources during both steps resulting in failed deployments (note: if Docker goes out-of-memory during build, you will not get any specific error - just a failed deployment).
18+
Be aware though - execution of deployments will result in (1) new Docker images being built and (2) new Docker containers being started.
19+
Depending on your project's complexity, this might require significant amount of resources during both steps resulting in failed deployments (note: if Docker goes out-of-memory during build, you will not get any specific error - just a failed deployment).
2020
It is recommended to run Exoframe on a server with at least 1GB of RAM.
2121

22-
## Supported project types & deployment templates
22+
## Installation and Basic Usage
2323

24-
By default, Exoframe understands and can deploy the following project types:
24+
To run Exoframe you will need two parts - Exoframe CLI and [Exoframe server](https://github.com/exoframejs/exoframe-server).
25+
For server install instructions see [Exoframe server repository](https://github.com/exoframejs/exoframe-server).
2526

26-
1. Static html based projects - will be deployed using [nginx](http://hub.docker.com/_/nginx) image
27-
2. Node.js based projects - will be deployed using [node:latest](https://hub.docker.com/_/node) image \*
28-
3. Docker based project - will be deployed using your [Dockerfile](https://docs.docker.com/engine/reference/builder/)
29-
4. [Docker-Compose based projects](docs/Advanced.md#Docker-Compose based deployment) - will be deployed using your [docker-compose](https://docs.docker.com/compose/compose-file/) file
27+
To install Exoframe CLI you can either download one of the pre-packaged binaries from [releases page](https://github.com/exoframejs/exoframe/releases) or install it using npm (needs at least Node 8.x):
3028

31-
\* There are two things to keep in mind for Node.js projects: (1) they are started via `npm start`, so make sure you have specified start script in your `package.json`; (2) by default port 80 is exposed, so you need to make your app listen on that port. If you'd like to execute your app in any different way or expose more ports - please use Dockerfile deployment method.
29+
```
30+
npm install exoframe -g
31+
```
3232

33-
This list can be extended via deployment templates.
34-
You can find the list of available templates [on npm](https://www.npmjs.com/search?q=exoframe-template).
35-
Templates can be installed by executing `exoframe template` command and entering complete template package name.
33+
Make sure you have [Exoframe server](https://github.com/exoframejs/exoframe-server) deployed, set it as your endpoint using:
3634

37-
## Complex recipes
35+
```
36+
exoframe endpoint http://you.server.url
37+
```
3838

39-
Exoframe also provides support for third-party complex deployment recipes.
40-
They allow to quickly and easily deploy complex projects.
39+
Then login using:
4140

42-
For example, you can deploy Wordpress with PHPMyAdmin by simply executing `exoframe setup` and entering [exoframe-recipe-wordpress](https://github.com/exoframejs/exoframe-recipe-wordpress) as desired recipe.
41+
```
42+
exoframe login
43+
```
4344

44-
You can find the list of available recipes [on npm](https://www.npmjs.com/search?q=exoframe-recipe).
45+
Then you will be able to deploy your projects by simply running:
4546

46-
## Commands
47+
```
48+
exoframe
49+
```
4750

48-
| Command | Description |
49-
| -------------------- | -------------------------------------------------------------------- |
50-
| deploy [path] | Deploy specified path |
51-
| config | Generate or update project config for current path |
52-
| list | List currently deployed projects |
53-
| rm <id> | Remove existing deployment or project |
54-
| log <id> | Get logs for existing deployment or project |
55-
| template [ls, rm] | Add, list or remove deployment templates from the server |
56-
| setup [recipe] | Setup a complex recipe deployment |
57-
| token [ls, rm] | Generate, list or remove deployment tokens |
58-
| secret [new, ls, rm] | Create, list or remove deployment secrets |
59-
| login | Login into Exoframe server |
60-
| endpoint [url] | Selects or adds the endpoint of Exoframe server |
61-
| rm-endpoint [url] | Removes an existing endpoint of Exoframe server |
62-
| update [target] | Gets current versions or updates given target (server, traefik, all) |
63-
| completion | Generates bash completion script |
51+
## Updating deployed project
6452

65-
## Special commands
53+
Exoframe provides a way to easily update deployed projects.
54+
This can be done by passing `--update` (or `-u`) flag to deploy command:
6655

67-
Exoframe CLI has a number of special commands, specifically:
56+
```
57+
exoframe --update
58+
```
6859

69-
- `exoframe logs exoframe-server` - will return current server logs (only works when running server as container)
60+
The way it works is quite simple:
61+
62+
1. Exoframe deploys new version of the given project
63+
2. Exoframe then waits for it to start up
64+
3. Finally, Exoframe removes the old running deployments for given project
65+
66+
This can be used together with [deployment tokens](#Deployment-Tokens) to achieve [simple continuous deployment](https://github.com/exoframejs/node-cd-demo) for your projects.
67+
68+
## Supported project types & deployment templates
69+
70+
By default, Exoframe understands and can deploy the following project types:
71+
72+
1. Static html based projects - will be deployed using [nginx](http://hub.docker.com/_/nginx) image
73+
2. Node.js based projects - will be deployed using [node:latest](https://hub.docker.com/_/node) image \*
74+
3. Docker based project - will be deployed using your [Dockerfile](https://docs.docker.com/engine/reference/builder/)
75+
4. [Docker-Compose based projects](docs/Advanced.md#Docker-Compose based deployment) - will be deployed using your [docker-compose](https://docs.docker.com/compose/compose-file/) file
76+
77+
\* There are two things to keep in mind for Node.js projects: (1) they are started via `npm start`, so make sure you have specified start script in your `package.json`; (2) by default port 80 is exposed, so you need to make your app listen on that port. If you'd like to execute your app in any different way or expose more ports - please use Dockerfile deployment method.
78+
79+
This list can be extended via deployment templates.
80+
You can find the list of available templates [on npm](https://www.npmjs.com/search?q=exoframe-template).
81+
Templates can be installed by executing `exoframe template` command and entering complete template package name.
7082

7183
## Project config file
7284

73-
All of the configuration for the deployed projects is done using `exoframe.json` config file.
74-
It can either be generated/updated using `exoframe config` (or `exoframe init`) command or created manually.
85+
All of the configuration for the deployed projects is done using `exoframe.json` config file.
86+
It can either be generated/updated using `exoframe config` (or `exoframe init`) command or created manually.
7587
If it doesn't exist during deployment, Exoframe will generate simple config file that only contains name of the current project.
7688

7789
Config file has the following structure:
@@ -107,7 +119,7 @@ Config file has the following structure:
107119
"labels": {
108120
"my.custom.label": "value"
109121
},
110-
// Add additional docker volumes ot your container [optional]
122+
// Add additional docker volumes to your container [optional]
111123
// while you can use server paths in sourceVolume place
112124
// it is recommended to use named volumes
113125
"volumes": [
@@ -123,6 +135,14 @@ Config file has the following structure:
123135
// max burst request rate over given time period
124136
"burst": 5,
125137
},
138+
// function deployment config
139+
// see "function deployments" for more info
140+
"function": {
141+
// type of function (http, worker, trigger or custom)
142+
"type": "http",
143+
// route for HTTP function, [optional] defaults to `/${config.name}`
144+
"route": "/test"
145+
},
126146
// template to be used for project deployment
127147
// undefined by default, detected by server based on file structure
128148
"template": "my-template",
@@ -143,50 +163,72 @@ Config file has the following structure:
143163

144164
## Project ignore file
145165

146-
In some cases you might want to ignore particular files during project deployment (e.g. tests, fixtures, node_modules, etc.).
147-
You can specify ignored files using `.exoframeignore` file in the root of the project.
148-
Each line is then used by the [ignore](https://github.com/kaelzhang/node-ignore) module during deployment process.
166+
In some cases you might want to ignore particular files during project deployment (e.g. tests, fixtures, node_modules, etc.).
167+
You can specify ignored files using `.exoframeignore` file in the root of the project.
168+
Each line is then used by the [ignore](https://github.com/kaelzhang/node-ignore) module during deployment process.
149169
When not provided ignore file contains the following entries:
150170

151171
```
152172
.git
153173
node_modules
154174
```
155175

156-
## CLI Configuration
176+
## Complex recipes
177+
178+
Exoframe also provides support for third-party complex deployment recipes.
179+
They allow to quickly and easily deploy complex projects.
180+
181+
For example, you can deploy Wordpress with PHPMyAdmin by simply executing `exoframe setup` and entering [exoframe-recipe-wordpress](https://github.com/exoframejs/exoframe-recipe-wordpress) as desired recipe.
182+
183+
You can find the list of available recipes [on npm](https://www.npmjs.com/search?q=exoframe-recipe).
184+
185+
## Exoframe CLI - Commands
157186

158-
Exoframe stores its config in `~/.exoframe/cli.config.yml`.
187+
| Command | Description |
188+
| -------------------- | -------------------------------------------------------------------- |
189+
| deploy [path] | Deploy specified path |
190+
| config | Generate or update project config for current path |
191+
| list | List currently deployed projects |
192+
| rm <id> | Remove existing deployment or project |
193+
| log <id> | Get logs for existing deployment or project |
194+
| template [ls, rm] | Add, list or remove deployment templates from the server |
195+
| setup [recipe] | Setup a complex recipe deployment |
196+
| token [ls, rm] | Generate, list or remove deployment tokens |
197+
| secret [new, ls, rm] | Create, list or remove deployment secrets |
198+
| login | Login into Exoframe server |
199+
| endpoint [url] | Selects or adds the endpoint of Exoframe server |
200+
| rm-endpoint [url] | Removes an existing endpoint of Exoframe server |
201+
| update [target] | Gets current versions or updates given target (server, traefik, all) |
202+
| completion | Generates bash completion script |
203+
204+
## Exoframe CLI - Special Commands
205+
206+
Exoframe CLI has a number of special commands, specifically:
207+
208+
- `exoframe logs exoframe-server` - will return current server logs (only works when running server as container)
209+
210+
## Exoframe CLI - Configuration
211+
212+
Exoframe stores its config in `~/.exoframe/cli.config.yml`.
159213
Currently it contains list of endpoint URLs with associated usernames and authentication tokens:
160214

161215
```yaml
162-
endpoint: "http://localhost:8080" # your endpoint URL, defaults to localhost
216+
endpoint: 'http://localhost:8080' # your endpoint URL, defaults to localhost
163217
```
164218
165-
## SSH key auth
219+
## SSH Key-Based Authentication
166220
167221
The SSK key needs to be RSA and in PEM format. To ensure your key is generated in a format that works you can generate with this command: `ssh-keygen -t rsa -b 4096 -C "[email protected]" -m 'PEM'`. This follows the [GitHub Instructions](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) with an additional flag ensuring it is the right format.
168222

169-
## Deployment tokens
223+
## Deployment Tokens
170224

171-
Sometimes you might need to deploy things from environments that don't have your private key (e.g. CI/CD services).
225+
Sometimes you might need to deploy things from environments that don't have your private key (e.g. CI/CD services).
172226
For this cases you can use deployment tokens. Here's how it works:
173227

174228
1. Make sure you are logged in to your Exoframe server
175229
2. Generate new deployment token using `exoframe token` command
176230
3. Use the new token to deploy your service without need to authenticate: `exoframe deploy -t $TOKEN`
177231

178-
## Updating deployed project
179-
180-
Exoframe provides a way to easily update already deployed projects.
181-
This can be done by passing `--update` (or `-u`) flag to deploy command.
182-
The way it works is quite simple:
183-
184-
1. Exoframe deploys new version of the given project
185-
2. Exoframe then waits for them to start up
186-
3. Exoframe removes the old running deployments for current project
187-
188-
This can be used together with deployment tokens to achieve simple continuous deployment for your projects.
189-
190-
### Updating the server
232+
## Updating Exoframe Server
191233

192234
The server can simply be updated by invoking `exoframe update server`.

0 commit comments

Comments
 (0)