Skip to content

Commit

Permalink
Copying the assetstore from dev-5 to a running instance of dspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Paurikova2 authored Jun 24, 2024
2 parents 1c91c75 + 8ea5872 commit ed77a35
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
32 changes: 29 additions & 3 deletions .github/actions/import-db/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
description: 'port suffix'
required: true
type: string
ASSETSTORE:
description: 'location of assetstore folder'
required: false
type: string

runs:
using: "composite"
Expand Down Expand Up @@ -49,17 +53,39 @@ runs:
echo "====="
docker logs $DB5NAME || true
echo "====="
# copy assetstore
echo Preparing assetstore
if [[ -z ${{ inputs.ASSETSTORE }} ]]; then
echo Location of assetstore folder is empty. Not copping assetstore
else
docker cp ${{ inputs.ASSETSTORE }} dspace${{ inputs.INSTANCE }}:/dspace/
fi
echo "====="
cd ../
pip install -r requirements.txt || true
echo "====="
cd ./src
# cleanup resume
rm __temp/resume/*.json || true
python3 repo_import.py --resume=false --config=backend.endpoint=$BEURL --config=db_dspace_7.port=$DB7PORT --config=db_dspace_5.port=$DB5PORT --config=db_utilities_5.port=$DB5PORT --config=input.datadir=$DATADIR/data/ --config=input.icondir=$DATADIR/icon/
# arguments of the script
# required
args=(
--resume=false
--config=backend.endpoint=$BEURL
--config=db_dspace_7.port=$DB7PORT
--config=db_dspace_5.port=$DB5PORT
--config=db_utilities_5.port=$DB5PORT
--config=input.datadir=$DATADIR/data/
--config=input.icondir=$DATADIR/icon/
)
# Add --resume argument if inputs.ASSETSTORE is defined
if [ -n "${{ inputs.ASSETSTORE }}" ]; then
args+=(--assetstore=${{ inputs.ASSETSTORE }})
fi
python3 repo_import.py "${args[@]}"
- name: cleanup
shell: bash
run: |
docker stop ${{ steps.import.outputs.cid }} || true
if: ${{ always() }}

5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
with:
INSTANCE: ${{ env.INSTANCE }}
DATADIR: /opt/dspace-data/clarin-dspace/
ASSETSTORE: /opt/dspace-data/clarin-dspace/assetstore

- name: dspace basic command
run: |
Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:
run: |
# wait until FE stabilizes a bit
sleep 3m
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \
--request POST \
Expand Down Expand Up @@ -211,7 +212,7 @@ jobs:
run: |
# wait until FE stabilizes a bit
sleep 3m
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \
--request POST \
Expand Down

0 comments on commit ed77a35

Please sign in to comment.