GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

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

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 https://bugs.torproject.org/33034
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": "https://gitlab.com/thetorproject/torbrowser-arch/raw/master/",
"gitlab": "https://gitlab.com/thetorproject/torbrowser-version-arch/raw/master/",
"github": "https://github.com/torproject/torbrowser-releases/releases/download/torbrowser-release/"
}
......@@ -148,7 +148,8 @@ def main():
c.execute(
"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):
self.gl = Gitlab("https://gitlab.com", private_token=token)
......@@ -35,11 +38,11 @@ class GitlabRemote:
def create_projects(self):
# Create one project for each platform
windows_repo = self.gl.projects.create({'name': 'torbrowser-windows',
windows_repo = self.gl.projects.create({'name': 'torbrowser-'+version+'-windows',
'visibility': 'public'})
mac_repo = self.gl.projects.create({'name': 'torbrowser-osx',
mac_repo = self.gl.projects.create({'name': 'torbrowser-'+version+'-osx',
'visibility': 'public'})
linux_repo = self.gl.projects.create({'name': 'torbrowser-linux',
linux_repo = self.gl.projects.create({'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("https://aus1.torproject.org/torbrowser/update_3/release/downloads.json")
data = json.loads(url.read().decode())
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("https://aus1.torproject.org/torbrowser/update_3/release/downloads.json")
data = json.loads(url.read().decode())
version = data["version"]
remotes = []
if 'GITHUB_AUTH' not in os.environ:
print("WARNING: No Github authentication token given", file=sys.stderr)
......
Markdown is supported
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