2025-01-17 15:18:11 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2025-01-21 14:25:05 -08:00
|
|
|
dirn=$(dirname "$0")
|
|
|
|
|
source $dirn/common.sh
|
|
|
|
|
|
|
|
|
|
if [[ ! -f $dirn/SECRET.sh ]]; then
|
|
|
|
|
error "need to create SECRET.sh... see Readme"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
source $dirn/SECRET.sh
|
|
|
|
|
|
|
|
|
|
# function that helps set parallelism in builds
|
|
|
|
|
# needs to strictly return 3 on VMs and strictly
|
|
|
|
|
# return a lot more on the hypervisor host.
|
|
|
|
|
|
|
|
|
|
function num_jobs() {
|
|
|
|
|
if [ ! $VM_PARALLEL ]; then
|
|
|
|
|
log "VM_PARALLEL not defined, defaulting to 3"
|
|
|
|
|
VM_PARALLEL=3
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! $HOST_PARALLEL ]; then
|
|
|
|
|
log "HOST_PARALLEL not defined, defaulting to 22"
|
|
|
|
|
HOST_PARALLEL=22
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
which virsh >/dev/null && echo $HOST_PARALLEL || echo $VM_PARALLEL
|
|
|
|
|
}
|
2025-01-17 15:18:11 -08:00
|
|
|
|
|
|
|
|
# The following functions are all run on a VM
|
|
|
|
|
# Through an SSH connection. Make sure not to
|
|
|
|
|
# use any external functions in them.
|
|
|
|
|
|
2025-01-21 14:25:05 -08:00
|
|
|
function build_nginx() {
|
2025-01-17 15:18:11 -08:00
|
|
|
auto/configure \
|
|
|
|
|
--with-threads \
|
|
|
|
|
--with-http_ssl_module \
|
|
|
|
|
--with-http_v2_module \
|
|
|
|
|
--with-http_v3_module \
|
|
|
|
|
--with-http_realip_module \
|
|
|
|
|
--with-http_addition_module \
|
|
|
|
|
--with-http_sub_module \
|
|
|
|
|
--with-http_dav_module \
|
|
|
|
|
--with-http_flv_module \
|
|
|
|
|
--with-http_gzip_static_module \
|
|
|
|
|
--with-http_auth_request_module \
|
|
|
|
|
--with-http_random_index_module \
|
|
|
|
|
--with-http_secure_link_module \
|
|
|
|
|
--with-http_slice_module \
|
|
|
|
|
--with-http_stub_status_module \
|
|
|
|
|
--with-stream_ssl_module \
|
|
|
|
|
--with-stream_realip_module \
|
|
|
|
|
--with-stream_ssl_preread_module \
|
|
|
|
|
--with-debug && \
|
2025-01-21 14:25:05 -08:00
|
|
|
make -j$(num_jobs)
|
2025-01-17 15:18:11 -08:00
|
|
|
}
|
|
|
|
|
|
2025-01-21 14:25:05 -08:00
|
|
|
function test_nginx() {
|
|
|
|
|
TEST_NGINX_VERBOSE=1 \
|
|
|
|
|
TEST_NGINX_CATLOG=1 \
|
|
|
|
|
prove -vw -j$(num_jobs) .
|
2025-01-17 15:18:11 -08:00
|
|
|
}
|
|
|
|
|
|
2025-01-21 14:25:05 -08:00
|
|
|
function clean_nginx() {
|
2025-01-17 15:18:11 -08:00
|
|
|
make clean
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-21 14:25:05 -08:00
|
|
|
function build_otel() {
|
|
|
|
|
mkdir -p build && \
|
|
|
|
|
cd build && \
|
|
|
|
|
cmake -DNGX_OTEL_NGINX_BUILD_DIR=../../nginx/objs .. && \
|
|
|
|
|
make -j$(num_jobs)
|
2025-01-17 15:18:11 -08:00
|
|
|
}
|
|
|
|
|
|
2025-01-21 14:25:05 -08:00
|
|
|
function test_otel() {
|
2025-01-17 15:18:11 -08:00
|
|
|
echo "UNIMPLEMENTED!"
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-21 14:25:05 -08:00
|
|
|
function clean_otel() {
|
2025-01-17 15:18:11 -08:00
|
|
|
rm -rf build
|
|
|
|
|
}
|