diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2122d96d9fe49ddbfa2d816eff52353ae958a03..0b59d7ed4dae42bf9e0795cbf3fbbd921d40c573 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,23 +5,43 @@ image: storm2/ngx-voms-build:latest stages: - build - test + - deploy -build: +build4c: stage: build script: - env - - sh ${HOME}/build-install-ngx-voms.sh + - sh ${HOME}/build-install-ngx-voms.sh -d -c - mv ${HOME}/local local + - mv ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6 nginx-1.13.6 artifacts: paths: - local + - nginx-1.13.6 -test: +test4c: stage: test dependencies: - - build + - build4c script: - rm -rf ${HOME}/local/ + - rm -rf ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6/ - mv local ${HOME} - #- mv -f local/* ${HOME}/local/ + - mv nginx-1.13.6 ${HOME}/openresty-1.13.6.1/build/ - sh test-ngx-voms.sh + - sh cov-ngx-voms.sh + - mv /tmp/coverage-report coverage + artifacts: + paths: + - coverage + +pages: + stage: deploy + dependencies: + - test4c + script: + - mv coverage/ public/ + artifacts: + paths: + - public + expire_in: 30 days diff --git a/README.md b/README.md index 9072439a5e3b69a337420ffcc64ac7d5a7ef221c..2106e5183472af39123b6b7cb6294f732e4540b3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ngx_http_voms_module +[](https://baltig.infn.it/storm2/ngx_http_voms_module/commits/master) + ## Description _ngx_http_voms_module_ is a module for the [Nginx web server](https://www.nginx.org/) that enables client-side authentication based on X.509 proxy certificates augmented with VOMS Attribute Certificates, typically obtained from a [Virtual Organization Membership Service](https://italiangrid.github.io/voms/) (VOMS) server. diff --git a/cov-ngx-voms.sh b/cov-ngx-voms.sh new file mode 100755 index 0000000000000000000000000000000000000000..a85276a80171a3cf1a5f25cff287f9ca5b81036f --- /dev/null +++ b/cov-ngx-voms.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright 2018 Istituto Nazionale di Fisica Nucleare +# +# Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the +# European Commission - subsequent versions of the EUPL (the "Licence"). You may +# not use this work except in compliance with the Licence. You may obtain a copy +# of the Licence at: +# +# https://joinup.ec.europa.eu/software/page/eupl +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the Licence is distributed on an "AS IS" basis, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# Licence for the specific language governing permissions and limitations under +# the Licence. + +# This script builds in debug mode and installs openresty together with the +# ngx_http_voms_module. +# +# The script requires the locations of the openresty bundle and of the +# ngx_http_voms_module code (for example as checked-out from git). The locations +# are expressed by the environment variables OPENRESTY_ROOT and +# NGX_HTTP_VOMS_MODULE_ROOT respectively, if available. If they are not set, +# they are guessed: +# * a unique openresty bundle is looked for in ${HOME} +# * the ngx_http_voms_module code is looked for in the working directory of the +# continuous integration environment first and then in ${HOME} +# +# The script works best (i.e. it is tested) if run within a docker container +# started from the storm2/ngx-voms-build image. + +#geninfo --base-directory ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6/objs/addon/src/ --output-filename coverage.info ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6/objs/addon/src/ +geninfo --output-filename /tmp/coverage.info ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6/objs/addon/src/ +genhtml --prefix ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6/objs/addon/src/ --ignore-errors source --demangle-cpp /tmp/coverage.info \ + --legend --title "coverage ngix" --output-directory=/tmp/coverage-report + +exit_status=$? +if [ ! $exit_status -eq 0 ]; then + echo "check output" +fi +echo $exit_status + diff --git a/t/README.md b/t/README.md index 6a10a30b59a52b81adcde478ba2a0fe8765cd789..ee40d5c57a9c935a48137af765d67b873edc5987 100644 --- a/t/README.md +++ b/t/README.md @@ -43,6 +43,9 @@ The above command generates data files aside the source files for all Nginx. To Then run the tests, e.g. with `prove`. This will create other data files with coverage information. To view that information, run `gcov <source of object file>`, e.g. `gcov /home/build/openresty-1.13.6.1/build/nginx-1.13.6/objs/addon/src/ngx_http_voms_module.o`. This will produce files with the ``.gcov`` extension in the current directory. + +Check result on [storm2 ngx_http_voms_module pages](https://storm2.baltig-pages.infn.it/ngx_http_voms_module/) + ### Testing directly the NGINX server You can reuse the config file `t/servroot/conf/nginx.conf` produced by `test::Nginx`, which contains e.g. something like diff --git a/test-ngx-voms.sh b/test-ngx-voms.sh index 48d20958b9e06cbefc60dd9e28dca56094a1c9ac..f52f4d32c8357f550604cbedd7cfe7ff67843eaa 100755 --- a/test-ngx-voms.sh +++ b/test-ngx-voms.sh @@ -41,5 +41,5 @@ if [ ! -d "${module_root}" ]; then exit 1 fi -mkdir /tmp/t +mkdir -p /tmp/t prove ${module_root}/t