Skip to content

Commit

Permalink
package
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriWahl committed Jul 21, 2024
1 parent 3498260 commit 7cddcbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions build/build-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ cp -R $SOURCE/web .
# has to be done by site user
su - cmk -c "/omd/sites/cmk/bin/mkp template yum"

ls -l $SOURCE
git config --global --add safe.directory $SOURCE

# modify extension config file with correct version number, author etc.
#/build-modify-extension.py $SOURCE $CMK/var/check_mk/packages/yum
/build-modify-extension.py $SOURCE $CMK/tmp/check_mk/yum.manifest.temp
Expand Down
9 changes: 4 additions & 5 deletions build/build-modify-extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
# get version information from git repo
repo = Repo(path=git_repo_path, search_parent_directories=True)

print(repo.tags)
print(repo.head)
print(repo.head.commit)

# if no tag is latest take repo head
version_repo = next((tag for tag in repo.tags if tag.commit == repo.head.commit), repo.head.commit)
if type(version_repo) == Commit:
# first 8 characters of commit
version = version_repo.hexsha[0:8]
# first 8 characters of commit added to '0.0.' to get a SemVer version number
version = f'0.0.{version_repo.hexsha[0:8]}'
elif type(version_repo) == TagReference:
# Tagl
# Tag
version = version_repo.name
if version.startswith('v'):
version = version.split('v')[1]
Expand Down

0 comments on commit 7cddcbc

Please sign in to comment.