SIOS-Technology-Inc / dacrane

"Dacrane" is a Delivery as Code (DaC) tool for deploying cloud infrastructures and applications anywhere.
Apache License 2.0
61 stars 1 forks source link

Changed expression path to allow for shorter notation #78

Closed Ikepeeee closed 10 months ago

Ikepeeee commented 10 months ago

Changed the expression PATH so that it can be expressed in a shorter form. The modules in the path is no longer needed.

old: ${{ modules.foo.modules.bar }}
new: ${{ foo.bar }}

The parameter in the path is no longer needed.

old: ${{ parmeter.foo.modules.bar }}
new: ${{ foo.bar}}

The instances in the path is no longer needed.

old: ${{ instances.foo.bar }}
new: ${{ foo.bar }}

Meta variables such as env and self now need $.

old: ${{ env.FOO }}
new: ${{ $env.FOO }}
old: ${{ self.FOO }}
new: ${{ $self.FOO }}

Parameters can now take more than one.

# old
parameter:
  type: object
  default: { image: sample-api, tag: latest }
  properties:
      image: { type: string, default: sample-api }
      tag: { type: string, default: latest }

# new
parameters:
- name: image
  schema: { type: string, default: sample-api }
- name: tag
  schema: { type: string, default: latest }

This makes calling apply a little easier.

# old
$ dacrane apply aks dev -a '
env: dev
base: ${{ base }}
api: ${{ api-v1 }}
'

# new
$ dacrane apply aks dev \
  -a env=dev \
  -a base='${{ base }}' \
  -a api='${{ api-v1 }}'