diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dd8f1dc7ed1..9e568177e14 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 diff --git a/scripts/sourceversion.py b/scripts/sourceversion.py new file mode 100644 index 00000000000..6ac25034273 --- /dev/null +++ b/scripts/sourceversion.py @@ -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)