From 7f372caa50f4c2bb86a0dad894111eed4e624b9b Mon Sep 17 00:00:00 2001 From: Roger Ng Date: Fri, 20 Oct 2023 19:46:55 +0100 Subject: [PATCH] Improve Dockerized Test Deployment documentation (#1179) * Improve Dockerized Test Deployment documentation * Add curly brackets to align with other variables --- .../examples/deployment/docker/ctfe/README.md | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/trillian/examples/deployment/docker/ctfe/README.md b/trillian/examples/deployment/docker/ctfe/README.md index 54811aedbe..ab5d2bff34 100644 --- a/trillian/examples/deployment/docker/ctfe/README.md +++ b/trillian/examples/deployment/docker/ctfe/README.md @@ -13,9 +13,19 @@ serving production logs! - github.com/google/certificate-transparency-go The instructions below assume you've checked out the repositories within -`~/git/`, but if you have them in another location then just use a different +`/workspaces/`, but if you have them in another location then just use a different path when you run the command. +```bash +# Terminal 1 +export GIT_HOME=/workspaces +``` + +```bash +# Terminal 2 +export GIT_HOME=/workspaces +``` + ## Deploying We will use 2 terminal sessions to the machine you will use for hosting the @@ -27,7 +37,7 @@ First bring up the trillian instance and the database: ```bash # Terminal 1 -cd ~/git/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/ +cd ${GIT_HOME}/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/ docker compose up ``` @@ -35,8 +45,8 @@ This brings up everything except the CTFE. Now to provision the logs. ```bash # Terminal 2 -cd ~/git/trillian/ -docker exec -i ctfe-db mysql -pzaphod -Dtest < ./storage/mysql/schema/storage.sql +cd ${GIT_HOME}/trillian/ +docker exec -i ctfe-db mariadb -pzaphod -Dtest < ./storage/mysql/schema/storage.sql ``` The CTFE requires some configuration files. First prepare a directory containing @@ -49,8 +59,8 @@ more than a few hours then pick a less temporary location on your filesystem. CTFE_CONF_DIR=/tmp/ctfedocker mkdir ${CTFE_CONF_DIR} TREE_ID=$(go run github.com/google/trillian/cmd/createtree@master --admin_server=localhost:8090) -sed "s/@TREE_ID@/$TREE_ID/" ~/git/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/ct_server.cfg > ${CTFE_CONF_DIR}/ct_server.cfg -cp ./trillian/testdata/fake-ca.cert ${CTFE_CONF_DIR} +sed "s/@TREE_ID@/${TREE_ID}/" ${GIT_HOME}/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/ct_server.cfg > ${CTFE_CONF_DIR}/ct_server.cfg +cp ${GIT_HOME}/certificate-transparency-go/trillian/testdata/fake-ca.cert ${CTFE_CONF_DIR} docker volume create --driver local --opt type=none --opt device=${CTFE_CONF_DIR} --opt o=bind ctfe_config ``` @@ -67,7 +77,6 @@ then the following command should return tree head for tree size 0. ```bash # Terminal 2 -cd ~/git/certificate-transparency-go +cd ${GIT_HOME}/certificate-transparency-go go run ./client/ctclient get-sth --log_uri http://localhost:8080/testlog ``` -