dmstr/yii2-yaml-converter-command
最新稳定版本:0.3.1
Composer 安装命令:
composer require dmstr/yii2-yaml-converter-command
包简介
Converts and merges YAML files based on YAML rules
关键字:
README 文档
README
🚨 THIS REPOSITORY IS DEPRECATED
TL;dr
This is a console command to convert and merges YAML files.
This project was developed as a helper-tool for our Docker development and build process and may be currently in a heavily biased state.
Note you can run this command directly with
docker, since it's part of Phundament. See below for details.
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist dmstr/yii2-yaml-converter-command "*"
to the require section of your composer.json file.
Register a converter command in console configuration
'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:
./yii yaml/convert-docker-compose \
--dockerComposeFile=@app/docker-compose.yml \
--templateDirectory=@app/build/stacks-tpl \
--outputDirectory=@app
Alternative alias
./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
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
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
How it works?
docker-compose converter
The conversion process follows the following simple ruleset
- read
dockerComposeFileas new base-file - find
*.tpl.ymlfiles intemplateDirectory - read
templateReplacementsFileand replace values in every template - apply
.variablerules (likeCLEAN) - 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: CLEANto remove theimageattribute of a service.
统计信息
- 总下载量: 5.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-04-21