Added a heredoc to get-token.
This commit is contained in:
15
get-token.py
15
get-token.py
@@ -1,4 +1,19 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Get an Azure DevOps token and print it in a format suitable for exporting as an environment variable.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
eval $(python get-token.py)
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
python get-token.py > set-ado-token.sh
|
||||||
|
source set-ado-token.sh
|
||||||
|
|
||||||
|
Now you can use the ADO_TOKEN environment variable, for example using curl:
|
||||||
|
|
||||||
|
curl -H "Authorization: Bearer $ADO_TOKEN" https://dev.azure.com/your_organization/_apis/projects?api-version=7.1
|
||||||
|
"""
|
||||||
|
|
||||||
from sk.azure import get_token
|
from sk.azure import get_token
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user