Giter Club home page Giter Club logo

aviator's Introduction

Aviator

GoDoc

Aviator is a tool to template & merge YAML files in a convenient fashion based on a configuration file called aviator.yml. Aviator utilizes Spruce for templating and merging and therefore enables you to use all the Spruce operators in your YAML files.

If you have to handle rather complex YAML files (for Kubernetes, Concourse, or Bosh), you just provide the flight plan (aviator.yml), the Aviator flies you there.

Reads:

Installation

OS X

$ wget -O /usr/local/bin/aviator https://github.com/JulzDiverse/aviator/releases/download/v1.9.0/aviator-darwin-amd64 && chmod +x /usr/local/bin/aviator

Via Homebrew

$ brew tap julzdiverse/tools  
$ brew install aviator

Linux

$ wget -O /usr/bin/aviator https://github.com/JulzDiverse/aviator/releases/download/v1.9.0/aviator-linux-amd64 && chmod +x /usr/bin/aviator

Windows (NOT TESTED)

https://github.com/JulzDiverse/aviator/releases/download/v1.9.0/aviator-win

Usage

To run Aviator navigate to a directory that contains an aviator.yml and run:

$ aviator

OR

Specify an AVIATOR YAML file with the [--file|-f] option:

$ aviator -f myAviatorFile.yml

Configure an aviator.yml

Aviator provides a verbose style of configuration. It is the result of configuring a spruce merge plan and optionally an execution plan (e.g fly).

Example for a simple aviator file:

spruce:
- base: path/to/base.yml
  merge:
  - with:
      files:
      - top.yml
  to: result.yml

Spruce Section

The spruce section is an array of merge steps. It provides different parameters to provide high flexibility when merging YAML files. You can:

  • specify specific files to include into your merge
  • specify a specific directory to include into your merge
  • specify a specific directory including all subdirectories to include into your merge

However, this is not enough. Additionally you can use regular expressions, environment-variables, and more. Read about all parameters and what they do in this section.

Base (string)

The base property specifies the path to the base YAML file. All other YAML files will be merged on top of this YAML file.


Prune (Array)

prune defines YAML properties which will be pruned during the merge. For more information check the spruce merge semantics.

Example:

spruce:
- base: base.yml
  prune:
  - meta
  - properties
  merge:
  - with:
      files:
      - top.yml
  to: result.yml

In this case meta and properties will be pruned during merge.

cherry_pick (array)

Enables Spruce cherry pick option: With the cherry_pick property you can specify specific YAML subtrees you want to have in your restulting YAML file (opposite of prune)

Example:

spruce:
- base: path/to/base.yml
  cherry_pick:
  - properties
  merge:
  - with_in: path/to/dir/
  - with:
      files:
      - top.yml
  regexp: ".*.(yml)"
  skip_eval: true
  to: result.yml

go_patch (bool)

To use spruce in conjuction with the go-patch format it can be enabled within the aviator spruce section as a toplevel bool property:

spruce:
- base: some.yml
   go_patch: true
   merge:
   - with:
        files:
        - some/ops/file.yml
   to: result.yml

Read more about it here


Merge (Array)

You can configure three different merge types inside the merge section: with, with_in, with_all_in:

with

with specifies specific files you want to include into the merge.

  • files (required): List of paths to YAML files

  • in_dir (optional): If all of the files you want to include into the merge are in one specific directory, you can specify the directoyr path and list only file names in the files list. Note: Whenever a directory is defined, the path requires a trailing "/"!!!

  • skip_non_existing (optional): Setting this property to true will skip non existing files that are specified in the files list rather then returning an error. This is useful, if a file is not necessarely there.

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with:
      files:
      - top.yml
      - top2.yml
      - top3.yml
    in_dir: path/to/
    skip_non_existing: true
  to: result.yml

with_in (string)

with_in specifies a path (do not forget the trailing "/") to a directory. All files within this directory (but not subdirectories) will be included in the merge.

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with_in: path/to/dir/
  to: result.yml

except (array)

With except you can specify a list of files you want to exclude from the path specified in with_in

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with_in: path/to/dir/
    except:
    - file1
    - file2
  to: result.yml

This will exclude path/to/dir/file1 and path/to/dir/file2 from the merge.

with_all_in

with_all_in specifies a path (do not forget the trailing "/") to a directory. All files within this directory -including all subdirectories - will be included in the merge.

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with_all_in: path/to/dir/
    except:
    - someFiles.yml
    - youWant.yml
    - toExclude.yml
  to: result.yml

