Skip to content
Snippets Groups Projects
Commit c1f00bfb authored by Lars Bilke's avatar Lars Bilke
Browse files

Use release tag in name.

parent 242e0c88
No related branches found
No related tags found
No related merge requests found
......@@ -83,9 +83,6 @@ def main(): # pragma: no cover
print('--convert cannot be used with --format singularity! '
'Ignoring!')
commit_hash = '0'
ogs_tag = ''
info = container_info(build, args)
info.make_dirs()
......@@ -382,7 +379,7 @@ def main(): # pragma: no cover
# TODO: adapt this to else
continue
build_cmd = (f"docker build --build-arg OGS_COMMIT_HASH={commit_hash} "
build_cmd = (f"docker build "
f"-t {info.tag} -f {definition_file_path} .")
if info.buildkit:
build_cmd = "(cd {0} && DOCKER_BUILDKIT=1 {1})".format(
......@@ -398,7 +395,6 @@ def main(): # pragma: no cover
subprocess.run(f"docker push {info.tag}", shell=True)
image_file = f'{info.images_out_dir}/{info.img_file}-{image_id_short}.sif'
if args.convert and not os.path.exists(image_file):
# (check docker image id)
subprocess.run(
f"cd {cwd} && singularity build --force {image_file} docker-daemon:{info.tag}",
shell=True)
......
......@@ -7,13 +7,14 @@ from __future__ import unicode_literals
from __future__ import print_function
import hashlib
import json
import os
import re
import requests
import shutil
import subprocess
from ogscm import config
import json
class container_info():
......@@ -35,6 +36,7 @@ class container_info():
cmake_args = args_iter[4].strip().split(' ')
name_start = 'gcc'
branch_is_release = False
if ogs_version != 'off':
if os.path.isdir(ogs_version):
self.repo = 'local'
......@@ -63,6 +65,8 @@ class container_info():
if self.branch == '':
self.branch = 'master'
else:
if re.search(r'[\d.]+', self.branch):
branch_is_release = True
url = (
f"https://api.github.com/repos/{self.repo}/commits?sha={self.branch}"
)
......@@ -71,7 +75,10 @@ class container_info():
self.commit_hash = response_data[0]['sha']
# ogs_tag = ogs_version.replace('/', '.').replace('@', '.')
name_start = f'ogs-{self.commit_hash[:8]}'
if branch_is_release:
name_start = f'ogs-{self.branch}'
else:
name_start = f'ogs-{self.commit_hash[:8]}'
else:
if args.compiler == 'clang':
name_start = 'clang'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment