about summary refs log tree commit diff
path: root/pkgs/applications/version-management/gitlab
diff options
context:
space:
mode:
authorMilan Pässler <milan@petabyte.dev>2020-12-26 22:35:33 +0100
committerMilan <me@pbb.lc>2020-12-27 00:39:20 +0100
commit44108c5d7ca2aa12c8dd1fbee405f14693f5bd98 (patch)
tree75133f82b4989c022dff017be54ccb59aa49a3bc /pkgs/applications/version-management/gitlab
parent3157904d4a9f1e83cea261542fc046b02152d712 (diff)
gitlab: take care of vendorSha256 in updater script
Diffstat (limited to 'pkgs/applications/version-management/gitlab')
-rwxr-xr-xpkgs/applications/version-management/gitlab/update.py44
1 files changed, 7 insertions, 37 deletions
diff --git a/pkgs/applications/version-management/gitlab/update.py b/pkgs/applications/version-management/gitlab/update.py
index 0f215370e184d..f662bd3097f95 100755
--- a/pkgs/applications/version-management/gitlab/update.py
+++ b/pkgs/applications/version-management/gitlab/update.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env nix-shell
-#! nix-shell -i python3 -p bundix bundler common-updater-scripts nix nix-universal-prefetch python3 python3Packages.requests python3Packages.click python3Packages.click-log vgo2nix yarn2nix
+#! nix-shell -i python3 -p bundix bundler nix-update nix nix-universal-prefetch python3 python3Packages.requests python3Packages.click python3Packages.click-log yarn2nix
 
 import click
 import click_log
@@ -83,10 +83,10 @@ def _get_data_json():
         return json.load(f)
 
 
-def _call_update_source_version(pkg, version):
-    """calls update-source-version from nixpkgs root dir"""
+def _call_nix_update(pkg, version):
+    """calls nix-update from nixpkgs root dir"""
     nixpkgs_path = pathlib.Path(__file__).parent / '../../../../'
-    return subprocess.check_output(['update-source-version', pkg, version], cwd=nixpkgs_path)
+    return subprocess.check_output(['nix-update', pkg, '--version', version], cwd=nixpkgs_path)
 
 
 @click_log.simple_verbosity_option(logger)
@@ -168,20 +168,10 @@ def update_gitaly():
         with open(gitaly_dir / fn, 'w') as f:
             f.write(repo.get_file(f"ruby/{fn}", f"v{gitaly_server_version}"))
 
-    for fn in ['go.mod', 'go.sum']:
-        with open(gitaly_dir / fn, 'w') as f:
-            f.write(repo.get_file(fn, f"v{gitaly_server_version}"))
-
     subprocess.check_output(['bundle', 'lock'], cwd=gitaly_dir)
     subprocess.check_output(['bundix'], cwd=gitaly_dir)
 
-    os.environ['GOROOT'] = ""
-    subprocess.check_output(['vgo2nix', '--keep-going'], cwd=gitaly_dir)
-
-    for fn in ['go.mod', 'go.sum']:
-        os.unlink(gitaly_dir / fn)
-
-    _call_update_source_version('gitaly', gitaly_server_version)
+    _call_nix_update('gitaly', gitaly_server_version)
 
 
 @cli.command('update-gitlab-shell')
@@ -189,42 +179,22 @@ def update_gitlab_shell():
     """Update gitlab-shell"""
     data = _get_data_json()
     gitlab_shell_version = data['passthru']['GITLAB_SHELL_VERSION']
-    _call_update_source_version('gitlab-shell', gitlab_shell_version)
+    _call_nix_update('gitlab-shell', gitlab_shell_version)
 
     repo = GitLabRepo(repo='gitlab-shell')
     gitlab_shell_dir = pathlib.Path(__file__).parent / 'gitlab-shell'
 
-    for fn in ['go.mod', 'go.sum']:
-        with open(gitlab_shell_dir / fn, 'w') as f:
-            f.write(repo.get_file(fn, f"v{gitlab_shell_version}"))
-
-    os.environ['GOROOT'] = ""
-    subprocess.check_output(['vgo2nix', '--keep-going'], cwd=gitlab_shell_dir)
-
-    for fn in ['go.mod', 'go.sum']:
-        os.unlink(gitlab_shell_dir / fn)
-
 
 @cli.command('update-gitlab-workhorse')
 def update_gitlab_workhorse():
     """Update gitlab-workhorse"""
     data = _get_data_json()
     gitlab_workhorse_version = data['passthru']['GITLAB_WORKHORSE_VERSION']
-    _call_update_source_version('gitlab-workhorse', gitlab_workhorse_version)
+    _call_nix_update('gitlab-workhorse', gitlab_workhorse_version)
 
     repo = GitLabRepo('gitlab-org', 'gitlab-workhorse')
     gitlab_workhorse_dir = pathlib.Path(__file__).parent / 'gitlab-workhorse'
 
-    for fn in ['go.mod', 'go.sum']:
-        with open(gitlab_workhorse_dir / fn, 'w') as f:
-            f.write(repo.get_file(fn, f"v{gitlab_workhorse_version}"))
-
-    os.environ['GOROOT'] = ""
-    subprocess.check_output(['vgo2nix', '--keep-going'], cwd=gitlab_workhorse_dir)
-
-    for fn in ['go.mod', 'go.sum']:
-        os.unlink(gitlab_workhorse_dir / fn)
-
 @cli.command('update-all')
 @click.option('--rev', default='latest', help='The rev to use (vX.Y.Z-ee), or \'latest\'')
 @click.pass_context