From c7093eee45b9af8a5e326fc45a0bd92ee945df7c Mon Sep 17 00:00:00 2001 From: David Boreham Date: Thu, 18 May 2023 13:52:43 -0600 Subject: [PATCH] Fix up test stack --- app/data/compose/docker-compose-fixturenet-laconicd.yml | 3 ++- app/data/compose/docker-compose-test.yml | 8 +++++++- app/data/container-build/cerc-test-container/run.sh | 9 ++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/data/compose/docker-compose-fixturenet-laconicd.yml b/app/data/compose/docker-compose-fixturenet-laconicd.yml index 9a974e90..21c9fb77 100644 --- a/app/data/compose/docker-compose-fixturenet-laconicd.yml +++ b/app/data/compose/docker-compose-fixturenet-laconicd.yml @@ -1,10 +1,11 @@ -version: "3.2" services: laconicd: restart: unless-stopped image: cerc/laconicd:local command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] volumes: + # The cosmos-sdk node's database directory: + - laconicd-data:/root/.laconicd/data # TODO: look at folding these scripts into the container - ../config/fixturenet-laconicd/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh - ../config/fixturenet-laconicd/export-mykey.sh:/docker-entrypoint-scripts.d/export-mykey.sh diff --git a/app/data/compose/docker-compose-test.yml b/app/data/compose/docker-compose-test.yml index 929f6feb..d20c3cfc 100644 --- a/app/data/compose/docker-compose-test.yml +++ b/app/data/compose/docker-compose-test.yml @@ -1,7 +1,13 @@ -version: "3.2" services: test: image: cerc/test-container:local restart: always + environment: + CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} + volumes: + - test-data:/var ports: - "80" + +volumes: + test-data: diff --git a/app/data/container-build/cerc-test-container/run.sh b/app/data/container-build/cerc-test-container/run.sh index b4757d9a..5aa33467 100755 --- a/app/data/container-build/cerc-test-container/run.sh +++ b/app/data/container-build/cerc-test-container/run.sh @@ -1,11 +1,14 @@ -#!/bin/sh - +#!/usr/bin/env bash +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi # Test if the container's filesystem is old (run previously) or new EXISTSFILENAME=/var/exists echo "Test container starting" if [[ -f "$EXISTSFILENAME" ]]; then - TIMESTAMP = `cat $EXISTSFILENAME` + TIMESTAMP=`cat $EXISTSFILENAME` echo "Filesystem is old, created: $TIMESTAMP" else echo "Filesystem is fresh" -- 2.45.2