Skip to content

Commit

Permalink
internal/versioning (#491)
Browse files Browse the repository at this point in the history
* add version to docker

* Allow shell because it is using double quotes in the command string.

* removed cat and ls commands

---------

Co-authored-by: MajoBerger <[email protected]>
  • Loading branch information
milanmajchrak and MajoBerger authored Jan 5, 2024
1 parent bf4f503 commit b5cdf03
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Add version
run: python scripts/sourceversion.py > dspace/config/VERSION_D.txt

# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
14 changes: 14 additions & 0 deletions scripts/sourceversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import subprocess
from datetime import datetime

if __name__ == '__main__':
ts = datetime.now()
print(f"timestamp: {ts}")

cmd = 'git log -1 --pretty=format:"%h - %ai"'
print(f">{cmd}")
subprocess.check_call(cmd, shell=True)

cmd = 'git status --porcelain'
print(f">{cmd}:")
subprocess.check_call(cmd, shell=True)

0 comments on commit b5cdf03

Please sign in to comment.