Skip to content

Commit a65779d

Browse files
committed
Merge branch 'RM-4763_documentation_update' into 'master'
RM-4763: doc update See merge request cdoc2/cdoc2-shares-server!18
2 parents 3553a87 + 454d441 commit a65779d

File tree

11 files changed

+386
-325
lines changed

11 files changed

+386
-325
lines changed

.env

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1-
#SHARES_SERVER_VERSION=latest
2-
# SHARES_SERVER_VERSION=latest
3-
#SHARES_SERVER_DB_VERSION=0.1.0
4-
# don't set DOCKER_REGISTRY when working only locally
5-
# DOCKER_REGISTRY=
6-
#DOCKER_REGISTRY=gitlab.ext.cyber.ee:5050/cdoc2/
1+
# Default .env file that will use ghcr.io/open-eid
2+
# Need to be logged in https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic
73
DOCKER_REGISTRY=ghcr.io
8-
# database properties
4+
DOCKER_REPOSITORY=open-eid
5+
6+
# also locally built images use ghcr.io/open-eid for repository
7+
8+
# gitlab.ext
9+
# instead of commenting out following lines, run:
10+
# `source export-env.sh .env.cyber` to overwrite variables in this file from environment variables
11+
#DOCKER_REGISTRY=gitlab.ext.cyber.ee:5050
12+
#DOCKER_REPOSITORY=cdoc2/cdoc2-shares-server
13+
14+
# environment variables are not properly expanded in .env file,
15+
# so don't use variables for defining other variables
16+
#SHARES_SERVER_IMAGE=${DOCKER_REGISTRY}/${DOCKER_REPOSITORY}/cdoc2-shares-server
17+
#SHARES_SERVER_LIQUIBASE_IMAGE=${DOCKER_REGISTRY}/${DOCKER_REPOSITORY}/cdoc2-shares-server-liquibase
18+
19+
# liquibase and shares-server should use the same version so they are built from same source and are compatible with each other
20+
# For GH workflows, built images version is release tag + commit hash
21+
# find latest version from https://github.com/orgs/open-eid/packages?ecosystem=container
22+
#SHARES_SERVER_VERSION=0.4.1-snapshot.0-3553a87e54851276c82ee734eebcc207aaf90088
23+
# local builds will have version from cdoc2-shares-server/shares-server/pom.xml
24+
#SHARES_SERVER_VERSION=0.2.0-SNAPSHOT
25+
SHARES_SERVER_VERSION=latest
26+
27+
# database properties used in docker-compose.yml
928
POSTGRES_URL=cdoc2-shares-postgres:5432
1029
POSTGRES_DB=cdoc2-shares
1130
POSTGRES_USER=postgres
12-
POSTGRES_PASSWORD=secret
31+
POSTGRES_PASSWORD=secret

README-DOCKER.md

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

README.md

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and [DigiDoc4-Client](https://github.com/open-eid/DigiDoc4-Client) for CDOC2 enc
2222

2323
Depends on:
2424
* https://github.com/open-eid/cdoc2-openapi OpenAPI specifications for server stub generation
25-
* https://github.com/open-eid/cdoc2-java-ref-impl (for tests only, use `-Dmaven.test.skip=true` to skip)
25+
* https://github.com/open-eid/cdoc2-java-ref-impl (for unit tests only, use `-Dmaven.test.skip=true` to skip)
2626

2727
Configure github package repo access
2828
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-with-a-personal-access-token
@@ -57,6 +57,15 @@ So defining single Maven package repo from `open-eid` is enough for pulling cdoc
5757
mvn clean install
5858
```
5959

60+
To build Docker images:
61+
```bash
62+
./build-images.sh
63+
```
64+
```
65+
[INFO] Successfully built image 'ghcr.io/open-eid/cdoc2-shares-server:0.4.1-SNAPSHOT'
66+
[INFO] Successfully created image tag 'ghcr.io/open-eid/cdoc2-shares-server:latest'
67+
```
68+
6069
### GitHub workflow build
6170

6271
Maven build is executed for GH event `pull_request` an and `push` to 'master'.
@@ -69,19 +78,42 @@ by [defining repository variable](https://docs.github.com/en/actions/writing-wor
6978

7079
### Running
7180

72-
See [getting-started.md](getting-started.md) and [admin-guide.md](admin-guide.md)
81+
See [getting-started.md](getting-started.md) and [admin-guide.md](admin-guide.md)
7382

7483
### Running pre-built Docker/OCI images
7584

76-
See [cdoc2-java-ref-impl](https://github.com/open-eid/cdoc2-java-ref-impl)/test/config/shares-server/docker-compose.yml
85+
Pre-built images can be found <https://github.com/orgs/open-eid/packages?ecosystem=container>
86+
87+
Quickstart:
88+
```bash
89+
docker compose up -d
90+
curl -k https://localhost:18443/actuator/info
91+
echo "Run 'docker compose down' to shut down 'cdoc2-shares-server'"
92+
```
93+
94+
```bash
95+
curl -i -k -X POST https://localhost:8443/key-shares \
96+
-H 'Content-Type: application/json' \
97+
-H 'Accept: application/json' \
98+
-d '{"share":"dGVzdHRlc3R0ZXN0dGVzdHRlc3R0ZXN0dGVzdHRlc3QK","recipient":"etsi/PNOEE-30303039914"}'
99+
```
100+
```
101+
HTTP/1.1 201
102+
Location: /key-shares/ee368ad654142dda1d9d8e00744df2c8
103+
```
104+
105+
For more info see [admin-guide.md](admin-guide.md) and other existing configurations:
77106

78-
## Releasing and versioning
107+
* [cdoc2-java-ref-impl/test/config/shares-server/docker-compose.yml](https://github.com/open-eid/cdoc2-java-ref-impl/blob/SID/test/config/shares-server/docker-compose.yml) _TODO: update branch SID->master after release_
108+
* [cdoc2-gatling-tests/setup-load-testing](https://github.com/open-eid/cdoc2-gatling-tests/) _TODO: update links_
79109

80-
See [VERSIONING.md](https://github.com/open-eid/cdoc2-java-ref-impl/blob/master/VERSIONING.md)
110+
For end-to-end tests see
111+
[cdoc2-java-ref-impl/test/bats/README.md](https://github.com/open-eid/cdoc2-java-ref-impl/tree/SID/test#running-smart-idmobile-id-tests-experimental) _TODO: update branch SID->master_
81112

82113
### GitHub release
83114

84-
[Create release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release) on tag done by [VERSIONING.md](https://github.com/open-eid/cdoc2-java-ref-impl/blob/master/VERSIONING.md) process.
85-
It will trigger `maven-release.yml` workflow that will deploy Maven packages to GitHub Maven package repository
86-
and build & publish Docker/OCI images.
115+
[Create release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release). Tag name is used as built image version, so it should start with shares-server version
116+
from [shares-server/pom.xml](shares-server/pom.xml).
117+
It will trigger [`maven-release.yml`](.github/workflows/maven-release.yml) workflow that will deploy Maven packages to GitHub Maven package repository
118+
and build & publish Docker/OCI images. Docker images are published to <https://github.com/orgs/open-eid/packages?ecosystem=container>
87119

0 commit comments

Comments
 (0)