Skip to content

Commit

Permalink
test: Tweak common.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jajik committed Jul 17, 2023
1 parent b200693 commit 412b08e
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions test/includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,26 @@ function run_test() {
#####################################################
# create httpd container
httpd_create() {
docker build -t $HTTPD_IMG httpd/
# docker push $HTTPD_IMG
}

# Build and run httpd container
httpd_run() {
# if httpd is already running for some reason, end it
httpd_shutdown || true
if [ $DEBUG ]; then
echo "httpd mod_proxy_cluster image config:"
echo " SOURCES: ${MPC_SOURCES:-https://github.com/modcluster/mod_proxy_cluster}"
echo " BRANCH: ${MPC_BRANCH:-main}"
echo " CONF: ${MPC_CONF:-https://github.com/modcluster/mod_proxy_cluster/blob/main/test/native/httpd/mod_proxy_cluster.conf}"
echo "You can config those with envars MPC_SOURCES, MPC_BRANCH, MPC_CONF respectively"
fi
docker build -t $HTTPD_IMG \
-e SOURCES=${MPC_SOURCES:-https://github.com/modcluster/mod_proxy_cluster} \
-e BRANCH=${MPC_BRANCH:-main} \
-e CONF=${MPC_CONF:-https://github.com/modcluster/mod_proxy_cluster/blob/main/test/native/httpd/mod_proxy_cluster.conf} \
httpd/
}

# Build and run httpd container
httpd_run() {
# if httpd is already running for some reason, end it
httpd_shutdown || true
docker run -d --network=host --name httpd-mod_proxy_cluster $HTTPD_IMG
docker run -d --network=host --name httpd-mod_proxy_cluster \
-e SOURCES=${MPC_SOURCES:-https://github.com/modcluster/mod_proxy_cluster} \
-e BRANCH=${MPC_BRANCH:-main} \
-e CONF=${MPC_CONF:-https://raw.githubusercontent.com/modcluster/mod_proxy_cluster/main/test/httpd/mod_proxy_cluster.conf} \
$HTTPD_IMG
httpd_wait_until_ready
}

Expand Down Expand Up @@ -99,6 +100,11 @@ clean_and_exit() {
#####################################################
### T O M C A T H E L P E R F U N C T I O N S ###
#####################################################
tomcat_create() {
docker build . -t $IMG
# docker push $IMG
}

# Start tomcat$1 container on 127.0.0.$2
# or 127.0.0.$1 if $2 is not given
tomcat_start() {
Expand Down

0 comments on commit 412b08e

Please sign in to comment.