-
Notifications
You must be signed in to change notification settings - Fork 10
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
Mongodb DAO Update #112
Mongodb DAO Update #112
Changes from 9 commits
6b8b89b
c0d6c09
4b786dc
daa02c4
ee96447
924ccdd
c8e8e19
f1835ee
3ba061a
4485e2e
9819f17
ea1c815
4e088c6
2aac59c
658b721
8e50d62
6ddedbf
ee664d0
0dc0853
daab992
95b512b
738df60
c16411c
0c81791
eac0a72
372bfc7
077150a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [ "mongo-workflow-fix" ] | ||
minottic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
jobs: | ||
deploy: | ||
name: Build and deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create image tags | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
flavor: latest=true # adds :latest tag to outputs.tags | ||
tags: type=sha,format=long,prefix= # adds :<sha> tag to outputs.tags | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64/v8 | ||
push: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we set this to true only on push to master? in this way, we avoid the permission error when coming from a fork There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be enough to evaluate the true false condition in the push field. push: ${{ github.event_name. == 'push' }} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I misunderstood. I fixed with 077150a. Seems to work for 'push' on my branch and 'pr' on the scicat master. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. np! thanks for the changes! I would be fine merging now, do you plan any other change or is it good to go? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not planning any other changes in this PR so we are good to go from my side. Thanks a lot for your help. |
||
tags: ${{ steps.meta.outputs.tags }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": "tsx", | ||
"extension": ["ts"], | ||
"spec": [ "src/server/env.ts" , "test/**/*.ts"] | ||
} |
minottic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,10 @@ The National Library of Finland. | |
|
||
## Dependenices | ||
|
||
* Node 8.9.4+ | ||
* Typescript 2.7.2+ | ||
* npm 5.6.0+ | ||
* Node v18.20.38+ | ||
* Typescript 5.5.3+ | ||
* npm 10.8.1+ | ||
* tsx v4.16.2 (for mocha tests only) | ||
|
||
## Capabilities | ||
|
||
|
@@ -56,6 +57,69 @@ Add new records to your mongodb instance by HTTP PUT using the following route: | |
* `http://localhost:3000/scicat/Publication` | ||
|
||
|
||
## ENVIRONMENT Variables | ||
|
||
*System variables** | ||
Key | Description | Default | ||
--------:|-------------| -------- | ||
DAPP_ID | No Idea | oai-pmh-service | ||
CONNECTOR | (don't change) | mongodb | ||
ADMIN_USER_EMAIL | E-Mail address of the admin user | none | ||
LOG_LEVEL | default/error/warning | none | ||
minottic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Mongo DB variables** | ||
Key | Description | Default | ||
--------:|-------------| -------- | ||
CONNECTOR | (don't change) | mongodb | ||
DB_HOST | Database Hostname | none | ||
DB_PORT | Database Port | none | ||
DB_USER | Database Username | none | ||
DB_PASS | Database Password | none | ||
DB_URL | [<user>:<password>@]<host>:<port>/<dbName>| none | ||
DATABASE | Publication Database | dacat-next | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe change to new scicat namings in a follow-up There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok will do later. |
||
COLLECTION | Collection to storage Publation Documents| PublishedData | ||
COLLECTION_ID | Unique Identifier of records | 'doi' | ||
BASE_URL | Prefix to link back to this server | http://localhost | ||
|
||
**Note**: When DB_URL is specified, DB_HOST/DB_PORT/DB_USER/DB_PASS and DATABASE are ignored. | ||
|
||
**OAI_PMH Listen Port** | ||
|
||
Key | Description | Default | ||
--------:|-------------| -------- | ||
HOST_CONFIGURATION | web server configuration | production/host_config.json | ||
|
||
The content of the *host_config.json* file are the json encoded variables to steer the web server itself. | ||
As far as I can see, the 'host' variable is ignored in the code, but the 'port' variable is honored. | ||
|
||
**Example** for a *host_config.json* file. | ||
``` | ||
{ | ||
"host": "localhost", | ||
"port": 3000 | ||
} | ||
``` | ||
|
||
### Docker start example | ||
Docker start example, assuming there is a network called | ||
'scicatlive_default'. | ||
``` | ||
docker run \ | ||
--network=scicatlive_default \ | ||
-e CONNECTOR=mongodb \ | ||
-e DB_HOST=mongodb \ | ||
-e DB_PORT=27017 \ | ||
-e DB_USER="" \ | ||
-e DB_PASSWORD="" \ | ||
-e DATABASE=dacat-next \ | ||
-e COLLECTION=PublishedData \ | ||
-e COLLECTION_ID="_id" \ | ||
-e HOST_CONFIG=server/host_config.json \ | ||
-p 7002:3001 \ | ||
--name=oai-pmh-provider \ | ||
oai-pmh-provider | ||
``` | ||
|
||
## Run in *production* mode: | ||
|
||
At the simplest level: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this ca be on PR only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I wanted to make sure that the test/deploy works on your side.