Skip to content

Commit 34d914b

Browse files
authored
Merge pull request #84 from MassBank/dev
Merge dev to main
2 parents 666012c + f99880d commit 34d914b

File tree

434 files changed

+33666
-20651
lines changed

Some content is hidden

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

434 files changed

+33666
-20651
lines changed

.github/workflows/create-docker.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Create Docker Container
33
on:
44
push:
55
branches:
6-
- 'main'
7-
- 'dev'
6+
- "main"
7+
- "dev"
88
tags:
9-
- 'v*'
9+
- "v*"
1010

1111
jobs:
1212
build-and-push-images:
@@ -17,42 +17,44 @@ jobs:
1717
matrix:
1818
include:
1919
- dockerfile: ./Dockerfile-dbtool
20-
image: ipbhalle/mb3dbtool
21-
- dockerfile: ./Dockerfile
22-
image: ipbhalle/mb3server
23-
- dockerfile: ./Dockerfile-frontend
24-
image: ipbhalle/mb3frontend
20+
image: quay.io/massbank/massbank-dbtool
21+
context: .
22+
- dockerfile: ./Dockerfile-server
23+
image: quay.io/massbank/massbank-api
24+
context: .
25+
- dockerfile: ./web-frontend/Dockerfile-frontend
26+
image: quay.io/massbank/massbank-frontend
27+
context: ./web-frontend
2528

2629
steps:
2730
- name: Checkout
2831
uses: actions/checkout@v4
2932

30-
- name: Login to Docker Hub
33+
- name: Login to quay.io
3134
uses: docker/login-action@v3
3235
with:
33-
username: ${{ secrets.DOCKERHUB_USERNAME }}
34-
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
registry: quay.io
37+
username: ${{ secrets.QUAY_USERNAME }}
38+
password: ${{ secrets.QUAY_TOKEN }}
3539

3640
- name: Docker meta
3741
id: meta
3842
uses: docker/metadata-action@v5
3943
with:
4044
images: ${{ matrix.image }}
4145
tags: |
42-
# branch event
43-
type=ref,event=branch
4446
# tag event
4547
type=ref,event=tag
46-
# pull request event
47-
type=ref,event=pr
4848
# set latest tag for main branch and tags
4949
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
50+
# set dev tag for dev branch, but exclude ipbhalle/postgres
51+
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }}
5052
5153
- name: Build and push
52-
uses: docker/build-push-action@v5
54+
uses: docker/build-push-action@v6
5355
with:
54-
context: .
56+
context: ${{ matrix.context }}
5557
push: ${{ github.event_name != 'pull_request' }}
5658
file: ${{ matrix.dockerfile }}
5759
tags: ${{ steps.meta.outputs.tags }}
58-
labels: ${{ steps.meta.outputs.labels }}
60+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/create-docker2.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Create Docker Container
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
- "dev"
8+
tags:
9+
- "v*"
10+
11+
jobs:
12+
build-and-push-images:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- dockerfile: ./Dockerfile-dbtool
20+
image: ipbhalle/massbank3-dbtool
21+
context: .
22+
- dockerfile: ./Dockerfile-server
23+
image: ipbhalle/massbank3-server
24+
context: .
25+
- dockerfile: ./web-frontend/Dockerfile-frontend
26+
image: ipbhalle/massbank3-frontend
27+
context: ./web-frontend
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Login to Docker Hub
34+
uses: docker/login-action@v3
35+
with:
36+
username: ${{ secrets.DOCKERHUB_USERNAME }}
37+
password: ${{ secrets.DOCKERHUB_TOKEN }}
38+
39+
- name: Docker meta
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ matrix.image }}
44+
tags: |
45+
# tag event
46+
type=ref,event=tag
47+
# set latest tag for main branch and tags
48+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
49+
# set dev tag for dev branch
50+
# set dev tag for dev branch, but exclude ipbhalle/postgres
51+
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' && matrix.image != 'ipbhalle/postgres' }}
52+
53+
- name: Build and push
54+
uses: docker/build-push-action@v5
55+
with:
56+
context: ${{ matrix.context }}
57+
push: ${{ github.event_name != 'pull_request' }}
58+
file: ${{ matrix.dockerfile }}
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/go-test.yml

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
name: go-test
32

43
on:
54
push:
6-
branches: [ "*"]
5+
branches: ["*"]
76
pull_request:
8-
branches: [ "*" ]
7+
branches: ["*"]
98

109
env:
1110
BUILD_TYPE: Release
@@ -14,10 +13,9 @@ jobs:
1413
build:
1514
strategy:
1615
matrix:
17-
mongodb-version: ['6.0']
18-
os: [ 'ubuntu-22.04', 'ubuntu-20.04']
19-
postgres-images: [ 'postgres:latest']
20-
go-version: ['1.20']
16+
os: ["ubuntu-latest", "ubuntu-24.04"]
17+
postgres-images: ["postgres:latest"]
18+
go-version: ["1.20"]
2119
runs-on: ${{ matrix.os }}
2220

