Skip to content

Commit d29ae68

Browse files
authored
Merge pull request #2 from dataquest-dev/dtq-dev
Upgrade DSpace to CLARIN-DSpace
2 parents d8ed267 + 1c91c75 commit d29ae68

File tree

1,565 files changed

+57588
-6612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,565 files changed

+57588
-6612
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
*.css eol=lf
1414
*.scss eol=lf
1515
*.html eol=lf
16-
*.svg eol=lf
16+
*.svg eol=lf

.github/ISSUE_TEMPLATE/bug_report.md

-22
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

-20
This file was deleted.

.github/actions/erase-db/action.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Erase dspace db'
2+
description: 'CI/CD Erase db'
3+
4+
inputs:
5+
INSTANCE:
6+
description: 'port suffix'
7+
required: true
8+
type: string
9+
NAME:
10+
description: 'docker compose project name'
11+
required: true
12+
type: string
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
18+
- name: stop and remove containers
19+
shell: bash
20+
env:
21+
INSTANCE: ${{ inputs.INSTANCE }}
22+
run: |
23+
docker stop dspacesolr$INSTANCE dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE || true
24+
docker rm dspacesolr$INSTANCE dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE || true
25+
26+
- name: remove volumes
27+
shell: bash
28+
env:
29+
NAME: ${{ inputs.NAME }}
30+
run: |
31+
# # condition below was found by accident and appears to be useless. Investigate later.
32+
# be sure to have INSTANCE set
33+
# if [[ "x${NAME}" != "dspace-" ]]; then
34+
docker volume rm $(docker volume ls --filter name="${NAME}_" -q) || true
35+
# fi;
36+

