chaos-ci-lib/build/generate_go_binary

52 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# Set up Go environment for Linux cross-compilation
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=amd64
echo "Building Go binaries for Linux (GOOS=$GOOS, GOARCH=$GOARCH, CGO_ENABLED=$CGO_ENABLED)"
# Create output directory if it doesn't exist
mkdir -p build/_output
#Creating go binary for installing litmus
go test -o build/_output/install-litmus -c litmus/install-litmus_test.go -v -count=1
#Creating go binary for uninstalling litmus
go test -o build/_output/uninstall-litmus -c litmus/uninstall-litmus_test.go -v -count=1
#Creating go binary for pod-delete test
go test -o build/_output/pod-delete -c experiments/pod-delete_test.go -v -count=1
#Creating go binary for container-kill test
go test -o build/_output/container-kill -c experiments/container-kill_test.go -v -count=1
#Creating go binary for pod-cpu-hog test
go test -o build/_output/pod-cpu-hog -c experiments/pod-cpu-hog_test.go -v -count=1
#Creating go binary for pod-memory-hog test
go test -o build/_output/pod-memory-hog -c experiments/pod-memory-hog_test.go -v -count=1
#Creating go binary for node-cpu-hog test
go test -o build/_output/node-cpu-hog -c experiments/node-cpu-hog_test.go -v -count=1
#Creating go binary for node-memory-hog test
go test -o build/_output/node-memory-hog -c experiments/node-memory-hog_test.go -v -count=1
#Creating go binary for pod-network-corruption test
go test -o build/_output/pod-network-corruption -c experiments/pod-network-corruption_test.go -v -count=1
#Creating go binary for pod-network-latency test
go test -o build/_output/pod-network-latency -c experiments/pod-network-latency_test.go -v -count=1
#Creating go binary for pod-network-loss test
go test -o build/_output/pod-network-loss -c experiments/pod-network-loss_test.go -v -count=1
#Creating go binary for disk-fill test
go test -o build/_output/disk-fill -c experiments/disk-fill_test.go -v -count=1
#Creating go binary for pod-autoscaler test
go test -o build/_output/pod-autoscaler -c experiments/pod-autoscaler_test.go -v -count=1
#Creating go binary for node-io-stress test
go test -o build/_output/node-io-stress -c experiments/node-io-stress_test.go -v -count=1
#Creating go binary for pod-network-duplication test
go test -o build/_output/pod-network-duplication -c experiments/pod-network-duplication_test.go -v -count=1
#Creating go binary for all the tests
cd experiments && go test -o ../build/_output/all-experiments -c -v -count=1
echo "Verifying binary formats:"
file build/_output/container-kill
file build/_output/all-experiments
echo "Build completed successfully!"