automatically run docker-compose
diff --git a/xos/configurations/frontend/xos.yaml b/xos/configurations/frontend/xos.yaml
index b88e4f3..8b286cd 100644
--- a/xos/configurations/frontend/xos.yaml
+++ b/xos/configurations/frontend/xos.yaml
@@ -12,7 +12,7 @@
properties:
ui_port: 9999
bootstrap_ui_port: 9998
- container_base_name: frontend
+ docker_project_name: frontend
/opt/xos/xos_configuration/xos_common_config:
type: tosca.nodes.XOSVolume
diff --git a/xos/core/models/xosmodel.py b/xos/core/models/xosmodel.py
index b44c3cd..9b6de82 100644
--- a/xos/core/models/xosmodel.py
+++ b/xos/core/models/xosmodel.py
@@ -12,7 +12,7 @@
ui_port = models.IntegerField(help_text="Port for XOS UI", default=80)
bootstrap_ui_port = models.IntegerField(help_text="Port for XOS UI", default=81)
db_container_name = StrippedCharField(max_length=200, help_text="name of XOS db container", default="xos_db")
- container_base_name = StrippedCharField(max_length=200, help_text="base name for containers")
+ docker_project_name = StrippedCharField(max_length=200, help_text="docker project name")
def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/synchronizers/onboarding/steps/sync_xos.py b/xos/synchronizers/onboarding/steps/sync_xos.py
index 55e7553..e39a765 100644
--- a/xos/synchronizers/onboarding/steps/sync_xos.py
+++ b/xos/synchronizers/onboarding/steps/sync_xos.py
@@ -34,6 +34,7 @@
dockerfiles = [self.create_ui_dockerfile()]
tenant_fields = {"dockerfiles": dockerfiles,
"build_dir": self.build_dir,
+ "docker_project_name": xos.docker_project_name,
"ansible_tag": xos.__class__.__name__ + "_" + str(xos.id)}
path="XOS"
diff --git a/xos/synchronizers/onboarding/steps/sync_xos.yaml b/xos/synchronizers/onboarding/steps/sync_xos.yaml
index 9431427..8a98873 100644
--- a/xos/synchronizers/onboarding/steps/sync_xos.yaml
+++ b/xos/synchronizers/onboarding/steps/sync_xos.yaml
@@ -15,6 +15,6 @@
shell: chdir={{ build_dir }} docker build -f {{ dockerfile.dockerfile_fn }} --rm -t {{ dockerfile.docker_image_name }} .
{% endfor %}
-# - build_dockers:
-# shell: docker build -f {{ '{{' }} item.dockerfile_fn {{ '}}' }} --rm -t {{ '{{' }} item.docker_image_name {{ '}}' }} .
-# with items: "dockerfiles"
+ - name: run docker-compose
+ shell: docker-compose -p {{ docker_project_name }} -f /opt/xos/synchronizers/onboarding/docker-compose/docker-compose.yml up -d
+
diff --git a/xos/synchronizers/onboarding/xosbuilder.py b/xos/synchronizers/onboarding/xosbuilder.py
index 8d00c7f..0bfc3a9 100644
--- a/xos/synchronizers/onboarding/xosbuilder.py
+++ b/xos/synchronizers/onboarding/xosbuilder.py
@@ -177,19 +177,16 @@
containers["xos_db"] = \
{"image": "xosproject/xos-postgres",
- "container_base_name": xos.container_base_name,
"expose": [5432]}
containers["xos_ui"] = \
{"image": "xosproject/xos-ui",
- "container_base_name": xos.container_base_name,
"command": "python /opt/xos/manage.py runserver 0.0.0.0:%d --insecure --makemigrations" % xos.ui_port,
"ports": {"%d"%xos.ui_port : "%d"%xos.ui_port},
"links": ["xos_db"],
"volumes": volume_list}
containers["xos_bootstrap_ui"] = {"image": "xosproject/xos-ui",
- "container_base_name": xos.container_base_name,
"command": "python /opt/xos/manage.py runserver 0.0.0.0:%d --insecure --makemigrations" % xos.bootstrap_ui_port,
"ports": {"%d"%xos.bootstrap_ui_port : "%d"%xos.bootstrap_ui_port},
"links": ["xos_db"],
@@ -198,7 +195,6 @@
for c in ServiceController.objects.all():
containers["xos_synchronizer_%s" % c.name] = \
{"image": "xosproject/xos-synchronizer-%s" % controller.name,
- "container_base_name": xos.container_base_name,
"command": 'bash -c "sleep 120; bash /opt/xos/synchronizers/%s/run.sh"',
"links": ["xos_db"],
"volumes": volume_list}
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index ee21be7..eb0703d 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -19,10 +19,10 @@
type: integer
required: false
descrption: TCP port of bootstrap user interface
- container_base_name:
+ docker_project_name:
type: string
required: false
- description: Base name for containers
+ description: Docker project name
tosca.nodes.XOSVolume:
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 472382e..997de12 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -49,10 +49,10 @@
type: integer
required: false
descrption: TCP port of bootstrap user interface
- container_base_name:
+ docker_project_name:
type: string
required: false
- description: Base name for containers
+ description: Docker project name
tosca.nodes.XOSVolume:
diff --git a/xos/tosca/resources/xosmodel.py b/xos/tosca/resources/xosmodel.py
index daba4f5..f1731ac 100644
--- a/xos/tosca/resources/xosmodel.py
+++ b/xos/tosca/resources/xosmodel.py
@@ -12,7 +12,7 @@
class XOSXOS(XOSResource):
provides = "tosca.nodes.XOS"
xos_model = XOS
- copyin_props = ["ui_port", "bootstrap_ui_port", "container_base_name"]
+ copyin_props = ["ui_port", "bootstrap_ui_port", "docker_project_name"]
class XOSVolume(XOSResource):
provides = "tosca.nodes.XOSVolume"