This repository has been archived by the owner on Feb 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #527 from gamechanger/js-bundle-services
Js bundle services
- Loading branch information
Showing
17 changed files
with
165 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +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} | ||
}) | ||
'apps': {'type': Array(basestring), 'default': list}, | ||
'services': {'type': Array(basestring), 'default': list}, | ||
}, validates=[app_or_service_required_validator()]) |
9 changes: 9 additions & 0 deletions
9
tests/unit/compiler/test_configs/bundle_with_service/apps/simpleapp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
25 changes: 25 additions & 0 deletions
25
tests/unit/compiler/test_configs/bundle_with_service/assembled_spec.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
4 changes: 4 additions & 0 deletions
4
tests/unit/compiler/test_configs/bundle_with_service/bundles/simple.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apps: | ||
- simpleapp | ||
services: | ||
- bundle-specified-service |
7 changes: 7 additions & 0 deletions
7
tests/unit/compiler/test_configs/bundle_with_service/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
21
tests/unit/compiler/test_configs/bundle_with_service/nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
tests/unit/compiler/test_configs/bundle_with_service/services/bundle-specified-service.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
image: someimage |
9 changes: 9 additions & 0 deletions
9
tests/unit/compiler/test_configs/bundle_without_app/apps/simpleapp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
26 changes: 26 additions & 0 deletions
26
tests/unit/compiler/test_configs/bundle_without_app/assembled_spec.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
2 changes: 2 additions & 0 deletions
2
tests/unit/compiler/test_configs/bundle_without_app/bundles/serviceonly.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
services: | ||
- bundle-specified-service |
2 changes: 2 additions & 0 deletions
2
tests/unit/compiler/test_configs/bundle_without_app/bundles/simple.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apps: | ||
- simpleapp |
7 changes: 7 additions & 0 deletions
7
tests/unit/compiler/test_configs/bundle_without_app/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
21
tests/unit/compiler/test_configs/bundle_without_app/nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
tests/unit/compiler/test_configs/bundle_without_app/services/bundle-specified-service.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
image: someimage |