Travis环境变量(Python)

时间:2018-01-02 20:37:11

标签: python travis-ci

我在Travis控制台中将“ENVIRONMENT”设置为环境变量,但是当Travis运行时,它仍然无法访问Python中的变量。任何的想法?

  File "/home/travis/build/.../config/env.py", line 12, in set
    builtins.environment = os.environ['ENVIRONMENT']
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'ENVIRONMENT'

1 个答案:

答案 0 :(得分:2)

我会尝试回答,因为这是我能想到的唯一原因。

在Linux / unix bash / ksh上,执行:

export ENVIRONMENT=somevalue

不会将值传播到子进程。你必须$('.track-box-container').click(function() { //Get height of content var height = $(this).find('.track-content').height() + 250; //Convert height to string var heightStr = height.toString(); //Toggle height and content box display if ($(this).height() == 200) { $(this).animate({height: heightStr}); $(this).find('.track-content').show(); } else if ($(this).height() == heightStr) { $(this).find('.track-content').hide(); $(this).animate({height: "200px"}); } }); (在bash中):

`//<?php
//$pageName = basename($_SERVER['PHP_SELF']);
//?>
<form method="post" action="processNotes.php">
Notes : <textarea name="notes_text"></textarea><br />
<input type="hidden" name="page_name" value="<?php echo 
basename($_SERVER['PHP_SELF']); ?>">
<input type="submit" value="Submit" />
</form>`