Skip to content

Commit

Permalink
additional technology rules and implementations (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner authored Sep 8, 2024
1 parent 85fa73c commit 2aecb85
Show file tree
Hide file tree
Showing 191 changed files with 19,685 additions and 6,056 deletions.
1,704 changes: 1,343 additions & 361 deletions docs/docs/variability4tosca/rules/index.md

Large diffs are not rendered by default.

1,131 changes: 772 additions & 359 deletions docs/docs/variability4tosca/rules/technology-rules.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,186 @@ node_types:
#
################################################################

shop.component~service.application#docker.image::[email protected]>local.machine:
derived_from: shop.component
metadata:
vintner_generated: 'true'
vintner_orchestrator: unfurl
attributes:
application_address:
type: string
default: 127.0.0.1
interfaces:
Standard:
operations:
create:
implementation:
primary: Ansible
operation_host: ORCHESTRATOR
inputs:
playbook:
q:
- name: start container
community.docker.docker_container:
name: '{{ SELF.application_name }}'
image: '{{ ".artifacts::docker_image::file" | eval }}'
network_mode: host
env:
PORT: '"{{ SELF.application_port }}"'
DB_DIALECT: '"{{ SELF.DB_DIALECT }}"'
DB_NAME: '"{{ SELF.DB_NAME }}"'
DB_USERNAME: '"{{ SELF.DB_USERNAME }}"'
DB_PASSWORD: '"{{ SELF.DB_PASSWORD }}"'
DB_ADDRESS: '"{{ SELF.DB_ADDRESS }}"'
DB_PORT: '"{{ SELF.DB_PORT }}"'
FEATURE_OPTIONAL: '"{{ SELF.optional_feature }}"'
FEATURE_PREMIUM: '"{{ SELF.premium_feature }}"'
delete:
implementation:
primary: Ansible
operation_host: ORCHESTRATOR
inputs:
playbook:
q:
- name: stop container
community.docker.docker_container:
name: '{{ SELF.application_name }}'
state: absent
shop.component~service.application#docker.image::[email protected]>local.machine:
derived_from: shop.component
metadata:
vintner_generated: 'true'
vintner_orchestrator: unfurl
attributes:
application_address:
type: string
default: 127.0.0.1
interfaces:
Standard:
operations:
create:
implementation:
primary: Ansible
operation_host: ORCHESTRATOR
inputs:
playbook:
q:
- name: touch compose
register: compose
ansible.builtin.tempfile:
suffix: '{{ SELF.application_name }}.compose.yaml'
- name: create compose
ansible.builtin.copy:
dest: '{{ compose.path }}'
content: '{{ manifest | to_yaml }}'
vars:
manifest:
name: '{{ SELF.application_name }}'
services:
application:
container_name: '{{ SELF.application_name }}'
image: '{{ ".artifacts::docker_image::file" | eval }}'
network_mode: host
environment:
PORT: '"{{ SELF.application_port }}"'
DB_DIALECT: '"{{ SELF.DB_DIALECT }}"'
DB_NAME: '"{{ SELF.DB_NAME }}"'
DB_USERNAME: '"{{ SELF.DB_USERNAME }}"'
DB_PASSWORD: '"{{ SELF.DB_PASSWORD }}"'
DB_ADDRESS: '"{{ SELF.DB_ADDRESS }}"'
DB_PORT: '"{{ SELF.DB_PORT }}"'
FEATURE_OPTIONAL: '"{{ SELF.optional_feature }}"'
FEATURE_PREMIUM: '"{{ SELF.premium_feature }}"'
- name: apply compose
ansible.builtin.shell: docker compose -f {{ compose.path }} up -d
args:
executable: /usr/bin/bash
delete:
implementation:
primary: Ansible
operation_host: ORCHESTRATOR
inputs:
playbook:
q:
- name: touch compose
register: compose
ansible.builtin.tempfile:
suffix: '{{ SELF.application_name }}.compose.yaml'
- name: create compose
ansible.builtin.copy:
dest: '{{ compose.path }}'
content: '{{ manifest | to_yaml }}'
vars:
manifest:
name: '{{ SELF.application_name }}'
services:
application:
container_name: '{{ SELF.application_name }}'
image: '{{ ".artifacts::docker_image::file" | eval }}'
network_mode: host
environment:
PORT: '"{{ SELF.application_port }}"'
DB_DIALECT: '"{{ SELF.DB_DIALECT }}"'
DB_NAME: '"{{ SELF.DB_NAME }}"'
DB_USERNAME: '"{{ SELF.DB_USERNAME }}"'
DB_PASSWORD: '"{{ SELF.DB_PASSWORD }}"'
DB_ADDRESS: '"{{ SELF.DB_ADDRESS }}"'
DB_PORT: '"{{ SELF.DB_PORT }}"'
FEATURE_OPTIONAL: '"{{ SELF.optional_feature }}"'
FEATURE_PREMIUM: '"{{ SELF.premium_feature }}"'
- name: unapply compose
ansible.builtin.shell: docker compose -f {{ compose.path }} down
args:
executable: /usr/bin/bash
shop.component~service.application#docker.image::[email protected]>local.machine:
derived_from: shop.component
metadata:
vintner_generated: 'true'
vintner_orchestrator: unfurl
attributes:
application_address:
type: string
default: 127.0.0.1
interfaces:
Standard:
operations:
configure:
implementation:
primary: Terraform
delete:
implementation:
primary: Terraform
defaults:
inputs:
main:
terraform:
- required_providers:
- docker:
source: kreuzwerker/docker
version: 3.0.2
required_version: '>= 0.14.0'
provider:
docker:
- host: unix:///var/run/docker.sock
resource:
docker_container:
application:
- env:
- PORT={{ SELF.application_port }}
- DB_DIALECT={{ SELF.DB_DIALECT }}
- DB_NAME={{ SELF.DB_NAME }}
- DB_USERNAME={{ SELF.DB_USERNAME }}
- DB_PASSWORD={{ SELF.DB_PASSWORD }}
- DB_ADDRESS={{ SELF.DB_ADDRESS }}
- DB_PORT={{ SELF.DB_PORT }}
- FEATURE_OPTIONAL={{ SELF.optional_feature }}
- FEATURE_PREMIUM={{ SELF.premium_feature }}
image: ${docker_image.image.image_id}
name: '{{ SELF.application_name }}'
network_mode: host
docker_image:
image:
- name: '{{ ".artifacts::docker_image::file" | eval }}'
shop.component~service.application#docker.image::[email protected]>remote.machine:
derived_from: shop.component
metadata:
Expand Down Expand Up @@ -234,7 +414,7 @@ node_types:
DB_PORT: '"{{ SELF.DB_PORT }}"'
FEATURE_OPTIONAL: '"{{ SELF.optional_feature }}"'
FEATURE_PREMIUM: '"{{ SELF.premium_feature }}"'
- name: apply compose
- name: unapply compose
ansible.builtin.shell: docker compose -f {{ compose.path }} down
args:
executable: /usr/bin/bash
Expand Down
Loading

0 comments on commit 2aecb85

Please sign in to comment.