-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1131 from research-software-directory/codemeta-se…
…rver Codemeta server
- Loading branch information
Showing
12 changed files
with
470 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: codemeta code quality scan and build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "codemeta/**" | ||
pull_request: | ||
paths: | ||
- "codemeta/**" | ||
|
||
jobs: | ||
codemeta-scan-build: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
go-version: [ '1.22.0' ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: "Build application with Go" | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.0' | ||
- run: | | ||
go build -v | ||
working-directory: codemeta | ||
- name: SonarCloud Scan codemeta | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
projectBaseDir: codemeta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# SPDX-FileCopyrightText: 2022 - 2023 Dusan Mijatovic (dv4all) | ||
# SPDX-FileCopyrightText: 2022 - 2023 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
# SPDX-FileCopyrightText: 2022 - 2023 Netherlands eScience Center | ||
# SPDX-FileCopyrightText: 2022 - 2023 dv4all | ||
# SPDX-FileCopyrightText: 2022 - 2024 Christian Meeßen (GFZ) <[email protected]> | ||
# SPDX-FileCopyrightText: 2022 - 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
# SPDX-FileCopyrightText: 2022 - 2024 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences | ||
# SPDX-FileCopyrightText: 2022 - 2024 Netherlands eScience Center | ||
# SPDX-FileCopyrightText: 2022 Jesús García Gonzalez (Netherlands eScience Center) <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center) | ||
# | ||
|
@@ -34,7 +34,7 @@ start: clean | |
# open http://localhost to see the application running | ||
|
||
install: clean | ||
docker compose build database backend auth scrapers nginx # exclude frontend and wait for the build to finish | ||
docker compose build database backend auth codemeta scrapers nginx # exclude frontend and wait for the build to finish | ||
docker compose up --scale scrapers=0 --detach | ||
cd frontend && yarn install | ||
cd documentation && yarn install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM golang:1.22.0-bullseye | ||
|
||
WORKDIR /usr/src/app | ||
COPY go.mod . | ||
COPY **.go . | ||
|
||
RUN go build -v -o /usr/local/bin/app | ||
|
||
RUN useradd user | ||
USER user | ||
|
||
CMD ["app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
SPDX-License-Identifier: CC-BY-4.0 | ||
--> | ||
|
||
# CodeMeta server | ||
|
||
This module implements a [CodeMeta](https://codemeta.github.io/) server, using [V3](https://w3id.org/codemeta/v3.0) of the schema. | ||
|
||
If your instance of the RSD is hosted on https://example.com/, you can access the CodeMeta server on https://example.com/codemeta/v3/. To get the CodeMeta data for a software page, just append its slug to this URL. For example, to get the CodeMeta data for software page on https://example.com/software/some-software, visit https://example.com/codemeta/v3/some-software/. | ||
|
||
## Developing | ||
|
||
This module is written in Go, version 1.22. You can find the installation instruction [here](https://go.dev/doc/install). If this page lists a newer version than the one we use, you can find all versions [here](https://go.dev/dl/). We currently don't have any external dependencies. | ||
|
||
When developing and running it locally, you need a locally running RSD instance, and you should set the `POSTGREST_URL` environment variable to a value at which the PostgREST backend can be reached. This will probably be `http://localhost/api/v1`. You can also point it to a dev or production server instead. | ||
|
||
To build the module, open a terminal in the `codemeta` directory and run | ||
|
||
```shell | ||
go build | ||
``` | ||
|
||
This should produce an executable called `codemeta`. Run it with | ||
|
||
```shell | ||
POSTGREST_URL=http://localhost/api/v1 ./codemeta | ||
``` | ||
|
||
You can then access the service on http://localhost:8000/v3/ | ||
|
||
You can also use an IDE to build and run it more easily. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
// SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module codemeta | ||
|
||
go 1.22 |
Oops, something went wrong.