Import tasks to run from other yaml files #5

Open
opened 2026-08-28 21:41:21 +03:00 by egzakharovich · 1 comment

Place common tasks in separated yaml files in the same repository, instead of baking scripts inside base container.

It may come useful if building from local yaml files, not from HTTP URL.

Place common tasks in separated yaml files in the same repository, instead of baking scripts inside base container. It may come useful if building from local yaml files, not from HTTP URL.
Author

In my perspective, I see it like this:

The imported yaml file have exactly same structure as capsule manifest, but can be partial, like contain only install section:

install:
  - name: update repos
    run: |
      apt-get update -y

In the main manifest, import can look like this:

# [...]

install:
    - import: common/update-repos.yaml
    - name: install app
      run: |
          apt-get install -y firefox

# [...]

And objects from install section of common/update-repos.yaml will be placed exactly at the import section position, expanded. Resulting in the following file:

# [...]

install:
    - name: update repos
      run: |
          apt-get update -y
    - name: install app
      run: |
          apt-get install -y firefox

# [...]

What is considered for discussion, if we allow merging export, env and other sections. But ignoring fields like image, output, compression... Making manifests truly modular.

Like, you can just import any other capsule manifest files, defining installation of different programs into one big merged capsule. But they will be in separate files and can be used independently if needed.

In my perspective, I see it like this: The imported yaml file have exactly same structure as capsule manifest, but can be partial, like contain only install section: ```yaml install: - name: update repos run: | apt-get update -y ``` In the main manifest, import can look like this: ```yaml # [...] install: - import: common/update-repos.yaml - name: install app run: | apt-get install -y firefox # [...] ``` And objects from install section of `common/update-repos.yaml` will be placed exactly at the import section position, expanded. Resulting in the following file: ```yaml # [...] install: - name: update repos run: | apt-get update -y - name: install app run: | apt-get install -y firefox # [...] ``` What is considered for discussion, if we allow merging `export`, `env` and other sections. But ignoring fields like `image`, `output`, `compression`... Making manifests truly modular. Like, you can just import any other capsule manifest files, defining installation of different programs into one big merged capsule. But they will be in separate files and can be used independently if needed.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
dmitry/capsule#5
No description provided.