2017 © Pedro Peláez
 

yii2-extension yii2-yaml-converter-command

Converts and merges YAML files based on YAML rules

image

dmstr/yii2-yaml-converter-command

Converts and merges YAML files based on YAML rules

  • Friday, September 22, 2017
  • by schmunk
  • Repository
  • 3 Watchers
  • 2 Stars
  • 5,011 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 1 % Grown

The README.md

YAML Converter Extension for Yii 2.0 Framework


:rotating_light: THIS REPOSITORY IS DEPRECATED, (*1)


TL;dr

This is a console command to convert and merges YAML files., (*2)

This project was developed as a helper-tool for our Docker development and build process and may be currently in a heavily biased state., (*3)

Note you can run this command directly with docker, since it's part of Phundament. See below for details., (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Either run, (*6)

composer require --prefer-dist dmstr/yii2-yaml-converter-command "*"

to the require section of your composer.json file., (*7)

Register a converter command in console configuration, (*8)

'controllerMap' => [
    'stack-converter' => 'dmstr\console\controllers\DockerStackConverterController'
],

Usage

Within a Yii 2.0 application

Once the extension is installed, use it on the command line:, (*9)

./yii yaml/convert-docker-compose \
    --dockerComposeFile=@app/docker-compose.yml \
    --templateDirectory=@app/build/stacks-tpl \
    --outputDirectory=@app

Alternative alias, (*10)

./yii yaml/convert-docker-compose \
    --dockerComposeFile=@root/docker-compose.yml \
    --templateDirectory=@root/build/stacks-tpl \
    --outputDirectory=@root

Via Docker image

You can run the converter for Docker stacks directly with Docker, from the phundament/app Docker image, (*11)

docker run phundament/app ./yii help yaml/convert-docker-compose

After checking the options, we may mount i.e. tests to /mnt in the container and run the conversion process, (*12)

docker run -v `pwd`/tests:/mnt phundament/app ./yii yaml/convert-docker-compose \
    --dockerComposeFile=/mnt/base.yml \
    --templateDirectory=/mnt/stacks-tpl \
    --templateReplacementsFile=/mnt/eny.yml \
    --outputDirectory=/mnt/stacks-gen

Hint! You can check the installed version with docker run phundament/app composer show -i dmstr/yii2-yaml-converter-command, (*13)

How it works?

docker-compose converter

The conversion process follows the following simple ruleset, (*14)

  • read dockerComposeFile as new base-file
  • find *.tpl.yml files in templateDirectory
  • read templateReplacementsFile and replace values in every template
  • apply .variable rules (like CLEAN)
  • merge template with base-file and write new file to outputDirectory
  • if there's a subfolder with the same name as the template, recurse into that folder and repeat the process with the new file, just created in the last step

You can use .image: CLEAN to remove the image attribute of a service., (*15)

The Versions

22/09 2017

dev-master

9999999-dev

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

16/06 2015

0.3.1

0.3.1.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

15/06 2015

0.3.0

0.3.0.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

09/06 2015

0.2.0

0.2.0.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

22/05 2015

0.1.1

0.1.1.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

22/05 2015

0.1.0

0.1.0.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

21/04 2015

0.0.3

0.0.3.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

20/04 2015

0.0.2

0.0.2.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

14/04 2015

0.0.1

0.0.1.0

Converts and merges YAML files based on YAML rules

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2