vagrant, docker and remote test small changes

This commit is contained in:
Olof Hagsand 2020-07-23 17:23:08 +00:00
parent 316cad35ff
commit 57d7587d9a
4 changed files with 36 additions and 7 deletions

View file

@ -75,7 +75,7 @@ push:
# Note tests will kill the daemons started in the start scrips # Note tests will kill the daemons started in the start scrips
test: docker test: docker
./cleanup.sh ; PORT=8080 ./start.sh # kill (ignore error) and the start it ./cleanup.sh ; PORT=8080 ./start.sh # kill (ignore error) and the start it
sudo docker exec -it clixon-system bash -c 'cd /usr/local/bin/test && ./all.sh' sudo docker exec -t clixon-system bash -c 'cd /usr/local/bin/test && ./all.sh'
depend: depend:

View file

@ -40,6 +40,7 @@ SHELL = /bin/sh
.PHONY: all clean distclean depend install uninstall .PHONY: all clean distclean depend install uninstall
# Optional specific LOGDIR, eg "LOGDIR=/var/log make"
# Include "site.mk" file if it exists and define the HOSTS variables # Include "site.mk" file if it exists and define the HOSTS variables
# eg : # eg :
@ -54,7 +55,11 @@ all: $(HOSTS)
# Real hosts reachable by ssh # Real hosts reachable by ssh
$(HOSTS): $(HOSTS):
./cicd.sh $@ 2>&1 | tee $@.log ifdef LOGDIR
./cicd.sh $@ 2>&1 > $(LOGDIR)/$@.log
else
./cicd.sh $@ 2>&1 | tee /$@.log
endif
clean: clean:
rm -f *.log rm -f *.log

View file

@ -40,6 +40,7 @@ SHELL = /bin/sh
.PHONY: all clean distclean depend install uninstall .PHONY: all clean distclean depend install uninstall
# Optional specific LOGDIR, eg "LOGDIR=/var/log make"
# The "site.mk" file if it exists and define the VAGRANTS variables # The "site.mk" file if it exists and define the VAGRANTS variables
# eg: # eg:
@ -59,7 +60,11 @@ logs:
# Local vagrant hosts eg generic/centos8. The vagrantdir is a subdirectory and logs will # Local vagrant hosts eg generic/centos8. The vagrantdir is a subdirectory and logs will
# appear eg as generic/centos8.log # appear eg as generic/centos8.log
$(VAGRANTS): logs $(VAGRANTS): logs
ifdef LOGDIR
./vagrant.sh $@ 2>&1 > "$(LOGDIR)/$(subst /,-,$@).log"
else
./vagrant.sh $@ 2>&1 | tee "logs/$(subst /,-,$@).log" ./vagrant.sh $@ 2>&1 | tee "logs/$(subst /,-,$@).log"
endif
destroy: destroy:
for i in $(VAGRANTS) ; \ for i in $(VAGRANTS) ; \

View file

@ -96,6 +96,7 @@ system=$($sshcmd uname) # we use the release "hack" instead
# Some release have packages, some need to be built from source # Some release have packages, some need to be built from source
buildfcgi=false buildfcgi=false
buildevhtp=false buildevhtp=false
buildcmake=false # Some releases (eg centos/7) has too old cmake to build libevhtp
case $release in case $release in
openbsd) openbsd)
# packages for building # packages for building
@ -154,7 +155,8 @@ case $release in
evhtp) evhtp)
$sshcmd sudo yum install -y libevent openssl $sshcmd sudo yum install -y libevent openssl
buildevhtp=true buildevhtp=true
$sshcmd sudo yum install -y libevent-devel cmake openssl-devel buildcmake=true # Actually, only necessary on centos/7
$sshcmd sudo yum install -y libevent-devel openssl-devel
;; ;;
esac esac
;; ;;
@ -249,12 +251,29 @@ case ${with_restconf} in
. ./nginx.sh $dir $idfile $port $wwwuser . ./nginx.sh $dir $idfile $port $wwwuser
;; ;;
evhtp) evhtp)
if $buildcmake; then
$sshcmd "test -d cmake || sudo git clone https://gitlab.kitware.com/cmake/cmake.git"
$sshcmd "(cd cmake; sudo ./bootstrap)"
$sshcmd "(cd cmake; sudo make)"
$sshcmd "(cd cmake; sudo make install)"
fi
if $buildevhtp; then if $buildevhtp; then
if true; then
$sshcmd << 'EOF'
test -d libevhtp || sudo git clone https://github.com/criticalstack/libevhtp.git
cd libevhtp/build;
CMAKE=$(which cmake)
sudo $CMAKE -DEVHTP_DISABLE_REGEX=ON -DEVHTP_DISABLE_EVTHR=ON ..
sudo make
sudo make install
EOF
else
$sshcmd "test -d libevhtp || sudo git clone https://github.com/criticalstack/libevhtp.git" $sshcmd "test -d libevhtp || sudo git clone https://github.com/criticalstack/libevhtp.git"
$sshcmd "(cd libevhtp/build; sudo cmake -DEVHTP_DISABLE_REGEX=ON -DEVHTP_DISABLE_EVTHR=ON ..)" $sshcmd "(cd libevhtp/build; sudo /usr/local/bin/cmake -DEVHTP_DISABLE_REGEX=ON -DEVHTP_DISABLE_EVTHR=ON ..)"
$sshcmd "(cd libevhtp/build; sudo make)" $sshcmd "(cd libevhtp/build; sudo make)"
$sshcmd "(cd libevhtp/build; sudo make install)" $sshcmd "(cd libevhtp/build; sudo make install)"
fi fi
fi
;; ;;
esac esac