From 982052bf873790c0aa9a27a5606c567a89f77288 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Fri, 19 May 2023 13:35:31 -0600 Subject: [PATCH] Deploy test --- tests/deploy/run-deploy-test.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tests/deploy/run-deploy-test.sh diff --git a/tests/deploy/run-deploy-test.sh b/tests/deploy/run-deploy-test.sh new file mode 100755 index 00000000..7d9bc0d6 --- /dev/null +++ b/tests/deploy/run-deploy-test.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi +# Dump environment variables for debugging +echo "Environment variables:" +env +# Test basic stack-orchestrator deploy +echo "Running stack-orchestrator deploy test" +# Bit of a hack, test the most recent package +TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 ) +# Set a non-default repo dir +export CERC_REPO_BASE_DIR=~/stack-orchestrator-test/repo-base-dir +echo "Testing this package: $TEST_TARGET_SO" +echo "Test version command" +reported_version_string=$( $TEST_TARGET_SO version ) +echo "Version reported is: ${reported_version_string}" +echo "Cloning repositories into: $CERC_REPO_BASE_DIR" +rm -rf $CERC_REPO_BASE_DIR +mkdir -p $CERC_REPO_BASE_DIR +# Test pulling a stack +$TEST_TARGET_SO --stack test setup-repositories +# Test building the a stack container +$TEST_TARGET_SO --stack test build-containers +$TEST_TARGET_SO --stack test deploy-system up +# TODO: test that we can use the deployed container somehow +# Clean up +$TEST_TARGET_SO --stack test deploy-system down +echo "Test passed"