#!/bin/bash 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 } # The following functions are all run on a VM # Through an SSH connection. Make sure not to # use any external functions in them. function build_nginx() { 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 && \ make -j$(num_jobs) } function test_nginx() { TEST_NGINX_VERBOSE=1 \ TEST_NGINX_CATLOG=1 \ prove -vw -j$(num_jobs) . } function clean_nginx() { make clean } function build_otel() { mkdir -p build && \ cd build && \ cmake -DNGX_OTEL_NGINX_BUILD_DIR=../../nginx/objs .. && \ make -j$(num_jobs) } function test_otel() { echo "UNIMPLEMENTED!" } function clean_otel() { rm -rf build }