From 905a8d9bc5a2204d026f992532d834dbca1242f1 Mon Sep 17 00:00:00 2001 From: MajoBerger <88670521+MajoBerger@users.noreply.github.com> Date: Fri, 1 Mar 2024 08:51:47 +0100 Subject: [PATCH] Improve version info, add release-tag action add run link to version info correct image for tests (remove dspace-dependencies from migrate to 7.5) add action to release on tagging --- .github/workflows/tag-release.yml | 15 +++++++-------- Dockerfile.cli | 2 +- Dockerfile.test | 2 +- scripts/sourceversion.py | 11 +++++------ 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 2f0da587b171..22ad62073959 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -2,11 +2,12 @@ name: Release on: push: - # Pattern matched against refs/tags tags: - '**' - +env: + IMAGE_BASE_NAME: dataquest/dspace + jobs: retag-BE-image: steps: @@ -15,14 +16,12 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - + - name: retag image run: | - echo attempting go pull dataquest/dspace:${{ github.sha }} - echo then will use ${{ github.ref_name }} as a tag - docker pull dataquest/dspace:${{ github.sha }} - docker tag dataquest/dspace:${{ github.sha }} dataquest/dspace:${{ github.ref_name }} + docker pull ${{ env.IMAGE_BASE_NAME }}:${{ github.sha }} + docker tag ${{ env.IMAGE_BASE_NAME }}:${{ github.sha }} ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }} - name: push image - run: docker push dataquest/dspace:${{ github.ref_name }} + run: docker push ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }} diff --git a/Dockerfile.cli b/Dockerfile.cli index 09c61ea3ccca..e0e45c547bb0 100644 --- a/Dockerfile.cli +++ b/Dockerfile.cli @@ -8,7 +8,7 @@ ARG JDK_VERSION=11 # Step 1 - Run Maven Build -FROM dataquest/dspace-dependencies:migrate-to-7.5 as build +FROM dataquest/dspace-dependencies:dspace-7_x as build ARG TARGET_DIR=dspace-installer WORKDIR /app # The dspace-installer directory will be written to /install diff --git a/Dockerfile.test b/Dockerfile.test index f909167953ec..4106ca925918 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -10,7 +10,7 @@ ARG JDK_VERSION=11 # Step 1 - Run Maven Build -FROM dataquest/dspace-dependencies:migrate-to-7.5 as build +FROM dataquest/dspace-dependencies:dspace-7_x as build ARG TARGET_DIR=dspace-installer WORKDIR /app # The dspace-installer directory will be written to /install diff --git a/scripts/sourceversion.py b/scripts/sourceversion.py index 6ac250342734..145f8d8ac8e8 100644 --- a/scripts/sourceversion.py +++ b/scripts/sourceversion.py @@ -1,14 +1,13 @@ import subprocess +import sys from datetime import datetime if __name__ == '__main__': ts = datetime.now() - print(f"timestamp: {ts}") + print(f"This info was generated on: {ts}") - cmd = 'git log -1 --pretty=format:"%h - %ai"' - print(f">{cmd}") + cmd = 'git log -1 --pretty=format:"Git hash: %H Date of commit: %ai"' subprocess.check_call(cmd, shell=True) - cmd = 'git status --porcelain' - print(f">{cmd}:") - subprocess.check_call(cmd, shell=True) + link = sys.argv[1] + sys.argv[2] + print(' Build run: ' + link + ' ')