Presuming you use Oauth2 for auth with spinnaker, this will help you extract a Spinnaker session id from your browser. Then you can use it with the cli (roer as of now) and API things, say via curl
.
NOTE: This assumes you're using a Chrome based browser on macos or linux.
-
Make sure you have latest python 3
-
Get all the files in this gist (hint: Click
Download ZIP
above) -
Run make like this:
$ make deps
$ export SPINNAKER_ADDR=https://your-spinnaker.com
$ make run
Optionally you could put the python script somewhere in your $PATH
, and make it executable. Then you would run spin-login.py
.
$ export SPINNAKER_ADDR=https://your-spinnaker.com
$ export SPINNAKER_SESSION=$(make run)
$ echo $SPINNAKER_SESSION
c95ebebd-20cb-4292-ad20-2cda13b5ceb8
$ roer --as $SPINNAKER_SESSION app list
INFO[0000] Fetching application list
...
Added a few scripts to my ~/.zshrc file to make things easier to run:
Setup:
/usr/local/spin-auth
make -C /usr/local/spin-auth deps