@@ -253,6 +253,11 @@ def get_commit(commit_api):
253253 % (naive_url_encode (repo ), naive_url_encode (branch )))
254254 headers = None
255255 lambda_query = gitlab_lambda_query_sha1
256+ elif fetcher == 'gitlab.inria.fr' :
257+ url = ('https://%s/api/v4/projects/%s/repository/branches/%s'
258+ % (fetcher , naive_url_encode (repo ), naive_url_encode (branch )))
259+ headers = None
260+ lambda_query = gitlab_lambda_query_sha1
256261 else :
257262 error ("Error: do not support 'fetcher: %s'" % fetcher )
258263 return get_url (url , headers , None , lambda_query )
@@ -363,18 +368,18 @@ def get_list_dict_dockerfile_matrix_tags_args(json, debug):
363368 args1 = json ['args' ] if 'args' in json else {}
364369 gvars = json ['vars' ] if 'vars' in json else {}
365370 # = global vars, interpolated in:
371+ # - dockerfile
366372 # - args
367373 # - build.args
368374 # - build.tags
369375 # - build.after_deploy_export
370376 for item in images :
371377 list_matrix = product_build_matrix (item ['matrix' ])
372378 if 'dockerfile' in item ['build' ]:
373- dfile = check_trim_relative_path (item ['build' ]['dockerfile' ])
379+ dfile_templ = check_trim_relative_path (item ['build' ]['dockerfile' ])
374380 else :
375- dfile = 'Dockerfile'
376- context = check_trim_relative_path (item ['build' ]['context' ])
377- path = '%s/%s' % (context , dfile )
381+ dfile_templ = 'Dockerfile'
382+ context_templ = check_trim_relative_path (item ['build' ]['context' ])
378383 raw_tags = item ['build' ]['tags' ]
379384 args2 = item ['build' ]['args' ] if 'args' in item ['build' ] else {}
380385 raw_args = merge_dict (args1 , args2 )
@@ -454,6 +459,9 @@ def get_list_dict_dockerfile_matrix_tags_args(json, debug):
454459 if eval_if (script_cond , matrix , gvars ):
455460 # otherwise skip the script item
456461 after_deploy_script .append (script_item )
462+ dfile = eval_bashlike (dfile_templ , matrix , gvars ) # NOT defaults
463+ context = eval_bashlike (context_templ , matrix , gvars ) # idem
464+ path = '%s/%s' % (context , dfile )
457465 newitem = {"context" : context , "dockerfile" : dfile ,
458466 "path" : path ,
459467 "matrix" : matrix , "tags" : tags , "args" : args ,
@@ -1524,12 +1532,14 @@ def main(argv):
15241532# $ py.test bash_formatter.py
15251533
15261534def test_get_commit ():
1527- github = {"fetcher" : "github" , "repo" : "coq/coq" , "branch" : "v8.0" }
1528- github_expected = "f7777da84893a182f566667426d13dd43f2ee45a"
1535+ github = {"fetcher" : "github" , "repo" : "rocq-prover/rocq" ,
1536+ "branch" : "v8.1" }
1537+ github_expected = "f7cdf553d983a79fe0fbb08403f6a55230016074"
15291538 github_actual = get_commit (github )
15301539 assert github_actual == github_expected
1531- gitlab = {"fetcher" : "gitlab" , "repo" : "coq/coq" , "branch" : "v8.0" }
1532- gitlab_expected = "f7777da84893a182f566667426d13dd43f2ee45a"
1540+ gitlab = {"fetcher" : "gitlab.inria.fr" , "repo" : "coq/coq" ,
1541+ "branch" : "v8.1" }
1542+ gitlab_expected = "f7cdf553d983a79fe0fbb08403f6a55230016074"
15331543 gitlab_actual = get_commit (gitlab )
15341544 assert gitlab_actual == gitlab_expected
15351545
0 commit comments