Fix up test stack (#398)

Former-commit-id: 088105c7829254fc8ff1f31b71d28fd916def7eb
This commit is contained in:
David Boreham 2023-05-19 03:54:27 +08:00 committed by GitHub
parent 0691c22db4
commit 87c25dfb5e
3 changed files with 15 additions and 5 deletions

View File

@ -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

View File

@ -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:

View File

@ -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"