Skip to content

Commit

Permalink
update actions from main branch (dtq-dev)
Browse files Browse the repository at this point in the history
  • Loading branch information
MajoBerger authored Mar 1, 2024
1 parent 378e393 commit a2d6664
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
build_id: dspace-dependencies
image_name: dataquest/dspace-dependencies
dockerfile_path: ./Dockerfile.dependencies


#######################################
# Build/Push the 'dataquest/dspace' image
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ env:
# For a new tag, copy that tag name as the tag for Docker image.
IMAGE_TAGS: |
type=raw,value=dspace-7_x,enable=${{ github.ref_name == github.event.repository.default_branch }}
type=raw,value=${{ github.sha }}
type=ref,event=branch,enable=${{ github.ref_name != github.event.repository.default_branch }}
type=ref,event=tag
# Define default tag "flavor" for docker/metadata-action per
Expand Down Expand Up @@ -108,7 +109,7 @@ jobs:

- name: Add version
if: ${{ inputs.run_python_version_script }}
run: python scripts/sourceversion.py > ${{ inputs.python_version_script_dest }}
run: python scripts/sourceversion.py ${{ github.server_url }}/${{ github.repository }}/actions/runs/ ${{ github.run_id }} > ${{ inputs.python_version_script_dest }}

# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
tags:
- '**'

env:
IMAGE_BASE_NAME: dataquest/dspace

jobs:
retag-BE-image:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: retag image
run: |
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 ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}

2 changes: 1 addition & 1 deletion Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions scripts/sourceversion.py
Original file line number Diff line number Diff line change
@@ -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 + ' ')

0 comments on commit a2d6664

Please sign in to comment.