.github/actions/import-db/action.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: 'Import dspace db'
2+
description: 'CI/CD import db'
3+
4+
inputs:
5+
DATADIR:
6+
description: 'data dir with dump, icons'
7+
required: true
8+
type: string
9+
INSTANCE:
10+
description: 'port suffix'
11+
required: true
12+
type: string
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
18+
- name: info
19+
shell: bash
20+
run: |
21+
docker ps -a
22+
23+
- uses: actions/checkout@v4
24+
with:
25+
repository: dataquest-dev/dspace-import
26+
ref: 'main'
27+
submodules: 'recursive'
28+
path: 'dspace-import'
29+
30+
31+
- name: stop and remove containers
32+
id: import
33+
shell: bash
34+
working-directory: dspace-import/scripts
35+
env:
36+
DATADIR: ${{ inputs.DATADIR }}
37+
DB5PORT: 15432
38+
DB5NAME: dspace-import-db5
39+
DB7PORT: 543${{ inputs.INSTANCE }}
40+
BEURL: http://dev-5.pc:8${{ inputs.INSTANCE }}/server/api
41+
run: |
42+
docker stop $DB5NAME || true
43+
echo "====="
44+
echo Starting import DB
45+
# create otherwise it will be created with root owner
46+
cid=$(docker run -d --rm --name $DB5NAME -v $(pwd):/dq/scripts -v $DATADIR/dump:/dq/dump -p 127.0.0.1:$DB5PORT:5432 -e POSTGRES_DB=empty -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=dspace postgres /bin/bash -c "cd /dq/scripts && ./init.dspacedb5.sh")
47+
echo "cid=$cid" >> $GITHUB_OUTPUT
48+
sleep 60
49+
echo "====="
50+
docker logs $DB5NAME || true
51+
echo "====="
52+
cd ../
53+
pip install -r requirements.txt || true
54+
echo "====="
55+
cd ./src
56+
# cleanup resume
57+
rm __temp/resume/*.json || true
58+
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/
59+
60+
- name: cleanup
61+
shell: bash
62+
run: |
63+
docker stop ${{ steps.import.outputs.cid }} || true
64+
if: ${{ always() }}
65+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Container image that runs your code
2+
FROM alpine:3.10
3+
4+
RUN apk add --no-cache --no-progress curl jq
5+
6+
# Copies your code file from your action repository to the filesystem path `/` of the container
7+
COPY entrypoint.sh /entrypoint.sh
8+
RUN chmod 777 /entrypoint.sh
9+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
10+
ENTRYPOINT ["/entrypoint.sh"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Sergio Pintaldi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# GitHub Action for Assign to One Project
2+
3+
[![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/srggrs/assign-one-project-github-action)][docker]
4+
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/srggrs/assign-one-project-github-action)][docker]
5+
[![Docker Pulls](https://img.shields.io/docker/pulls/srggrs/assign-one-project-github-action)][docker]
6+
[![GitHub license](https://img.shields.io/github/license/srggrs/assign-one-project-github-action.svg)][license]
7+
![Latest Version](https://img.shields.io/github/v/release/srggrs/assign-one-project-github-action?color=orange&label=latest%20release)
8+
9+
[docker]: https://hub.docker.com/r/srggrs/assign-one-project-github-action
10+
[license]: https://github.com/srggrs/assign-one-project-github-action/blob/master/LICENSE
11+
12+
Automatically add an issue or pull request to specific [GitHub Project](https://help.github.com/articles/about-project-boards/) when you __create__ and/or __label__ them. By default, the issues are assigned to the __`To do`__ column and the pull requests to the __`In progress`__ one, so make sure you have those columns in your project dashboard. But the workflow __allowed you to specify the column name as input__, so you can assign the issues/PRs based on a set of conditions to a specific column of a specific project.
13+
14+
## Latest features:
15+
16+
* included `issue_comment` as trigger for this action.
17+
* added project pagination for searching 100+ GitHub projects.
18+
19+
## Acknowledgment & Motivations
20+
21+
This action has been modified from the original action from [masutaka](https://github.com/masutaka/github-actions-all-in-one-project). I needed to fix it as the original docker container would not build. Also I think the GitHub Action syntax changed a bit.
22+
23+
I would like to thank @SunRunAway for adding the labelling functionality and custom column input.
24+
25+
## Inputs
26+
27+
### `project`
28+
29+
**Required** The url of the project to be assigned to.
30+
31+
### `column_name`
32+
33+
The column name of the project, defaults to `'To do'` for issues and `'In progress'` for pull requests.
34+
35+
## Example usage
36+
37+
Examples of action:
38+
39+
### Repository project
40+
41+
```yaml
42+
name: Auto Assign to Project(s)
43+
44+
on:
45+
issues:
46+
types: [opened, labeled]
47+
pull_request:
48+
types: [opened, labeled]
49+
issue_comment:
50+
types: [created]
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
54+
jobs:
55+
assign_one_project:
56+
runs-on: ubuntu-latest
57+
name: Assign to One Project
58+
steps:
59+
- name: Assign NEW issues and NEW pull requests to project 2
60+
uses: srggrs/[email protected]
61+
if: github.event.action == 'opened'
62+
with:
63+
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2'
64+
65+
- name: Assign issues and pull requests with `bug` label to project 3
66+
uses: srggrs/[email protected]
67+
if: |
68+
contains(github.event.issue.labels.*.name, 'bug') ||
69+
contains(github.event.pull_request.labels.*.name, 'bug')
70+
with:
71+
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/3'
72+
column_name: 'Labeled'
73+
```
74+
75+
#### __Notes__
76+
Be careful of using the conditions above (opened and labeled issues/PRs) because in such workflow, if the issue/PR is opened and labeled at the same time, it will be assigned to __both__ projects!
77+
78+
79+
You can use any combination of conditions. For example, to assign new issues or issues labeled with 'mylabel' to a project column, use:
80+
```yaml
81+
...
82+
83+
if: |
84+
github.event_name == 'issues' &&
85+
(
86+
github.event.action == 'opened' ||
87+
contains(github.event.issue.labels.*.name, 'mylabel')
88+
)
89+
...
90+
```
91+
92+
### Organisation or User project
93+
94+
Generate a token from the Organisation settings or User Settings and add it as a secret in the repository secrets as `MY_GITHUB_TOKEN`
95+
96+
```yaml
97+
name: Auto Assign to Project(s)
98+
99+
on:
100+
issues:
101+
types: [opened, labeled]
102+
pull_request_target:
103+
types: [opened, labeled]
104+
issue_comment:
105+
types: [created]
106+
env:
107+
MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
108+
109+
jobs:
110+
assign_one_project:
111+
runs-on: ubuntu-latest
112+
name: Assign to One Project
113+
steps:
114+
- name: Assign NEW issues and NEW pull requests to project 2
115+
uses: srggrs/[email protected]
116+
if: github.event.action == 'opened'
117+
with:
118+
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2'
119+
120+
- name: Assign issues and pull requests with `bug` label to project 3
121+
uses: srggrs/[email protected]
122+
if: |
123+
contains(github.event.issue.labels.*.name, 'bug') ||
124+
contains(github.event.pull_request.labels.*.name, 'bug')
125+
with:
126+
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/3'
127+
column_name: 'Labeled'
128+
```
129+
130+
## [Change Log](./CHANGELOG.md)
131+
132+
Please refer to the list of changes [here](./CHANGELOG.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# action.yml
2+
name: 'Assign to One Project'
3+
description: 'Assign new/labeled Issue or Pull Request to a specific project dashboard column'
4+
author: srggrs
5+
inputs:
6+
project:
7+
description: 'The url of the project to be assigned to.'
8+
required: true
9+
column_name:
10+
description: 'The column name of the project, defaults to "To do" for issues and "In progress" for pull requests.'
11+
required: false
12+
13+
runs:
14+
using: 'docker'
15+
image: 'Dockerfile'
16+
args:
17+
- ${{ inputs.project }}
18+
- ${{ inputs.column_name }}
19+
20+
branding:
21+
icon: 'box'
22+
color: 'red'

0 commit comments

Comments
 (0)