summaryrefslogtreecommitdiffstats
path: root/certService
diff options
context:
space:
mode:
authorBogumil Zebek <bogumil.zebek@nokia.com>2020-03-18 07:09:48 +0100
committerZebek Bogumil <bogumil.zebek@nokia.com>2020-03-18 07:09:48 +0100
commit55061dabd9dd0ca53c8a4cb9fe2ff1d80cf9c3a3 (patch)
treec4d950365e7c2b7c45603c8f6edbf555d6231472 /certService
parent1b3f9cbabdabe43588bcf8e3b92c89bd87272ef6 (diff)
CertService local starter
Issue-ID: AAF-1107 Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com> Change-Id: I7742fa622bd8acf4764137d98cad581781487103
Diffstat (limited to 'certService')
-rw-r--r--certService/Makefile31
-rw-r--r--certService/README.md13
-rw-r--r--certService/docker-compose.yml1
-rwxr-xr-xcertService/src/main/resources/scripts/ejbca-configuration.sh5
4 files changed, 41 insertions, 9 deletions
diff --git a/certService/Makefile b/certService/Makefile
new file mode 100644
index 00000000..b1b63b4d
--- /dev/null
+++ b/certService/Makefile
@@ -0,0 +1,31 @@
+all: build start stop
+.PHONY: build
+
+build:
+ @echo "##### Build Cert Service images locally #####"
+ mvn clean install -P docker
+ @echo "##### DONE #####"
+start:
+ @echo "##### Start Cert Service #####"
+ docker-compose up -d
+ @echo "## Configure ejbca ##"
+ docker exec aafcert-ejbca /opt/primekey/scripts/ejbca-configuration.sh
+ @echo "##### DONE #####"
+stop:
+ @echo "##### Stop Cert Service #####"
+ docker-compose down
+ @echo "##### DONE #####"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/certService/README.md b/certService/README.md
index e48dad53..9f23504e 100644
--- a/certService/README.md
+++ b/certService/README.md
@@ -48,6 +48,8 @@ mvn clean install
### Building Docker image and install the package into local repository
```
mvn clean install -P docker
+or
+make build
```
### Running Docker container local
@@ -62,9 +64,14 @@ docker run -p 8080:8080 --name aaf-certservice-api --mount type=bind,source=/<ab
### Running Docker container from docker-compose with EJBCA
Docker-compose uses a local image of certservice.
-Build a docker image locally before run docker compose command. See a section **Building Docker image and install the package into local repository**
-```
-docker-compose up
+Build a docker image locally before run docker compose command.
+```
+1. Build local image
+make build
+2. Start Cert Service with configured EJBCA
+make start
+3. Stop containers
+make stop
```
### Running with Helm
diff --git a/certService/docker-compose.yml b/certService/docker-compose.yml
index 97d187e0..2f4f4b4a 100644
--- a/certService/docker-compose.yml
+++ b/certService/docker-compose.yml
@@ -11,7 +11,6 @@ services:
volumes:
- ./src/main/resources/scripts/:/opt/primekey/scripts
command: bash -c "
- ./scripts/ejbca-configuration.sh &
/opt/primekey/bin/start.sh
"
healthcheck:
diff --git a/certService/src/main/resources/scripts/ejbca-configuration.sh b/certService/src/main/resources/scripts/ejbca-configuration.sh
index 705f40ca..77f5c555 100755
--- a/certService/src/main/resources/scripts/ejbca-configuration.sh
+++ b/certService/src/main/resources/scripts/ejbca-configuration.sh
@@ -1,9 +1,5 @@
#!/bin/bash
-waitForEjbcaStartUp() {
- sleep $1
-}
-
configureEjbca() {
ejbca.sh config cmp addalias --alias cmpRA
ejbca.sh config cmp updatealias --alias cmpRA --key operationmode --value ra
@@ -20,5 +16,4 @@ configureEjbca() {
ejbca.sh ca getcacert --caname ManagementCA -f /dev/stdout > cacert.pem
}
-waitForEjbcaStartUp 30
configureEjbca