2321
services:
@@ -37,25 +35,16 @@ jobs:
3735
--health-retries 5
3836
3937
steps:
40-
- uses: actions/checkout@v3
41-
42-
- name: Start MongoDB
43-
uses: supercharge/mongodb-github-action@1.8.0
44-
with:
45-
mongodb-version: ${{ matrix.mongodb-version }}
46-
mongodb-username: mbtestuser
47-
mongodb-password: mbtestpwd
48-
mongodb-db: mbtestdb
49-
50-
- uses: actions/setup-go@v3
51-
with:
52-
go-version: ${{matrix.go-version}}
53-
54-
- name: Run all go tests
55-
run: go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic
56-
env:
57-
MONGODB_HOST: localhost
58-
POSTGRES_HOST: localhost
59-
TEST_DATA_DIR: /home/runner/work/MassBank3/MassBank3/
60-
- name: Upload coverage to Codecov
61-
uses: codecov/codecov-action@v3
38+
- uses: actions/checkout@v3
39+
40+
- uses: actions/setup-go@v3
41+
with:
42+
go-version: ${{matrix.go-version}}
43+
44+
# - name: Run all go tests
45+
# run: go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic
46+
# env:
47+
# POSTGRES_HOST: localhost
48+
# TEST_DATA_DIR: /home/runner/work/MassBank3/MassBank3/
49+
# - name: Upload coverage to Codecov
50+
# uses: codecov/codecov-action@v3

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
1616
/docker/.env
17-
/.idea/
17+
.idea/
1818
/docker/debuglog/
1919
/scripts/bin/
2020
/docker/deploy.sh
21+
/docker/deploy_with_init.sh
2122

2223
# misc
23-
.DS_Store
24+
.DS_Store/
25+
.vscode/
26+
/compose/.env
27+

cmd/mb3server/.openapi-generator-ignore renamed to .openapi-generator-ignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
#docs/*.md
2222
# Then explicitly reverse the ignore rule for a single file:
2323
#!docs/README.md
24+
25+
Dockerfile
26+
README.md
27+
api/*
2428
go.mod
25-
src/api_default_service.go
26-
Dockerfile
29+
main.go
30+
pkg/mb3server/db_interface.go
31+
pkg/mb3server/api-impl.go
32+
pkg/mb3server/api_default_service.go
33+

.openapi-generator/FILES

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
pkg/mb3server/api.go
2+
pkg/mb3server/api_default.go
3+
pkg/mb3server/error.go
4+
pkg/mb3server/helpers.go
5+
pkg/mb3server/impl.go
6+
pkg/mb3server/logger.go
7+
pkg/mb3server/model_ac_chromatography_inner.go
8+
pkg/mb3server/model_ac_general_inner.go
9+
pkg/mb3server/model_ac_ion_mobility_inner.go
10+
pkg/mb3server/model_ac_mass_spec.go
11+
pkg/mb3server/model_ac_mass_spec_subtags_inner.go
12+
pkg/mb3server/model_authors_inner.go
13+
pkg/mb3server/model_browse_options.go
14+
pkg/mb3server/model_database_object.go
15+
pkg/mb3server/model_get_status_200_response.go
16+
pkg/mb3server/model_get_status_200_response_export_service.go
17+
pkg/mb3server/model_get_status_200_response_postgres.go
18+
pkg/mb3server/model_get_status_200_response_similarity_service.go
19+
pkg/mb3server/model_mb_record.go
20+
pkg/mb3server/model_mb_record_acquisition.go
21+
pkg/mb3server/model_mb_record_comments_inner.go
22+
pkg/mb3server/model_mb_record_comments_inner_one_of.go
23+
pkg/mb3server/model_mb_record_compound.go
24+
pkg/mb3server/model_mb_record_date.go
25+
pkg/mb3server/model_mb_record_deprecated.go
26+
pkg/mb3server/model_mb_record_mass_spectrometry.go
27+
pkg/mb3server/model_mb_record_peak.go
28+
pkg/mb3server/model_mb_record_peak_annotation.go
29+
pkg/mb3server/model_mb_record_peak_neutral_loss_inner.go
30+
pkg/mb3server/model_mb_record_peak_peak.go
31+
pkg/mb3server/model_mb_record_peak_peak_values_inner.go
32+
pkg/mb3server/model_mb_record_species.go
33+
pkg/mb3server/model_metadata.go
34+
pkg/mb3server/model_metadata_compound_class_inner.go
35+
pkg/mb3server/model_ms_data_processing_inner.go
36+
pkg/mb3server/model_ms_focused_ion_inner.go
37+
pkg/mb3server/model_search_result.go
38+
pkg/mb3server/model_search_result_data_inner.go
39+
pkg/mb3server/model_similarity_search_result.go
40+
pkg/mb3server/model_similarity_search_result_data_inner.go
41+
pkg/mb3server/model_string_count_inner.go
42+
pkg/mb3server/routers.go

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.12.0

.vscode/settings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

Dockerfile-dbtool

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM docker.io/golang:1.20 AS build
1+
FROM docker.io/golang:1.23 AS build
22
WORKDIR /go/src
3-
COPY cmd/mb3dbtool/main.go ./cmd/mb3dbtool/
3+
COPY pkg/mb3dbtool/main.go ./cmd/mb3dbtool/
44
COPY pkg/ ./pkg
55
COPY go.mod .
66

@@ -9,7 +9,14 @@ RUN go get -d -v ./...
99

1010
RUN go build -a -installsuffix cgo -o mb3dbtool ./cmd/mb3dbtool
1111

12-
FROM docker.io/alpine AS runtime
12+
FROM docker.io/alpine:3.21 AS runtime
1313
COPY --from=build /go/src/mb3dbtool ./
14+
RUN printf 'case $MB_DB_INIT in\n\
15+
true) echo Initialize database...\n\
16+
./mb3dbtool;;\n\
17+
*) echo Skip database initialization...;;\n\
18+
esac' > ./entrypoint.sh
19+
RUN chmod +x ./entrypoint.sh
20+
1421
EXPOSE 8080/tcp
15-
ENTRYPOINT ["./mb3dbtool"]
22+
CMD ["/bin/sh","./entrypoint.sh"]

Dockerfile-debug

Lines changed: 0 additions & 21 deletions
This file was deleted.

Dockerfile-frontend

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)