Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend another service groups #23

Open
esloch opened this issue Jan 31, 2023 · 2 comments
Open

Extend another service groups #23

esloch opened this issue Jan 31, 2023 · 2 comments
Milestone

Comments

@esloch
Copy link
Contributor

esloch commented Jan 31, 2023

  • containers-sugar version:
  • Python version:
  • Operating System:

Description

Popose:

Use base images created in advance.

@xmnlab
Copy link
Member

xmnlab commented Jul 20, 2023

Add a extends attribute to the container group where it would get all the configurations from the specified group

@xmnlab xmnlab added this to the OSL-C202301 milestone Nov 13, 2023
@xmnlab
Copy link
Member

xmnlab commented Jan 29, 2024

example

Consider the following .sugar.yaml:

version: 1.0
compose-app: docker compose
env-file: .env
defaults:
  group: {{ env.KXGR_GROUP }}
  project-name: sugar-{{ env.KXGR_PROJECT_NAME }}
groups:
  dev:
    project-name: dev
    compose-path: 
      - tests/containers/compose.dev.yaml
    env-file: .env
    services:
      default: django,prostgresql
      available:
        - name: django
        - name: postgresql
        - name: service1-3

  staging:
    project-name: staging
    compose-path: 
      - tests/containers/compose-staging.yaml
    env-file: .env
    services:
      default: django,nginx,postgresql
      available:
        - name: django
        - name: nginx
        - name: postgresql

  prod:
    project-name: prod
    compose-path:
      - tests/containers/compose-prod.yaml
    env-file: .env
    services:
      default: django,nginx,postgresql
      available:
        - name: django
        - name: nginx
        - name: postgresql
        - name: memcache

it would be nice to have a mechanism for extending other groups.

version: 1.0
compose-app: docker compose
env-file: .env
defaults:
  group: {{ env.KXGR_GROUP }}
  project-name: sugar-{{ env.KXGR_PROJECT_NAME }}
groups:
  base:
    compose-path: 
      - tests/containers/compose.dev.yaml
    env-file: .env
    services:
      default: django,prostgresql
      available:
        - name: django
        - name: postgresql

  dev:
    compose-path: 
      - tests/containers/compose.dev.yaml
    extends: base

  staging:
    compose-path: 
      - tests/containers/compose-staging.yaml
    extends: base
    services:
      default: nginx
      available:
        - name: nginx

  prod:
    compose-path:
      - tests/containers/compose-prod.yaml
    extends: base
    services:
      default: nginx,memcache
      available:
        - name: nginx
        - name: memcache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants