Skip to content

Commit

Permalink
Add support for using a HTTPS catalog URL for arbitrary catalogs
Browse files Browse the repository at this point in the history
  • Loading branch information
simu committed Dec 17, 2024
1 parent 85a1630 commit 7e045d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion gitlab/commodore-compile.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,18 @@ local gitInsteadOf(cluster) =
// prefix ssh://git@<host> 0 == ssh, 1 == '', 2 == <host>
std.join('/', std.split(cluster_repo, '/')[3:]);

local https_catalog = if std.startsWith(cluster_repo, 'https://') then
std.substr(cluster_repo, std.length('https://'), std.length(cluster_repo));

local catalogInsteadOf =
if catalog_path != null then
if https_catalog != null then
[
'git config --global url."https://%(catalog_user)s:%(access_token)s@%(https_catalog)s".insteadOf https://%(https_catalog)s' % {
access_token: cluster_access_token,
https_catalog: https_catalog,
},
]
else if catalog_path != null then
[
'git config --global url."https://gitlab-ci-token:%(access_token)s@%(gitlab_fqdn)s/%(catalog_path)s".insteadOf ssh://git@${CI_SERVER_SHELL_SSH_HOST}/%(catalog_path)s' % {
access_token: cluster_access_token,
Expand Down

0 comments on commit 7e045d9

Please sign in to comment.