Skip to content

Commit

Permalink
Merge pull request #233 from hermes-hmc/feature/153-refactoring-of-da…
Browse files Browse the repository at this point in the history
…ta-model

First step towards the new data model
  • Loading branch information
led02 authored Nov 15, 2023
2 parents 213b8b2 + 915c3d5 commit d7d739d
Show file tree
Hide file tree
Showing 11 changed files with 921 additions and 368 deletions.
21 changes: 17 additions & 4 deletions docs/source/tutorials/automated-publication-with-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPDX-License-Identifier: CC-BY-SA-4.0
SPDX-FileContributor: Oliver Bertuch
SPDX-FileContributor: Michael Meinel
SPDX-FileContributor: Stephan Druskat
SPDX-FileContributor: Sophie Kernchen
-->

# Set up automatic software publishing
Expand Down Expand Up @@ -72,14 +73,14 @@ Configure HERMES to:
from = [ "git", "cff" ]
[deposit]
target = "invenio"
target = "invenio_rdm"
[deposit.invenio]
[deposit.invenio_rdm]
site_url = "https://sandbox.zenodo.org"
access_right = "open"
[postprocess]
execute = [ "config_record_id" ]
execute = [ "config_invenio_rdm_record_id" ]
```

Copy this file to the root directory of your repository and add it to version control:
Expand All @@ -92,7 +93,7 @@ git push

```{note}
If you decide to start from an existing `hermes.toml` (e.g., the one found in this repository),
be sure that there is no `record_id` value defined in the `deposit.invenio` section.
be sure that there is no `record_id` value defined in the `deposit.invenio_rdm` section.
Otherwise, your deposition will fail as *hermes* would try to deposit a new version for the given record.
```

Expand Down Expand Up @@ -167,6 +168,18 @@ and activate the option "Allow GitHub Actions to create and approve pull request
Copy the Zenodo sandbox token you just created into a new [GitLab CI variable](https://docs.gitlab.com/ee/ci/variables/#for-a-project)
called `ZENODO_TOKEN`.

For Gitlab you also need the HERMES Push Token. That Token gives access to the project in order for HERMES to create Merge Requests.
Therefore, you [create an access token in your project](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#create-a-project-access-token).
The Token needs to have at least the `developer` role and `write` access (e.g. write_repository scope).
Then you create a Gitlab CI variable with the token called `HERMES_PUSH_TOKEN`.

```{note}
The two Gitlab CI Variables include sensitive and powerful information.
Therefore you should at least select the flag `Mask variable` when creating.
If possible you should also select the flag `Protect variable` and define all branches `hermes/*` as
protected branch.
```

Copy the [template file for GitLab to Zenodo Sandbox publication](https://github.com/hermes-hmc/ci-templates/blob/main/gitlab/hermes-ci.yml)
into your project to `.gitlab/hermes-ci.yml`.

Expand Down
8 changes: 4 additions & 4 deletions hermes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ from = [ "cff", "git" ]
validate = false

[deposit]
target = "invenio"
target = "invenio_rdm"

[deposit.invenio]
[deposit.invenio_rdm]
site_url = "https://sandbox.zenodo.org"
communities = ["zenodo"]
access_right = "open"

[deposit.invenio.api_paths]
[deposit.invenio_rdm.api_paths]
depositions = "api/deposit/depositions"
licenses = "api/licenses"
licenses = "api/vocabularies/licenses"
communities = "api/communities"
44 changes: 43 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,51 @@ git_add_branch = "hermes.commands.process.git:add_branch"
[tool.poetry.plugins."hermes.deposit"]
file = "hermes.commands.deposit.file:FileDepositPlugin"
invenio = "hermes.commands.deposit.invenio:InvenioDepositPlugin"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:InvenioDepositPlugin"

[tool.poetry.plugins."hermes.deposit.prepare"]
invenio = "hermes.commands.deposit.invenio:prepare"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:prepare"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.map"]
invenio = "hermes.commands.deposit.invenio:map_metadata"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:map_metadata"
file = "hermes.commands.deposit.file:map_metadata"

[tool.poetry.plugins."hermes.deposit.create_initial_version"]
invenio = "hermes.commands.deposit.invenio:create_initial_version"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:create_initial_version"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.create_new_version"]
invenio = "hermes.commands.deposit.invenio:create_new_version"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:create_new_version"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.update_metadata"]
invenio = "hermes.commands.deposit.invenio:update_metadata"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:update_metadata"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.delete_artifacts"]
invenio = "hermes.commands.deposit.invenio:delete_artifacts"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:delete_artifacts"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.upload_artifacts"]
invenio = "hermes.commands.deposit.invenio:upload_artifacts"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:upload_artifacts"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.publish"]
invenio = "hermes.commands.deposit.invenio:publish"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:publish"
file = "hermes.commands.deposit.file:publish"

[tool.poetry.plugins."hermes.postprocess"]
config_record_id = "hermes.commands.postprocess.invenio:config_record_id"
config_invenio_record_id = "hermes.commands.postprocess.invenio:config_record_id"
config_invenio_rdm_record_id = "hermes.commands.postprocess.invenio_rdm:config_record_id"
cff_doi = "hermes.commands.postprocess.invenio:cff_doi"

[tool.taskipy.tasks]
Expand Down
Loading

0 comments on commit d7d739d

Please sign in to comment.