Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds environment set up; Adds executor tests #9

Merged
merged 6 commits into from
Dec 18, 2017
Merged

Adds environment set up; Adds executor tests #9

merged 6 commits into from
Dec 18, 2017

Conversation

cirocosta
Copy link
Owner

@cirocosta cirocosta commented Dec 18, 2017

closes #3
closes #6

Aside from covering those issues, it also makes possible to perform templating on any of those fields. For instance:

Jobs:
  - Id: 'Job1'
    CaptureOutput: true
    Run: 'echo lol'

  - Id: 'Job2'
    CaptureOutput: true
    Env: 
      FOO: '{{ .Jobs.Job1.Output }}'
    Run: 'echo $FOO'
    DependsOn: [ 'Job1' ] 

would lead to

lol
lol

Sample execution:

Env:
  WORD: 'BAZ'

Jobs:
  - Id: 'SayFoo'
    Run: 'echo $WORD'
    Env:
      WORD: 'foo'

  - Id: 'SayBaz'
    Run: 'echo $WORD'
    DependsOn: [ 'SayFoo' ]

  - Id: 'SayCaz'
    Run: 'echo $SAY'
    Env:
      SAY: 'CAZ'
    DependsOn: [ 'SayFoo' ]

leads to

cr --file ./examples/environment.yaml --stdout=true

	Starting execution.

	Logs directory:	/tmp
	
SayFoo	status=STARTED	start=21:22:55
foo
SayFoo	status=SUCCESS	start=21:22:55	elapsed=4.176744ms
SayBaz	status=STARTED	start=21:22:55
SayCaz	status=STARTED	start=21:22:55
BAZ
SayBaz	status=SUCCESS	start=21:22:55	elapsed=4.781021ms
CAZ
SayCaz	status=SUCCESS	start=21:22:55	elapsed=5.706108ms

@cirocosta cirocosta merged commit dc8c1f4 into master Dec 18, 2017
@cirocosta cirocosta deleted the env branch December 18, 2017 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Env vars do not work as expected Merge global and job-specific environment with current environment
1 participant