Skip to content

Instantly share code, notes, and snippets.

@LucianBuzzo
Created March 8, 2019 16:17
Show Gist options
  • Select an option

  • Save LucianBuzzo/c2586a699dcfc11e39dfafb7d4d7bc88 to your computer and use it in GitHub Desktop.

Select an option

Save LucianBuzzo/c2586a699dcfc11e39dfafb7d4d7bc88 to your computer and use it in GitHub Desktop.
Retrieve Balena app git url
import os
from balena import Balena
balena = Balena()
token = os.environ['TOKEN']
appId = os.environ['APP_ID']
balena.auth.login_with_token(token)
user = balena.auth.who_am_i()
app = balena.models.application.get(appId)
config = balena.models.config.get_all()
print(user + '@' + config['gitServerUrl'] + ':' + app['slug'] + '.git')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment