Skip to content

bronzdoc/orbi

Repository files navigation

orbi Build Status

Project structure generator.

Generate project structures using yaml and golang templating.

Install

NOTE: orbi just works with *nix operating systems, windows is not supported for now.

Binaries

Via Go

$ go get github/bronzdoc/orbi

Usage

Orbi 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_f

A 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_plan

This command will generate the following:

$ tree ~/.orbi/plans/my_plan

my_plan
├── definition.yml
└── templates

You 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_a

Ok, 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_plan

this 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

Sharing plans

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.git

https:

$ orbi plan get my_plan https://[email protected]/user/plan_name.git

Contributing

Contributions are greatly appreciated and encouraged, see CONTRIBUTING