secure environment variable from python

emmanuel's Avatar

emmanuel

13 Apr, 2017 08:13 AM

Hello ;-)
I've set secure variables in the environment: global section, and wanted to use them in the on_success section from a python script. Ex:
environment:
  global:
    deploy_host:
      secure: x1oONeeBrDFakds4SD6A574PeQpzjINr3mEM=
...
on_success:
  - python script.py

and in the python script.py:
   server = os.environ['deploy_host']

but this leads to:
   server = os.environ['deploy_host']
  File "C:\Miniconda-x64\lib\os.py", line 425, in __getitem__
    return self.data[key.upper()]
KeyError: 'DEPLOY_HOST'

it cannot find this variable. I though the problem would be only when doing a PR, but it actually cannot find it from the master branch ...
can you help please ?

  1. 1 Posted by emmanuel on 13 Apr, 2017 09:05 AM

    emmanuel's Avatar

    Actually it worked without problem from my account.

    but as our github call another appveyor account than mine for the automatic builds.. it failed because these variables were only defined on my (appveyor) account.

  2. Support Staff 2 Posted by Ilya Finkelshte... on 13 Apr, 2017 04:31 PM

    Ilya Finkelshteyn's Avatar

    I am not sure I understand last post about accounts, can you please clarify with examples?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

19 Oct, 2017 02:25 AM
18 Oct, 2017 07:26 PM
18 Oct, 2017 11:00 AM
18 Oct, 2017 08:54 AM
18 Oct, 2017 07:42 AM

 

17 Oct, 2017 07:36 PM
17 Oct, 2017 05:39 PM
17 Oct, 2017 04:29 PM
17 Oct, 2017 07:49 AM
16 Oct, 2017 11:38 PM
16 Oct, 2017 10:01 PM