Skip to content

Commit

Permalink
Merge pull request #367 from DUNE-DAQ/amogan/issue366_check_release_tags
Browse files Browse the repository at this point in the history
AJM: Check release tags exist when generating repos
  • Loading branch information
jcfreeman2 authored Apr 30, 2024
2 parents c0cf55d + 3fd1a76 commit 7c0eb65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/checkout-daq-package.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def checkout_tag(repo, commit, outdir):
cmd = f"""\nmkdir -p {outdir}; cd {outdir}; \
git clone https://github.com/DUNE-DAQ/{repo}.git; \
cd {repo}; \
if ! git show-ref --tags --verify --quiet "refs/tags/{commit}"; then \
echo "{commit} does not exist for package {repo}. Exiting..."; \
exit 1; \
fi; \
git checkout {commit}; \
cmake_version=`grep "^project" CMakeLists.txt |grep ")$"|grep -oP "(([[:digit:]]+\.)([[:digit:]]+\.)([[:digit:]]+))"`; \
tag=v"$cmake_version"; \
Expand Down
7 changes: 7 additions & 0 deletions scripts/spack/make-release-repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def get_commit_hash(repo, tag_or_branch, fall_back_tag="develop"):
fi"""
output = check_output(cmd)
tag_or_branch = output[0].decode('utf-8').strip()
else: # Check if tag exists
cmd = f"""cd {tmp_dir}/{repo}; \
if ! git show-ref --tags --verify --quiet "refs/tags/{tag_or_branch}"; then \
echo "{tag_or_branch} does not exist for package {repo}. Exiting..."; \
exit 1; \
fi;"""
output = check_output(cmd)
cmd = f"""cd {tmp_dir}/{repo}; \
git checkout --quiet {tag_or_branch}; \
git rev-parse --short HEAD"""
Expand Down

0 comments on commit 7c0eb65

Please sign in to comment.