initial commit
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the redapricot hub (Java) and client (Go).
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
# The Gradle JVM: prefer JAVA_HOME, then an SDKMAN JDK, then whatever is on PATH.
|
||||
if [[ -z "${JAVA_HOME:-}" ]]; then
|
||||
if [[ -d "$HOME/.sdkman/candidates/java/current" ]]; then
|
||||
JAVA_HOME="$HOME/.sdkman/candidates/java/current"
|
||||
fi
|
||||
fi
|
||||
export JAVA_HOME
|
||||
GRADLE="${GRADLE:-$HOME/.sdkman/candidates/gradle/current/bin/gradle}"
|
||||
if ! command -v "$GRADLE" >/dev/null 2>&1; then
|
||||
GRADLE="gradle"
|
||||
fi
|
||||
|
||||
echo ">> Building Java hub server (installDist)..."
|
||||
"$GRADLE" -p "$ROOT/server" installDist --console=plain
|
||||
|
||||
echo ">> Building Go client..."
|
||||
mkdir -p "$ROOT/bin"
|
||||
( cd "$ROOT" && go build -o "$ROOT/bin/redapricot-client" ./cmd/redapricot-client )
|
||||
|
||||
cat <<EOF
|
||||
|
||||
>> Build complete.
|
||||
Hub: $ROOT/server/build/install/redapricot-server/bin/redapricot-server <config.json>
|
||||
Client: $ROOT/bin/redapricot-client <config.json>
|
||||
EOF
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the hub, then run the end-to-end integration suite.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
# The Java hub must be installed for the e2e harness to launch it.
|
||||
"$ROOT/scripts/build.sh"
|
||||
|
||||
echo ">> Running Go unit tests..."
|
||||
( cd "$ROOT" && go test ./client/... -count=1 )
|
||||
|
||||
echo ">> Running end-to-end tests..."
|
||||
( cd "$ROOT" && go test ./e2e/... -count=1 -v -timeout 300s )
|
||||
Reference in New Issue
Block a user