Commit 0297dbcd authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Change gitlab repository name to include version

This fixes an issue caused by gitlab repositories soft-delete for 7 days
before they are fully deleted. If we remove a repository in order
to upload new binaries, we need to be able to create a new one right
away. See
parent 61afa2c5
......@@ -73,7 +73,7 @@ def main():
# For gitlab, we have three repositories for linux, mac, and windows.
# The string "arch" will later be replaced with the respective architecture
providers = {
"gitlab": "",
"gitlab": "",
"github": ""
......@@ -148,7 +148,8 @@ def main():
"INSERT INTO links(link, platform, language, arch, version, provider, status, file)"
"VALUES ('%s', '%s', '%s', '64', '%s', '%s', 'ACTIVE', '%s')"
% (providers.get(p).replace("arch", k) + release_link, k, l, version, p, release_link))
% (providers.get(p).replace("arch", k).replace("version", version) +
release_link, k, l, version, p, release_link))
if __name__ == "__main__":
......@@ -24,6 +24,9 @@ failure = False
failed_uploads = []
version = None
data = None
class GitlabRemote:
def __init__(self, token): = Gitlab("", private_token=token)
......@@ -35,11 +38,11 @@ class GitlabRemote:
def create_projects(self):
# Create one project for each platform
windows_repo ={'name': 'torbrowser-windows',
windows_repo ={'name': 'torbrowser-'+version+'-windows',
'visibility': 'public'})
mac_repo ={'name': 'torbrowser-osx',
mac_repo ={'name': 'torbrowser-'+version+'-osx',
'visibility': 'public'})
linux_repo ={'name': 'torbrowser-linux',
linux_repo ={'name': 'torbrowser-'+version+'-linux',
'visibility': 'public'})
self.repositories = {
......@@ -93,8 +96,6 @@ def upload_files(remotes):
print("Error: No remotes to update", file=sys.stderr)
return 1
url = urllib.request.urlopen("")
data = json.loads(
for arch in data['downloads']:
for locale in data['downloads'][arch]:
for asset in data['downloads'][arch][locale]:
......@@ -133,6 +134,13 @@ def upload_files(remotes):
def main():
global version
global data
url = urllib.request.urlopen("")
data = json.loads(
version = data["version"]
remotes = []
if 'GITHUB_AUTH' not in os.environ:
print("WARNING: No Github authentication token given", file=sys.stderr)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment