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

Add run args and accept barcelona yml vars #23

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Conversation

davidsiaw
Copy link
Contributor

Context

This PR allows the barcelona.yml to specify environment variables for container s started specially using the bcn run command. This will allow specific env vars to be set specifically for humans to operate remote services properly, instead of forcing the human to constantly use the export everytime the user needs to do work on the remote machine.

In this change, we add the ability to set a run_env for each environment in the barcelona yml file that only gets passed in when bcn run is used

This also adds a parameter -E to add/overwrite parameters from the barcelona.yml.

Refs #14

  1. Create a barcelona.yml with the following:
environments:
  hello:
    name: hello
    image_name: hello_world
    scheduled_tasks: []
    run_env:
      vars:
        ABCDEF: ghi
        HELLO: meow
    services:
      - name: web
        service_type: web
        memory: 256
  1. Run this command: bcn -d run -e hello -E HELLO=XD sh
  2. Observe the output contains:
{"command":"sh","env_vars":{"ABCDEF":"ghi","HELLO":"XD"},"interactive":true}

@degicat
Copy link

degicat commented Apr 1, 2020

@essa please review this

@degicat degicat requested a review from essa April 1, 2020 08:11
@davidsiaw
Copy link
Contributor Author

davidsiaw commented Apr 1, 2020

A PR to barcelona will follow to complete this change

@degicat degicat requested a review from Yuuki77 April 1, 2020 08:13
@degicat
Copy link

degicat commented Apr 1, 2020

@Yuuki77 please review this

Copy link
Contributor

@essa essa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Yuuki77
Copy link
Contributor

Yuuki77 commented Apr 1, 2020

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants