Project structure generator.
Generate project structures using yaml and golang templating.
NOTE: orbi just works with *nix operating systems, windows is not supported for now.
$ go get github/bronzdoc/orbiOrbi defines project structures using a definition.yml.
---
context: .
resources:
- dir:
name: dir_1
files:
- file_a
- dir:
name: dir_2
files:
- file_b
dir:
name: dir_3
files:
- file_c
- file_d
- files:
- file_e
- file_fA context is where your resources structure will be created.
The way orbi organize definitions is with something called a plan, you can create a new plan by doing:
$ orbi plan new my_planThis command will generate the following:
$ tree ~/.orbi/plans/my_plan
my_plan
├── definition.yml
└── templatesYou can notice a templates directory, this is where your templates should be.
In order to template a file all you need to do is create a file named the same as a file resource.
context: .
resources:
files:
- file_a├── definition.yml
└── templates
└── file_aOk, we have a plan with a definition.yml and templates, so... how we create all that stuff we defined?
All you need to do is tell orbi to execute a plan:
$ orbi exec my_planthis command will generate the file structure defined in your plan definition.yml.
If your plan templates happen to have variables, you can pass values to those variables with the --vars flag.
in .orbi/plans/my_plan/templates/file_a
{{.name}} is awesome
$ orbi exec my_plan --vars="name=Tarantino"that command will generate the file named file_a with content Tarantino is awesome.
NOTE: you can also pass a KEY=VALUE variables file with
--vars-file
orbi let you download a plan from a repository with the orbi plan get command
ssh:
$ orbi plan get my_plan [email protected]:user/plan_name.githttps:
$ orbi plan get my_plan https://[email protected]/user/plan_name.gitContributions are greatly appreciated and encouraged, see CONTRIBUTING
