squash me

debug
This commit is contained in:
zramsay 2023-09-27 17:35:27 -04:00
parent c8c8ce9788
commit 067c618321
4 changed files with 40 additions and 14 deletions

View File

@ -45,5 +45,7 @@ jobs:
dockerd -H $DOCKER_HOST --userland-proxy=false & dockerd -H $DOCKER_HOST --userland-proxy=false &
sleep 5 sleep 5
- name: "Run gitea tests" - name: "Run gitea tests"
run: ./tests/gitea/test.sh run: |
export CERC_SCRIPT_DEBUG=true &
./tests/gitea/test.sh

View File

@ -1,7 +1,5 @@
# Stack Orchestrator # Stack Orchestrator
test
Stack Orchestrator allows building and deployment of a Laconic Stack on a single machine with minimial prerequisites. It is a Python3 CLI tool that runs on any OS with Python3 and Docker. The following diagram summarizes the relevant repositories in the Laconic Stack - and the relationship to Stack Orchestrator. Stack Orchestrator allows building and deployment of a Laconic Stack on a single machine with minimial prerequisites. It is a Python3 CLI tool that runs on any OS with Python3 and Docker. The following diagram summarizes the relevant repositories in the Laconic Stack - and the relationship to Stack Orchestrator.
![The Stack](/docs/images/laconic-stack.png) ![The Stack](/docs/images/laconic-stack.png)

View File

@ -1,9 +1,25 @@
#!/bin/bash #!/bin/bash
# Usage: build-npm-package.sh <registry-url> <publish-with-this-version> # Usage: build-npm-package.sh <registry-url> <publish-with-this-version>
# Note: supply the registry auth token in CERC_NPM_AUTH_TOKEN # Note: supply the registry auth token in CERC_NPM_AUTH_TOKEN
#
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
set -x set -x
fi fi
echo "GITEA ACTIONS 1 is: $GITEA_ACTIONS"
echo "GITEA ACTIONS 2 is: ${GITEA_ACTIONS}"
echo "token 1 is: $CERC_NPM_AUTH_TOKEN"
echo "token 2 is: ${CERC_NPM_AUTH_TOKEN}"
if [[ "$GITEA_ACTIONS" = "true" ]]; then
echo "WORKS"
else
echo "WTF"
fi
if ! [[ $# -eq 1 || $# -eq 2 ]]; then if ! [[ $# -eq 1 || $# -eq 2 ]]; then
echo "Illegal number of parameters" >&2 echo "Illegal number of parameters" >&2
exit 1 exit 1
@ -28,8 +44,10 @@ npm config set @lirewine:registry ${local_npm_registry_url}
local_npm_registry_url_fixed=$( echo ${local_npm_registry_url} | sed -e 's/^http[s]\{0,1\}://') local_npm_registry_url_fixed=$( echo ${local_npm_registry_url} | sed -e 's/^http[s]\{0,1\}://')
npm config set -- ${local_npm_registry_url_fixed}:_authToken ${CERC_NPM_AUTH_TOKEN} npm config set -- ${local_npm_registry_url_fixed}:_authToken ${CERC_NPM_AUTH_TOKEN}
# First check if the version of this package we're trying to build already exists in the registry # First check if the version of this package we're trying to build already exists in the registry
# but this line: "jq -r .data.dist.tarball" fails only in gitea, so skip this block
if [[ "${GITEA_ACTIONS}" != "true" ]]; then
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball ) package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
echo "${package_publish_version} of ${package_name} already exists in the registry" echo "${package_publish_version} of ${package_name} already exists in the registry"
if [[ ${CERC_FORCE_REBUILD} == "true" ]]; then if [[ ${CERC_FORCE_REBUILD} == "true" ]]; then
# Attempt to unpublish the existing package # Attempt to unpublish the existing package
@ -39,6 +57,7 @@ if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
echo "skipping build since target version already exists" echo "skipping build since target version already exists"
exit 0 exit 0
fi fi
fi
fi fi
echo "Build and publish ${package_name} version ${package_publish_version}" echo "Build and publish ${package_name} version ${package_publish_version}"
yarn install yarn install

View File

@ -1,12 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
export CERC_SCRIPT_DEBUG=true
if [ -n "$CERC_SCRIPT_DEBUG" ]; then if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x set -x
fi fi
# Dump environment variables for debugging # Dump environment variables for debugging
echo "Environment variables:" echo "Environment variables:"
env env
echo "holla 1 $GITEA_ACTIONS"
echo "Running gitea test" echo "Running gitea test"
# Bit of a hack, test the most recent package # Bit of a hack, test the most recent package
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 ) TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
# Set a non-default repo dir # Set a non-default repo dir
@ -25,8 +30,10 @@ $TEST_TARGET_SO --stack package-registry build-containers
output=$($TEST_TARGET_SO --stack package-registry deploy-system up) output=$($TEST_TARGET_SO --stack package-registry deploy-system up)
token=$(echo $output | grep -o 'export CERC_NPM_AUTH_TOKEN=[^ ]*' | cut -d '=' -f 2) token=$(echo $output | grep -o 'export CERC_NPM_AUTH_TOKEN=[^ ]*' | cut -d '=' -f 2)
export CERC_NPM_AUTH_TOKEN=$token export CERC_NPM_AUTH_TOKEN=$token
export GITEA_ACTIONS=true
echo "holla 2 $GITEA_ACTIONS"
$TEST_TARGET_SO --stack fixturenet-laconicd setup-repositories $TEST_TARGET_SO --stack fixturenet-laconicd setup-repositories
$TEST_TARGET_SO --stack fixturenet-laconicd build-npms $TEST_TARGET_SO --stack fixturenet-laconicd --verbose --debug build-npms --include laconic-sdk
# Clean up # Clean up
$TEST_TARGET_SO --stack package-registry deploy-system down $TEST_TARGET_SO --stack package-registry deploy-system down