Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use spack commit from config for generating spack view #199

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions stackinator/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,19 @@ def generate(self, recipe):
self._logger.debug(f'unable to change to the requested commit {spack["commit"]}')
capture.check_returncode()

# the default branch is develop: find the exact commit
if not spack["commit"] or spack["commit"] == "develop":
git_commit_result = subprocess.run(
["git", "-C", spack_path, "rev-parse", "HEAD"],
shell=False,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
spack["commit"] = git_commit_result.stdout.strip()

# get the spack commit
git_commit_result = subprocess.run(
["git", "-C", spack_path, "rev-parse", "HEAD"], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
spack_meta = {"commit": git_commit_result.stdout.strip(), "url": spack["repo"]}
spack_meta = {"commit": spack["commit"], "url": spack["repo"]}
print(f"==== {spack_meta}")

# load the jinja templating environment
template_path = self.root / "templates"
Expand Down
Loading