NOTE: except also works for with_all_in

regexp (string(quoted))

Only files matching the regular expression will be included in the merge. It can be specified for all three merge types with, with_in, and with_all_in. This could be required if the target directory contains other then only YAML files.

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with_in: path/to/dir/
    regexp: ".*.(yml)"
  - with:
      files:
      - top.yml
    regexp: ".*.(yml)"
  - with_all_in: path/to/another/dir/
    regexp: ".*.(yml)"
  to: result.yml

skip_eval (bool)

Enabling this skip-eval will merge without resolve spruce expressions. For more information check Spruce doc

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with_in: path/to/dir/
  - with:
      files:
      - top.yml
  regexp: ".*.(yml)"
  skip_eval: true
  to: result.yml

To (string)

to specifies the target file, where the merged files should be saved to. It can be used only in combination with the basic merge types files, with_in, and with_all_in.


ForEach

On top of the basic merge you can do more complex merges with for_each. More precisely, you can execute the basic merge for multiple files specified in for_each. When specifying files with for_each you need to use to_dir instead of to to specify a target directory instead of a target file.

files

files specifies a list of files that will be included in your merge seperately.

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with:
      files:
      - top.yml
    regexp: ".*.(yml)"
  for_each:
    files:
    - env.yml
    - env2.yml
  to_dir: results/

This merge step will execute two merges and generate two files. It will merge base.yml and top.yml with env.yml, write it to results/ and do the same with env2.yml.

in

in is basically the same as files with the difference that it will merge all files for a given path sperately

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with:
      files:
      - top.yml
    regexp: ".*.(yml)"
  for_each:
    in: path/to/dir/
  to_dir: results/

Except

except works in combination with in: list of files that you want to exclude from the merge.

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with:
      files:
      - top.yml
  regexp: ".*.(yml)"
  for_each_in: path/to/dir/
  except:
  - some.yml
  to_dir: results/

include_sub_dirs

include_sub_dirs includes all files including files in all subdirectories of a directory into the merge seperately.

spruce:
- base: path/to/base.yml
  merge:
  - with:
      files:
      - top.yml
  regexp: ".*.(yml)"
  for_each:
    in: path/to/dir
    include_sub_dirs: true
    enable_matching: true
    copy_parents: true
  to_dir: results/

When include_sub_dirs is defined you can specify further properties:

  • enable_matching: this will only include files in the merge, that contains the same substring as the parent directory.

  • copy_parents: setting this property to true (default false) will copy the parent folder of a file to the target directory (in the above example results/)

regexp

The regexp property can also be set in combination with for_each, for_each_in, and walk_through to only include files matching the regular expression.

spruce:
- base: path/to/base.yml
  merge:
  - with:
      files:
      - top.yml
  regexp: ".*.(yml)"
  for_each:
    in: path/to/dir
    include_sub_dirs: true
    enable_matching: true
    copy_parents: true
    regexp: ".*.(yml)"
  to_dir: results/

Read From and Write To Internal Datatsore

Sometimes it is required to do more than one merge step, which creates intermediate YAML files. In this case you can save merge results to internal datastore/cache which you can write/read by surrounding your location with double courly braces {{file|dir}}. Internal cache also work as directories and can be used with to_dir.

Example:

spruce:
- base: path/to/base.yml
  merge:
  - with_in: path/to/dir/
  to: {{result}}

- base: {{result}}
  merge:
  - with_in: another/path/
  to: final.yml

Environment Variables

Aviator supports to read Environment Variables. Environment variables can be set with $VAR or ${VAR} at an arbitrary place in the aviator.yml.

Example:

spruce:
- base: $BASE_PATH/app-${NUMBER}.yml
  merge:
  - with_in: path/to/dir/
  to: {{result}}

- base: {{result}}
  merge:
  - with_in: $TARGET_PATH
  to: $RESULT_YAML

Executing aviator as follows:

$ BASE_PATH=/tmp/ NUMBER=1 RESULT_YAML=result.yml aviator

will resolve:

spruce:
- base: /tmp/app-1.yml
  merge:
  - with_in: path/to/dir/
  to: {{result}}

- base: {{result}}
  merge:
  - with_in: $TARGET_PATH
  to: result.yml

Variables

You can provide variables to aviator files using the --var flag. Basic CLI usage:

$ aviator --var key=value

In you aviator file you need to specify the name of the variable you want to interpolate. The syntax for a variable is the following (( varName )) (note the space before and after the variable name!)

