Skip to content
Snippets Groups Projects
Commit 44cbc077 authored by Andrea Ceccanti's avatar Andrea Ceccanti
Browse files

Merge branch 'issue-7' into 'master'

See merge request !1
parents 83ccbfc1 9d376f33
Branches issue-17
No related tags found
1 merge request!1Issue 7
Pipeline #31345 passed
......@@ -6,6 +6,7 @@ before_script:
- apk add git bash
- git clone https://baltig.infn.it/mw-devel/helper-scripts.git helper-scripts
- cp helper-scripts/scripts/* /usr/local/bin
- ls -al /usr/local/bin
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- export DOCKER_REGISTRY_HOST=${CI_REGISTRY}
- export DOCKER_REGISTRY_NAMESPACE=${CI_PROJECT_PATH}
......@@ -18,6 +19,8 @@ build:
stage: build
script:
- env | sort
- ls -al /usr/local/bin
- ls -l `which sh`
- cd docker && sh build-images.sh && sh push-images.sh
push-to-dockerhub:
......
#!/bin/sh
#!/bin/bash
set -e
S2_IMAGES=${S2_IMAGES:-"base build clients ngx-voms-build ts"}
......
......@@ -39,6 +39,7 @@ usage()
echo "OPTIONS"
echo ""
echo "-h|--help"
echo "-o|--opt-log to enable the --with-debug option and the optimization level -O2"
echo "-d|--debug to enable the --with-debug option and the optimization level -O0"
echo "-c|--coverage to add the --coverage option to the --with-{ld|cc}-opt option and enable the debug options"
echo ""
......@@ -50,12 +51,17 @@ usage()
cc1=-g
debug=""
cc3=""
cc2=-O3
cc2=-O2
ld=""
while [ "$1" != "" ]; do
option=`echo $1 | awk -F= '{print $1}'`
case $option in
-o|--opt-log)
debug='--with-debug'
cc2=-O2
echo Enabled the debug option $debug and the optimization level $cc2
;;
-d|--debug)
debug='--with-debug'
cc2=-O0
......@@ -73,7 +79,7 @@ while [ "$1" != "" ]; do
*)
debug=""
cc3=""
cc2=-O3
cc2=-O2
ld=""
;;
esac
......@@ -108,13 +114,22 @@ if [ ! -d "${module_root}" ]; then
exit 1
fi
RESTY_PACKAGES_PREFIX=/usr/local/openresty
ZLIB_PREFIX=/usr
OPENSSL_PREFIX=/usr
PCRE_PREFIX=/usr
cd ${openresty_root}
./configure ${RESTY_CONFIG_OPTIONS} \
${debug} \
--with-cc-opt="${cc1} ${cc2} ${cc3}" \
${ld} \
--add-module=${module_root}
./configure \
--with-cc="ccache gcc -fdiagnostics-color=always" \
--with-cc-opt="-DNGX_LUA_ABORT_AT_PANIC -I${ZLIB_PREFIX}/include -I${PCRE_PREFIX}/include -I${OPENSSL_PREFIX}/include" \
--with-ld-opt="-L${ZLIB_PREFIX}/lib -L${PCRE_PREFIX}/lib -L${OPENSSL_PREFIX}/lib -Wl,-rpath,${ZLIB_PREFIX}/lib:${PCRE_PREFIX}/lib:${OPENSSL_PREFIX}/lib" \
--with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
${RESTY_CONFIG_OPTIONS} \
${debug} \
--with-cc-opt="${cc1} ${cc2} ${cc3}" \
${ld} \
--add-module=${module_root}
nginx_version=$(find build -name nginx.h | xargs awk '/define NGINX_VERSION/ {print $3}' | tr -d '"')
cd build/nginx-${nginx_version}
......
......@@ -4,37 +4,34 @@ set -ex
# adapted from https://github.com/openresty/docker-openresty
# Docker Build Arguments
RESTY_VERSION=${RESTY_VERSION:-"1.13.6.1"}
RESTY_VERSION=${RESTY_VERSION:-"1.15.8.1"}
RESTY_PREFIX=${HOME}/local/openresty
RESTY_CONFIG_OPTIONS="\
--with-file-aio \
--with-pcre-jit \
--without-http_rds_json_module \
--without-http_rds_csv_module \
--without-lua_rds_parser \
--with-stream \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-http_v2_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_secure_link_module \
--with-http_random_index_module \
--with-http_gzip_static_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_geoip_module=dynamic \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_image_filter_module=dynamic \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-http_xslt_module=dynamic \
--with-ipv6 \
--with-mail \
--with-mail_ssl_module \
--with-md5-asm \
--with-pcre-jit \
--with-sha1-asm \
--with-stream \
--with-stream_ssl_module \
--with-http_gunzip_module \
--with-threads \
--with-dtrace-probes \
--prefix=${RESTY_PREFIX} \
"
......@@ -44,19 +41,19 @@ RESTY_CONFIG_OPTIONS="\
sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
# get zlib, openssl and pcre from the openresty repository
sudo yum -y install \
GeoIP-devel \
gd-devel \
gettext \
ccache \
libxslt-devel \
lcov \
openssl-devel \
perl-ExtUtils-Embed \
perl-Test-Nginx \
pcre-devel \
readline-devel \
voms-devel \
zlib-devel
voms-devel
# 2) Download, unpack, configure, build and install OpenResty
......@@ -66,10 +63,23 @@ sudo yum -y install \
# configuring has the benefit that it builds and installs luajit, which
# can then be reused during development (see the additions to .bashrc)
RESTY_PACKAGES_PREFIX=/usr/local/openresty
ZLIB_PREFIX=/usr
OPENSSL_PREFIX=/usr
PCRE_PREFIX=/usr
#ZLIB_PREFIX=${RESTY_PACKAGES_PREFIX}/zlib
#OPENSSL_PREFIX=${RESTY_PACKAGES_PREFIX}/openssl
#PCRE_PREFIX=${RESTY_PACKAGES_PREFIX}/pcre
wget https://openresty.org/download/openresty-${RESTY_VERSION}.tar.gz
tar zxf openresty-${RESTY_VERSION}.tar.gz
cd openresty-${RESTY_VERSION}
./configure ${RESTY_CONFIG_OPTIONS}
./configure \
--with-cc="ccache gcc -fdiagnostics-color=always" \
--with-cc-opt="-DNGX_LUA_ABORT_AT_PANIC -I${ZLIB_PREFIX}/include -I${PCRE_PREFIX}/include -I${OPENSSL_PREFIX}/include" \
--with-ld-opt="-L${ZLIB_PREFIX}/lib -L${PCRE_PREFIX}/lib -L${OPENSSL_PREFIX}/lib -Wl,-rpath,${ZLIB_PREFIX}/lib:${PCRE_PREFIX}/lib:${OPENSSL_PREFIX}/lib" \
--with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
${RESTY_CONFIG_OPTIONS}
make
make install
cd -
......@@ -80,6 +90,12 @@ cd -
cat << EOF >> ${HOME}/openresty-env
PATH="${RESTY_PREFIX}/luajit/bin:${RESTY_PREFIX}/nginx/sbin:${RESTY_PREFIX}/bin:\${PATH}"
RESTY_PACKAGES_PREFIX=/usr/local/openresty
ZLIB_PREFIX=/usr
OPENSSL_PREFIX=/usr
PCRE_PREFIX=/usr
export RESTY_CONFIG_OPTIONS="${RESTY_CONFIG_OPTIONS} --with-luajit=${RESTY_PREFIX}/luajit"
EOF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment