Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
Showing 18 changed files with 151 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
* The `restart` command no longer takes a `--no-sync` flag, due to the move to NFS.
* **New**
* Dusty now attempts to fix a known problem with boot2docker networking, resulting in up to a 10x improvement in network performance. See [this boot2docker issue](https://github.com/boot2docker/boot2docker/issues/1022) for more information.
* Dusty bundles can now specify services, just as they specify apps
* Bundles can now specify services, just as they specify apps.
* **Misc**
* `test.once` commands that fail now cause the entire test run to fail immediately.
* When running all test suites, a tabular summary of test results is now printed at the end of the run
8 changes: 6 additions & 2 deletions docs/specs/bundle-specs.md
Original file line number Diff line number Diff line change
@@ -29,13 +29,17 @@ The list of apps to be run by `dusty up` if this bundle is activated.
These apps are used as entrypoints into the dependency graph defined by
your app and service specs.

Each bundle must specify at least one app (in `apps`) or service (in `services`).

## services

```
services:
- postgres
```

An optional list of services which will be run by `dusty up` if this bundle
is activated. Services specified here will be launched in addition to services
A list of services which will be run by `dusty up` if this bundle is activated.
Services specified here will be launched in addition to services
that specified apps depend on.

Each bundle must specify at least one app (in `apps`) or service (in `services`).
12 changes: 9 additions & 3 deletions dusty/schemas/bundle_schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from schemer import Schema, Array

def app_or_service_required_validator():
def validator(document):
if 'apps' not in document and 'services' not in document:
return 'Bundles must specify `apps` or `services`'
return validator

bundle_schema = Schema({
'description': {'type': basestring, 'default': ''},
'apps': {'type': Array(basestring), 'required': True},
'services': {'type': Array(basestring), 'default': list}
})
'apps': {'type': Array(basestring), 'default': list},
'services': {'type': Array(basestring), 'default': list},
}, validates=[app_or_service_required_validator()])
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repo: github.com/gamechanger/simpleapp
image: docker.gamechanger.io/simpleapp
mount: /simpleapp
commands:
always:
- run-script.sh
compose:
environment:
gcenv: local
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
bundles:
simple:
apps:
- simpleapp
services:
- bundle-specified-service
apps:
simpleapp:
image: docker.gamechanger.io/simpleapp
commands:
always:
- run-script.sh
once: []
compose:
environment:
gcenv: local
volumes: []
depends:
apps: []
libs: []
services: []
libs: {}
services:
bundle-specified-service:
image: someimage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apps:
- simpleapp
services:
- bundle-specified-service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
simpleapp:
image: docker.gamechanger.io/simpleapp
command: run-script.sh
environment:
gcenv: local
bundle-specified-service:
image: someimage
21 changes: 21 additions & 0 deletions tests/unit/compiler/test_configs/bundle_with_service/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
worker_processes 1;

error_log /var/log/dusty/nginx/error.log;

pid /var/log/dusty/nginx/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

access_log /var/log/dusty/nginx/access.log;

sendfile on;

keepalive_timeout 65;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repo: github.com/gamechanger/simpleapp
image: docker.gamechanger.io/simpleapp
mount: /simpleapp
commands:
always:
- run-script.sh
compose:
environment:
gcenv: local
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
bundles:
simple:
apps:
- simpleapp
serviceonly:
services:
- bundle-specified-service
apps:
simpleapp:
image: docker.gamechanger.io/simpleapp
commands:
always:
- run-script.sh
once: []
compose:
environment:
gcenv: local
volumes: []
depends:
apps: []
libs: []
services: []
libs: {}
services:
bundle-specified-service:
image: someimage
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
services:
- bundle-specified-service
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apps:
- simpleapp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
simpleapp:
image: docker.gamechanger.io/simpleapp
command: run-script.sh
environment:
gcenv: local
bundle-specified-service:
image: someimage
21 changes: 21 additions & 0 deletions tests/unit/compiler/test_configs/bundle_without_app/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
worker_processes 1;

error_log /var/log/dusty/nginx/error.log;

pid /var/log/dusty/nginx/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

access_log /var/log/dusty/nginx/access.log;

sendfile on;

keepalive_timeout 65;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
image: someimage
4 changes: 1 addition & 3 deletions tests/unit/compiler/test_configs/simple/assembled_spec.yml
Original file line number Diff line number Diff line change
@@ -18,6 +18,4 @@ apps:
libs: []
services: []
libs: {}
services:
bundle-specified-service:
image: someimage
services: {}
2 changes: 0 additions & 2 deletions tests/unit/compiler/test_configs/simple/bundles/simple.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
apps:
- simpleapp
services:
- bundle-specified-service

0 comments on commit b3c9959

Please sign in to comment.