Example:

---
spruce:
- base: (( key ))
  ...

In this example the variable key will be replaced by the value value. So the result would look like this:

---
spruce:
- base: value
  ...

Values for aviator variables can be multi-line

Modifier

With modifier you can modify the resulting (merged) YAML file. You can either delete, set, or update a property. The modifier will always be applied on the result. If you use for_each it will be applied on each for_each merge step.

Consider a resulting YAML from a merge process result.yml, which has a property person.name:

---
person:
  name: Julz
  1. the property can be deleted
spruce:
- base: base.yml
  merge:
  - with:
      files:
      - top.yml
  modify:
    delete:
    - "person.name"
  to: result.yml

It deletes a property only if it exists. There will be no error if a proerty does NOT exist.

  1. the property can be updated:
spruce:
- base: base.yml
  merge:
  - with:
      files:
      - top.yml
  modify:
    update:
    - path: person.name
      value: newName
  to: result.yml

Using update will update existing properties only.

  1. Other properties can be added/updated with set:
spruce:
- base: base.yml
  merge:
  - with:
      files:
      - top.yml
  modify:
    set:
    - path: person.name
      value: NewName
  to: result.yml

Set updates or adds a property to an array. If a property exists it will be overwritten, if the property does not exist it will be added (works only for maps not arrays).

Aviator uses goml as YAML modifier. If you want to read more about update, delete, and set, check the README.


Squash Section

You can squash multiple files into one single YAML file using the squash section.

Squashing specific files

squash:
  contents:
  - files:
    - deployment.yml
    - service.yml
  to: app.yml

Squash files from a directory

squash:
  contents:
  - dir: my/dir/
  to: app.yml

Executors

Executors execute executables installed on the OS that Aviator is running on. The following three executors are currently supported by Aviator:

  • kubectl Executor
  • fly Executor
  • Generic Executor: Runs an any specified executable.

kubectl executor

Execute kubectl apply with the following options:

Supported flags

  • file: Name of the file to kubectl apply
  • force: calls kubectl apply with the --force flag
  • dry_run: calls kubectl apply with the --dry-run flag
  • overwrite: calls kubectl apply with the --overwrite flag
  • recursive: calls the kubectl apply with the --recursive flag
  • output: calls the kubectl apply with the --output=<desired-ouput> parameter
  • kustomize: calls the kubectl apply with the --kustomazation/-k flag rather than with --filename/-f.
    • Read more about kubectl apply + kustomization here and here

You can read about the details of the flags of kubectl apply here

Example:

kubectl
  apply:
    file: deployment.yml
    force: true
    dry_run: true
    overwrite: true
    recursive: true
    output: yaml

Kustomize Example:

When kustomize flag in aviator is set to true it will call kubectl apply with the --kustomization/-k flag, which expects a directory path. The directory paht needs to be specified in the file property of kubectl.apply:

kubectl:
  apply:
    file: kustomization/path/
    kustomize: true

Fly Executor

An executor for the Concourse Fly CLI. The supported commands are set-pipeline, validate-pipeline, format-pipeline, and expose-pipeline/hide-pipeline. The set-pipeline and hide-pipeline commands are executed by default. Here is the list of commands and flags that can be used with aviator:

  • name: Name of the pipeline
  • target: Target short name (fly target)
  • config (string): the pipeline config file (yml)
  • load_vars_from (array): List of all property files (-l)
  • vars (map): Map of variables (--var)
  • non_interactive (bool): Enables non-interactive mode (-n)
  • expose (bool): Exposes the pipeline (expose-pipeline)
  • validate_pipeline (bool): Validate local pipeline configuration (failes on errors)
  • strict (bool): causes validate_pipeline to fail on errors AND warnings
  • format_pipeline (bool): format a pipeline config in a "canonical" form (prints to stdout).
  • write: update the formatted pipeline config file in-place.
  • team_name (string): the team name to fly for set-pipeline

More detailed description of the flags can be found here

Example - set-pipeline:

fly:
  name: myPipelineName
  target: myFlyTarget
  team_name: concourse-team
  config: pipeline.yml
  non_interactive: true
  check_creds: true
  load_vars_from:
  - credentials.yml
  vars:
    var1: myvar
    var2: myvar2
  expose: true

Example - validate-pipeline:

fly:
  config: myconfig.yml
  validate_pipeline: true
  strict: true

Example - format-pipeline:

fly:
  config: myconfig.yml
  format_pipeline: true
  write: true

