abantos / bolt

A task automation tool (similart to grunt) for Python
MIT License
15 stars 8 forks source link

Task to Set Environment Variables #93

Closed CurroRodriguez closed 5 years ago

CurroRodriguez commented 6 years ago

Story

As a bolt user, I want the ability to set an environment variable during script execution, so I can leverage their value in the environment.

Description

Implement a task that adds environment variables to the execution environment. This can come handy to control environment behaviors. For example, I have a Flask application that connects to a real database in production but to a test database during testing. Which database is used is controlled through configuration, but the configuration itself is controlled by an environment variable.

This task will allow me to set the environment variable accordingly whether I am running test tasks or just the application in a production environment. The configuration should look like:

config = {
    'set-var' : {
        'VAR1': 'val1',
        'VAR2' : 'val2'
    }
}
CurroRodriguez commented 5 years ago

Implemented in PR #95