Great news Vic, I hope you learned something about the (intensely weird)
world of unix shell initialisation :-)

Lee Hambley
--
http://lee.hambley.name/
+49 (0) 170 298 5667


On 3 July 2013 14:05, Vic Van <[email protected]> wrote:

> Just a final followup for completeness.
> I was able to solve my use case issue by adding "export ABC=123" to
> /etc/bash.bashrc (on Ubuntu 12.04)
> (Note that it had to be before the line: "[ -z "$PS1" ] && return"
> otherwise the script would have exited as the invocation mode is
> non-interactive)
>
> Thanks again for your great help Lee!
> Take care,
> Vic
>
> On Monday, 1 July 2013 12:26:12 UTC+1, Vic Van wrote:
>>
>> Ok - I'll give the "/etc/bash.bashrc" route a try and see how I get on
>> (will give it a try around the end of the week)
>> Yep already using the :default_env settings for other ENV vars - the
>> motivation for this though is to not have this one particular ENV var value
>> in source control.
>> Thanks again!!
>> Vic
>>
>> On Monday, 1 July 2013 10:46:16 UTC+1, Lee Hambley wrote:
>>>
>>> Hey Vic, replies inline
>>>
>>> On 1 July 2013 11:36, Vic Van <[email protected]> wrote:
>>>
>>>> Ok - thanks for the response Lee.
>>>>
>>>> So from that page I understand cap is using non-login/non-interactive
>>>> shell:
>>>> "execute a script remotely, e.g. ssh user@host 'echo $PWD' or with *
>>>> Capistrano:non-login, non-interactive*"
>>>>
>>>> Does that imply that I can use?
>>>> interactive *non-login*: /etc/bash.bashrc (bash/ubuntu)
>>>>
>>>
>>> Your mileage may vary, better might be to code your environmental
>>> settings into your Capfiles. Theres a :default_env varsiable you can set to
>>> a hash of the values you need.
>>>
>>>
>>>> Alternatively (if I understood your comment about explicitly not
>>>> loading dotfiles) is there a way I could possibly prefix all commands to
>>>> source my ENV vars just prior to execution?
>>>>
>>>
>>> ALL commands!?...... you need to tidy up your servers!! Relying on scripts
>>> that might change outside your source control to keep your deployment
>>> running sounds like a disaster waiting to happen, that's why things are the
>>> way they are.
>>>
>>>
>>>
>>>
>>>> Thanks again!
>>>> Vic
>>>>
>>>> On Friday, 28 June 2013 18:28:17 UTC+1, Lee Hambley wrote:
>>>>
>>>>> I am assuming the cap shell isn't kicking them.
>>>>>
>>>>>
>>>>> See: https://github.com/**sstephenson**/rbenv/wiki/Unix-**shell-**
>>>>> initialization<https://github.com/sstephenson/rbenv/wiki/Unix-shell-initialization>
>>>>>
>>>>> (Long story short we intentionally don't load dot files)
>>>>>
>>>>> Lee Hambley
>>>>> --
>>>>> http://lee.hambley.name/
>>>>> +49 (0) 170 298 5667
>>>>>
>>>>>
>>>>> On 28 June 2013 16:30, Vic Van <[email protected]> wrote:
>>>>>
>>>>>>  Hi!
>>>>>>
>>>>>> Hopefully a quick one... I am deploying a rails app that relies on a
>>>>>> some local ENV vars on the target server.
>>>>>> I know I can specify the env values in the cap script, but I don't
>>>>>> want to do that as I want those values to reside on the server only
>>>>>> (security reasons)
>>>>>>
>>>>>> My ENV vars are defined within a profile.d script on the target
>>>>>> server - and as they aren't getting picked up (first rake command within
>>>>>> cap fails due to missing var).
>>>>>> I am assuming the cap shell isn't kicking them. (Source is OSX ML -
>>>>>> Target is Ubuntu 12.04 server)
>>>>>>
>>>>>> Anything I'm missing with this - or perhaps any ideas on a better way
>>>>>> to define the server ENV vars such that the cap deploy process picks them
>>>>>> up from the target server during deployment?
>>>>>>
>>>>>> Thanks!!
>>>>>> Vic
>>>>>>
>>>>>>
>>>>>>
>>>>>>  --
>>>>>> --
>>>>>> * You received this message because you are subscribed to the Google
>>>>>> Groups "Capistrano" group.
>>>>>> * To post to this group, send email to [email protected]
>>>>>> * To unsubscribe from this group, send email to capistrano+...@**
>>>>>> googlegroups.**com For more options, visit this group at
>>>>>> http://groups.google.com/**group**/capistrano?hl=en<http://groups.google.com/group/capistrano?hl=en>
>>>>>>
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Capistrano" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to capistrano+...@**googlegroups.**com.
>>>>>>
>>>>>> For more options, visit 
>>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>>> .
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>  --
>>>> --
>>>> * You received this message because you are subscribed to the Google
>>>> Groups "Capistrano" group.
>>>> * To post to this group, send email to [email protected]
>>>> * To unsubscribe from this group, send email to
>>>> capistrano+...@googlegroups.**com For more options, visit this group
>>>> at 
>>>> http://groups.google.com/**group/capistrano?hl=en<http://groups.google.com/group/capistrano?hl=en>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Capistrano" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to capistrano+...@googlegroups.**com.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>>  --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to
> [email protected] For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to