NOTE: You will need to fly login first, before executing aviator

Generic Executor

The Generic Executor executes any specified executable. Here is how to define an Generic Executor in the aviator.yml:

exec:
- executable: some-executable # required
  global_options: # optional
  - name: --option
    value: option-value
  command: # optional
    name: command-name
    options:
    - name: --command-option
      value: command-option-value
  args:
  - arg1
  - arg2

This will executed as $ some-executable --option option-value command-name --command-option command-option-value arg1 arg2

Example: cp

exec:
- executable: cp
  global_options:
  - name: -r
  args:
  - dir/
  - destination/

This calls cp as follows: $ cp -r dir/ destination/


CLI Options

--curly-braces

Some YAML based tools (like concourse in the past) are using {{}} sytnax. This is not YAML conform. Using the --curly-braces option you can allow this syntax.

--silent

This option will output no infromation to stdout.

--verbose

This option prints which files are excluded from a merge.

--dry-run

This option prints contents to stdout rather than writing it to files. This flag also omits any defined executor.

--var

You can provide variables to the aviator file.


Development

$ go get github.com/JulzDiverse/aviator

Build Aviator

To build the aviator binary you can navigate to cmd/aviator:

$ cd ./cmd/aviator`

Now you can build with the go cli:

$ go build 

For more information on the $ go build command run $ go help build.

aviator's People

Contributors

andrew-edgar avatar dan-hill2802 avatar gdankov avatar gorillajulz avatar heavywombat avatar herrjulz avatar missingroberto avatar qu1queee avatar shemau avatar thesgrash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aviator's Issues

[feature request] New merge type that doesn't require a file

Hey Julz,

The suggestion here is to perform a standard merge, but instead of having to always specify files in the with section, we can directly write the yaml code we would like to merge.

For example, let's say we have the following aviator file:

spruce:
- base: path/to/base.yml
  merge:
  - with_obj:
    foo:
      bar: 42
      baz: true
  to: result.yml

That would merge the base file with the following:

foo:
  bar: 42
  baz: true

Why? Sometimes you want to merge something really tiny (2-3 lines) and creating a separate file for that can be an overkill.

Thanks ๐Ÿ™‚

Except not working with for_each and include_sub_dirs

Hi folks,
testing aviator behaviour and going through the code I noticed that the except piece isn't into account when include_sub_dirs is present. Example:

- base: base.yml
  for_each:
    in: configs
    include_sub_dirs: true
    regexp: ".*.yml"
    except: [test.yml]
  to_dir: ++tmp/base_output/++

This can be solved with #46
@herrjulz can you review pls?

Generic file manipulations

I am managing yaml configs with spruce / aviator but also there are some non-yaml static config files that I am copying along. I imagine this applies to some other peoples workflows as well. It would help greatly if I could do things like copy a list of files from place to place. Something like for_each with its properties combined with to_dir but without spruce merge.

Updating from v0.17.0 to v0.18.0 issue

Hi Julz,

I just updated to v0.18.0 and my aviator file is breaking when doing the fly feature. The following config:

fly:
  config: /tmp/final-pipeline.yml
  name: $PIPELINE
  target: $TARGET
  vars:
  - vars.yml

was working fine under v0.17.0, however when upgrading the version, that same part broke with the following:

YAML Parsing Failed: yaml: unmarshal errors:
  line 15: cannot unmarshal !!seq into map[string]string

Have you seen this behaviour?

This is an awesome project

This isn't a real issue. Just wanted to say thank you for your work & making this open source. This is great stuff.

Merge not merging?

Hi,

Trying out this tool and I have a stupid question. Why doesn't merge merge?

thing1.yaml:

a:
  b: c

thing2.yaml:

a:
  d: e

spruce merge does what I expect:

$ spruce merge thing1.yaml thing2.yaml
a:
  b: c
  d: e

But aviator seems to ignore the second file.

$ cat aviator.yml
spruce:
  - base: thing1.yaml
    merge:
    - with:
      files:
      - thing2.yaml
    to: things.yaml
$ aviator
SPRUCE MERGE:
	thing1.yaml
	to: things.yaml

$ cat things.yaml
a:
  b: c

Why didn't the contents of thing2.yaml get merged into the output?

Exposed pipelines can't be hidden

Currently, if you set expose: true your pipeline will be hidden. Setting it to false, though, does nothing. I've opened a PR at #34 which enables previously exposed pipelines to be hidden again.

[feature] investigating applicability of ytt

(To be entirely honest, I'm not 100% sure what the workflow for this would look like yet, just putting an issue here as a way to point this out. Feel free to close this whenever you feel fit.)

I'm investigating using ytt as a way to templatize my concourse pipelines. I thought this might be an interesting project to check out and see if/how it could integrate to aviator.

Thanks for your time!

Possible Bug: merge is overwriting instead of appending

Hello,

I'm using aviator (version 1.9.0) to create a complex, or rather lengthy, pipeline.
The pipeline consists of over a dozen resources, and it would be hard to maintain or add to the pipeline if created by hand.

My aviator file is supposed to create an all_resources.yml, but it's not working as intended.
The file contains the full list of resources with their respective repo-names and repo-urls, and additionally it also contains a job, where all those resources are fetched with get as input to a compilation task.
I managed to get the part of the resources: section working and made a really identical part for the plan: section, but SOMEHOW, the - get lines overwrite each other, which ends up with only the last resource in the final file.

I'm really at a dead end here, because I can't see anything I'm doing wrong.
Can you help me out here?

This is my aviator.yml file:

spruce:
  # First we generate all resources to use in the pipeline
  - base: factory/meta-resource-stub.yml
    prune:
      - meta
    for_each:
      in: meta-resources/
      except:
        - example-resource.yml
      regexp: ".*.(yml)"
    to_dir: temp/resources/
  # Merge all resources into one file
  - base: factory/all-resources-stub.yml
    merge:
      - with_all_in: temp/resources/
        regexp: ".*.(yml)"
    to: temp/all-resources.yml

And these are the stubs:
meta-resource.stub.yml

---
jobs:
  - get: (( grab meta.git.repo-name ))
    trigger: (( grab meta.git.trigger ))
    params:
      depth: 1

resources:
  - name: (( grab meta.git.repo-name ))
    type: git
    source:
      uri: (( grab meta.git.http ))
      username: bot-tt
      password: ((sesource.bot-tt-pw))
      branch: (( grab meta.git.branch ))

all-resources-stub.yml

---
jobs:
  -
resources:
  -

When run, it correctly produces the all-resources.yml but inside, it failed to add each resource in the jobs section, instead it overwrites itself, so only the last resource was added.
The resources section correctly produces ALL generated resources.

I don't know what's wrong, since the two sections are near-identical
And also, I know that the resulting file currently is not correct in terms of concourse syntax, but I reduced it to a minimal example to figure out what's wrong.

fly set-pipeline bails out unless non_interactive = True

I've just upgraded to 1.5.0 and am seeing the following behaviour:

Running aviator, it gets to this part:

AVIATOR EXECUTE:$ fly --target concourse set-pipeline --pipeline mypipeline --config aviator_pipeline.yml

and prints out the correct diff, but then immediately prints bailing out rather than prompting me to accept the change. I can work around this by setting non_interactive: true in aviator.yml. I couldn't see anything related in the recent releases that suggests I've missed some other bit of config, but am quite happy to pointed at it if there was a breaking change along the way. Thanks!

Is windows supported?

Hi,

I tried to build the project in Windows, but got following error. Does the project support windows?

github.com/JulzDiverse/aviator/vendor/code.cloudfoundry.org/commandrunner/linux_command_runner
..\github.com\JulzDiverse\aviator\vendor\code.cloudfoundry.org\commandrunner\linux_command_runner\linux_command_runner.go:27:11: unknown field 'Setpgid' in struct literal of type syscall.SysProcAttr
..\github.com\JulzDiverse\aviator\vendor\code.cloudfoundry.org\commandrunner\linux_command_runner\linux_command_runner.go:30:18: cmd.SysProcAttr.Setpgid undefined (type *syscall.SysProcAttr has no field or method Setpgid)
..\github.com\JulzDiverse\aviator\vendor\code.cloudfoundry.org\commandrunner\linux_command_runner\linux_command_runner.go:39:11: unknown field 'Setpgid' in struct literal of type syscall.SysProcAttr
..\github.com\JulzDiverse\aviator\vendor\code.cloudfoundry.org\commandrunner\linux_command_runner\linux_command_runner.go:42:18: cmd.SysProcAttr.Setpgid undefined (type *syscall.SysProcAttr has no field or method Setpgid)
..\github.com\JulzDiverse\aviator\vendor\code.cloudfoundry.org\commandrunner\linux_command_runner\linux_command_runner.go:51:11: unknown field 'Setpgid' in struct literal of type syscall.SysProcAttr
..\github.com\JulzDiverse\aviator\vendor\code.cloudfoundry.org\commandrunner\linux_command_runner\linux_command_runner.go:54:18: cmd.SysProcAttr.Setpgid undefined (type *syscall.SysProcAttr has no field or method Setpgid)

Not able to build the binary from main.go

Its there a reason why some methods used in main.go are defined in another file call flags.go?
When trying to generate the binary via the go build I have the following error:

# command-line-arguments
./main.go:14: undefined: setCli

If I defined the methods from flags.go into the main.go, then I do not have a problem anymore.

Regards,
Enrique Encalada

non-interactive mode for fly

I would like to use aviator in a meta (concourse) pipeline creating other pipelines. For that to be possible fly needs to be run in non-interactive mode (with -n argument).

I would appreciate adding an option along the lines of:

fly:
  non-interactive: true

that would result appending '-n' to fly args

Render to STDOUT

Sometimes it would useful to be able to render to stdout instead of having to create a file.

[feature request] multi-dimensional for_each

for_each is useful for enumerating a list of targets. I use it to loop over multiple Debian and Ubuntu releases, say ["buster", "bullseye", "bionic", "focal"]. So I have a distros/ folder with one yaml file in it per target distribution, each with the tag names and other details that are necessary for building for that distro.

I'd like to add target architectures to that, but it does not seem possible. I want to add a second loop over the target architecutres, say ["aarch64", "powerpc64", "x86_64"], which works the same way: an arches/ folder with one yaml file in it per target architecture, each with the details necessary for building for that architecture.

The desired result would be a nested pair of for-loops, one for distro, one for architecture. Like this pseudo-code:

for arch in ["aarch64", "powerpc64", "x86_64"]:
    for distro in ["buster", "bullseye", "bionic", "focal"]:
        arch_fn   = "arches/"  + arch   + ".yaml"
        distro_fn = "distros/" + distro + ".yaml"
        output = merge(all_inputs, arch_fn, distro_fn)
        out_fn = "outdir/" + distro + "_" + arch + ".yaml"
        write(out_fn, output)

This would produce the cartesian product of files in distros/ and files in arches/; with one merged output file for each pairing. This syntax is not limited to 2 dimensions, but my current use case is 2-dimensional.

One possible aviator.yml syntax might look like this:

spruce:
  - base: resources.yaml
    for_each:
      - in: distros/
      - in: arches/
    merge:
[...]

I can kinda get functionality similar to this now, by generating a third directory full of pre-merged pairings like "focal_aarch64.yaml", "bullseye_x86_64.yaml", etc, and using for_each to loop over those. But to accomplish this, I'm doing ugly shell loops in a Makefile... it would be nice if the tool could automate this.

Passing error code from fly

Hi,
Not sure if my finding is correct but it looks to me that if fly errors out, then (not every?) exit code from fly gets passed down as aviator exit code.
Since my use case is CI, I care for the pipeline to fail in case of error.

The behavior I am observing:
Add a "put" to pipeline definition with misspelled name, or in any other way not existing among the pipeline resources, say:

   - put: docker-imag
      params:
        build: build-result

Run set-pipeline with fly directly:
fly -t target sp -p pipeline-foo -c pipeline-foo.yml -n
Result:

[...]
apply configuration? [yN]: y
error: invalid configuration:
invalid jobs:
	jobs.pipeline-foo.plan[5].put.docker-imag refers to a resource that does not exist

$ echo $?
1

Doing the same with aviator. My aviator-foo.yml for testing:

fly:
  target: target
  name: pipeline-foo
  config: pipeline-foo.yml
  non_interactive: true

Running:
aviator -f aviator-foo.yml
Result:

[...]
apply configuration? [yN]: y
error: invalid configuration:
invalid jobs:
	jobs.pipeline-foo.plan[5].put.docker-imag refers to a resource that does not exist

$ echo $?
0

For errors from fly, like this one, it would help me if aviator exited with non-zero code. Is it possible to do? Thanks in advance.

[feature request] support executor for each output

I am looking to use aviator to build a large number of similar pipelines. The current example shows building multiple apps and merging them into a single pipeline, followed by a call to fly to install that pipeline.

I would like to have a single aviator file that builds multiple pipelines and calls fly on each generated pipeline.

As an example - take the cf sample and remove the last merge - you would have multiple app pipelines that would need to be installed.

https://github.com/JulzDiverse/aviator-cf-apps/blob/master/aviator.yml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.