Fabric environment variables set in .bashrc are not available

I am using Fab to deploy my application. My application depends on some environment variables set in $ HOME / .bashrc. However, when I use fab to run the application using the following command

run("java -jar app.jar")

This application does not work as expected, because environment variables such as SMTP_HOST, SMTP_PORT, which I set in $ HOME / .bashrc, are not available for this application?

I set env variables to $ HOME / .bashrc as below

export SMTP_PORT=abc

How to ensure that environment variables are set before I run the run () command to launch the application?

+4
source share
1

.bashrc:

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

, , ( /bin/bash -l -c some_command)

export SMTP_PORT=abc .bash_profile .profile

+6

All Articles