Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal/copy assetstore #641

Merged
merged 13 commits into from
Jun 24, 2024
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 "====="
Paurikova2 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading