git.iko.soy/typeable/nixpkgs
on master help sign in
gitlab: take care of vendorSha256 in updater script
commit44108c5d7ca2aa12c8dd1fbee405f14693f5bd98 authorMilan Pässler <milan@petabyte.dev> dateSat 26 Dec 2020, 22:35 (6 years ago) parent3157904
1 file changed+7−37
pkgs/applications/version-management/gitlab/update.py+7−37
pkgs/applications/version-management/gitlab/update.py+7−37
@@ -1,5 +1,5 @@
11#!/usr/bin/env nix-shell
2−#! nix-shell -i python3 -p bundix bundler common-updater-scripts nix nix-universal-prefetch python3 python3Packages.requests python3Packages.click python3Packages.click-log vgo2nix yarn2nix
2+#! nix-shell -i python3 -p bundix bundler nix-update nix nix-universal-prefetch python3 python3Packages.requests python3Packages.click python3Packages.click-log yarn2nix
33
44import click
55import click_log
@@ -83,10 +83,10 @@ def _get_data_json():
8383 return json.load(f)
8484
8585
86−def _call_update_source_version(pkg, version):
87− """calls update-source-version from nixpkgs root dir"""
86+def _call_nix_update(pkg, version):
87+ """calls nix-update from nixpkgs root dir"""
8888 nixpkgs_path = pathlib.Path(__file__).parent / '../../../../'
89− return subprocess.check_output(['update-source-version', pkg, version], cwd=nixpkgs_path)
89+ return subprocess.check_output(['nix-update', pkg, '--version', version], cwd=nixpkgs_path)
9090
9191
9292@click_log.simple_verbosity_option(logger)
@@ -168,20 +168,10 @@ def update_gitaly():
168168 with open(gitaly_dir / fn, 'w') as f:
169169 f.write(repo.get_file(f"ruby/{fn}", f"v{gitaly_server_version}"))
170170
171− for fn in ['go.mod', 'go.sum']:
172− with open(gitaly_dir / fn, 'w') as f:
173− f.write(repo.get_file(fn, f"v{gitaly_server_version}"))
174−
175171 subprocess.check_output(['bundle', 'lock'], cwd=gitaly_dir)
176172 subprocess.check_output(['bundix'], cwd=gitaly_dir)
177173
178− os.environ['GOROOT'] = ""
179− subprocess.check_output(['vgo2nix', '--keep-going'], cwd=gitaly_dir)
180−
181− for fn in ['go.mod', 'go.sum']:
182− os.unlink(gitaly_dir / fn)
183−
184− _call_update_source_version('gitaly', gitaly_server_version)
174+ _call_nix_update('gitaly', gitaly_server_version)
185175
186176
187177@cli.command('update-gitlab-shell')
@@ -189,42 +179,22 @@ def update_gitlab_shell():
189179 """Update gitlab-shell"""
190180 data = _get_data_json()
191181 gitlab_shell_version = data['passthru']['GITLAB_SHELL_VERSION']
192− _call_update_source_version('gitlab-shell', gitlab_shell_version)
182+ _call_nix_update('gitlab-shell', gitlab_shell_version)
193183
194184 repo = GitLabRepo(repo='gitlab-shell')
195185 gitlab_shell_dir = pathlib.Path(__file__).parent / 'gitlab-shell'
196186
197− for fn in ['go.mod', 'go.sum']:
198− with open(gitlab_shell_dir / fn, 'w') as f:
199− f.write(repo.get_file(fn, f"v{gitlab_shell_version}"))
200−
201− os.environ['GOROOT'] = ""
202− subprocess.check_output(['vgo2nix', '--keep-going'], cwd=gitlab_shell_dir)
203−
204− for fn in ['go.mod', 'go.sum']:
205− os.unlink(gitlab_shell_dir / fn)
206−
207187
208188@cli.command('update-gitlab-workhorse')
209189def update_gitlab_workhorse():
210190 """Update gitlab-workhorse"""
211191 data = _get_data_json()
212192 gitlab_workhorse_version = data['passthru']['GITLAB_WORKHORSE_VERSION']
213− _call_update_source_version('gitlab-workhorse', gitlab_workhorse_version)
193+ _call_nix_update('gitlab-workhorse', gitlab_workhorse_version)
214194
215195 repo = GitLabRepo('gitlab-org', 'gitlab-workhorse')
216196 gitlab_workhorse_dir = pathlib.Path(__file__).parent / 'gitlab-workhorse'
217197
218− for fn in ['go.mod', 'go.sum']:
219− with open(gitlab_workhorse_dir / fn, 'w') as f:
220− f.write(repo.get_file(fn, f"v{gitlab_workhorse_version}"))
221−
222− os.environ['GOROOT'] = ""
223− subprocess.check_output(['vgo2nix', '--keep-going'], cwd=gitlab_workhorse_dir)
224−
225− for fn in ['go.mod', 'go.sum']:
226− os.unlink(gitlab_workhorse_dir / fn)
227−
228198@cli.command('update-all')
229199@click.option('--rev', default='latest', help='The rev to use (vX.Y.Z-ee), or \'latest\'')
230200@click.pass_context