forked from mozilla-mobile/focus-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-adjust-token.py
More file actions
22 lines (17 loc) · 780 Bytes
/
get-adjust-token.py
File metadata and controls
22 lines (17 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
This script talks to the taskcluster secrets service to obtain the
Adjust token and write it to the .adjust_token file in the root
directory.
"""
import os
import taskcluster
# Get JSON data from taskcluster secrets service
secrets = taskcluster.Secrets({'baseUrl': 'http://taskcluster/secrets/v1'})
data = secrets.get('project/focus/tokens')
token_file_path = os.path.join(os.path.dirname(__file__), '../../.adjust_token')
with open(token_file_path, 'w') as token_file:
token_file.write(data['secret']['adjustToken'])
print("Imported adjust token from secrets service")