Created
March 8, 2019 16:17
-
-
Save LucianBuzzo/c2586a699dcfc11e39dfafb7d4d7bc88 to your computer and use it in GitHub Desktop.
Retrieve Balena app git url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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