Skip to content
Snippets Groups Projects
Commit 6763fd2f authored by lcappelli's avatar lcappelli
Browse files

Reorganize all file and project scope

Try to create two rpm, one for ngx with httpg patch, one for voms module
parent 366a92f2
No related branches found
No related tags found
No related merge requests found
stages: stages:
- build - build-ngx
- build-voms
- docker-build
upload-container: build-ngx-httpg-rpm:
stage: build stage: build-ngx
image: centos:7
script:
- env | sort
- cd && sh docker/library-scripts/provide-deps.sh
- sh rpm/build-httpg-nginx-rpm.sh
- mkdir ngx-artifacts
- cp rpmbuild/SRPMS/* ngx-artifacts/
- cp rpmbuild/RPMS/x86_64/* ngx-artifacts/
artifacts:
paths:
- ngx-artifacts/
build-voms-rpm:
stage: build-voms
image: centos:7
script:
- env | sort
- cd && sh docker/library-scripts/provide-deps.sh
- sh rpm/build-voms-rpm.sh
- mkdir voms-artifacts
- cp rpmbuild/SRPMS/* voms-artifacts/
- cp rpmbuild/RPMS/x86_64/* voms-artifacts/
artifacts:
paths:
- voms-artifacts/
build-container:
stage: docker-build
image: docker:latest image: docker:latest
services: services:
- name: docker:dind - name: docker:dind
command: ["--tls=false"] command: ["--tls=false"]
dependencies:
- build-ngx-httpg-rpm
- build-voms-rpm
script: script:
- env | sort
- apk add git bash - apk add git bash
- git clone https://baltig.infn.it/mw-devel/helper-scripts.git helper-scripts - git clone https://baltig.infn.it/mw-devel/helper-scripts.git helper-scripts
- cp helper-scripts/scripts/* /usr/local/bin - cp helper-scripts/scripts/* /usr/local/bin
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY} - cp ngx-artifacts/* ${CI_PROJECT_DIR}/docker/
- export DOCKER_REGISTRY_HOST=${CI_REGISTRY} - cp voms-artifacts/* ${CI_PROJECT_DIR}/docker/
- export DOCKER_REGISTRY_NAMESPACE=${CI_PROJECT_PATH}
- build-docker-image.sh && push-docker-image.sh
File moved
File moved
...@@ -13,13 +13,12 @@ COPY library-scripts/*.sh /tmp/library-scripts/ ...@@ -13,13 +13,12 @@ COPY library-scripts/*.sh /tmp/library-scripts/
RUN yum update -y && \ RUN yum update -y && \
sh /tmp/library-scripts/provide-deps.sh && \ sh /tmp/library-scripts/provide-deps.sh && \
sh /tmp/library-scripts/provide-user.sh ${USERNAME} ${USER_UID} ${USER_GID} && \ sh /tmp/library-scripts/provide-user.sh ${USERNAME} ${USER_UID} ${USER_GID} && \
mkdir /pkgs && \
yum clean all && rm -rf /var/cache/yum yum clean all && rm -rf /var/cache/yum
# install nginx with patch for HTTPG and voms module # install nginx with patch for HTTPG and voms module
COPY ngx-http-voms-module /ngx-http-voms-module COPY ngx-artifacts/*.rpm /pkgs/
COPY sources/* /tmp/sources/ COPY voms-artifacts/*.rpm /pkgs/
USER nginx
RUN sh /tmp/library-scripts/provide-ngx-httpg-voms.sh
# import test # import test
COPY t /home/nginx/t COPY t /home/nginx/t
......
...@@ -18,21 +18,10 @@ cd ~/rpmbuild/SOURCES/ ...@@ -18,21 +18,10 @@ cd ~/rpmbuild/SOURCES/
wget http://nginx.org/packages/centos/7/SRPMS/nginx-$ngxVersion-1.el7.ngx.src.rpm wget http://nginx.org/packages/centos/7/SRPMS/nginx-$ngxVersion-1.el7.ngx.src.rpm
rpm2cpio nginx-$ngxVersion-1.el7.ngx.src.rpm | cpio -idm rpm2cpio nginx-$ngxVersion-1.el7.ngx.src.rpm | cpio -idm
# set modules # set the nginx spec file with the httpg patch
wget -O ./ngx-http-echo-module.tar.gz https://github.com/openresty/echo-nginx-module/archive/refs/tags/v0.63.tar.gz cp ~/nginx-httpg_no_delegation.patch ${HOME}/rpmbuild/SOURCES/
tar xzf ngx-http-echo-module.tar.gz cp ~/rpm/nginx.spec ~/rpmbuild/SPECS
sudo mv /ngx-http-voms-module .
# use nginx spec file with the httpg patch and static modules # build rpm
cp /tmp/sources/nginx-httpg_no_delegation.patch ${HOME}/rpmbuild/SOURCES/
cp /tmp/sources/nginx.spec ~/rpmbuild/SPECS
# build and install rpm
rpmlint ~/rpmbuild/SPECS/nginx.spec rpmlint ~/rpmbuild/SPECS/nginx.spec
rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec
sudo rpm -ivh ~/rpmbuild/RPMS/x86_64/nginx-$ngxVersion-1.el7.ngx.x86_64.rpm
nginx -v
sudo chown -R nginx:nginx /var/cache/nginx
sudo chown -R nginx:nginx /var/log/nginx
sudo chown -R nginx:nginx /etc/nginx/
\ No newline at end of file
#!/usr/bin/env bash
# Copyright 2018-2022 Istituto Nazionale di Fisica Nucleare
# SPDX-License-Identifier: EUPL-1.2
set -ex
ngxVersion=1.22.1
# set environment to build rpm
rpmdev-setuptree
cat <<EOF > ${HOME}/.rpmmacros
%_topdir %{getenv:HOME}/rpmbuild
EOF
# set sources
cd ~/rpmbuild/SOURCES
wget -O nginx-$ngxVersion.tar.gz https://nginx.org/download/nginx-$ngxVersion.tar.gz
wget -O ./ngx-http-echo-module.tar.gz https://github.com/openresty/echo-nginx-module/archive/refs/tags/v0.63.tar.gz
tar xzf ngx-http-echo-module.tar.gz
# set voms modules sources
mkdir ngx-http-voms-module
cp ~/config ngx-http-voms-module/
cp ~/config.make ngx-http-voms-module/
cp -r ~/src ngx-http-voms-module/
cp ~/rpm/nginx-module-http-voms.spec ~/rpmbuild/SPECS
# build and install rpm
rpmlint ~/rpmbuild/SPECS/nginx-module-http-voms.spec
rpmbuild -ba ~/rpmbuild/SPECS/nginx-module-http-voms.spec
%define nginx_user nginx
%define nginx_group nginx
%define base_version 1.22.1
%define bdir %{_builddir}/%{name}-%{base_version}
Name: nginx-module-http-voms
Version: 1.22.1
Release: 1%{?dist}
Summary: nginx http voms dynamic modules
License: EUPL-1.2
URL: https://github.com/lauracappelli/nginx-sd-rpm
Source0: https://nginx.org/download/nginx-%{base_version}.tar.gz
Source1: ngx-http-voms-module
Source2: echo-nginx-module-0.63
BuildRequires: gcc, make
BuildRequires: voms-devel
BuildRequires: boost-devel
BuildRequires: openssl-devel
BuildRequires: zlib-devel
BuildRequires: pcre2-devel
Requires: nginx
Requires: zlib
Requires: openssl
Requires: pcre2
Requires: voms
%description
nginx http voms dynamic modules.
%prep
%setup -qcTn %{name}-%{base_version}
tar --strip-components=1 -zxf %{SOURCE0}
%define CONFIG_PATH %(echo "--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp")
%define CONFIG_ARGS %(echo "--user=nginx --group=nginx --with-compat --with-http_ssl_module")
%define MODULE_CONFIG_ARGS %(echo "--add-dynamic-module=%SOURCE1 --add-dynamic-module=%SOURCE2")
%build
cd %{bdir}
./configure %{CONFIG_PATH} %{CONFIG_ARGS} %{MODULE_CONFIG_ARGS}
make %{?_smp_mflags} modules
%install
cd %{bdir}
%{__rm} -rf $RPM_BUILD_ROOT
%{__mkdir} -p $RPM_BUILD_ROOT%{_libdir}/nginx/modules
for so in `find %{bdir}/objs/ -maxdepth 2 -type f -name "*.so"`; do
%{__install} -m755 $so \
$RPM_BUILD_ROOT%{_libdir}/nginx/modules/
done
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files
%{_libdir}/nginx/modules/*
%post
if [ $1 -eq 1 ]; then
cat <<BANNER
----------------------------------------------------------------------
The http voms dynamic modules for nginx have been installed.
To enable these modules, add the following to /etc/nginx/nginx.conf
and reload nginx:
load_module modules/ngx_http_voms_module.so;
load_module modules/ngx_http_echo_module.so;
Please refer to the modules documentation for further details:
https://baltig.infn.it/storm2/ngx_http_voms_module
----------------------------------------------------------------------
BANNER
fi
%changelog
* Fri Nov 18 2022 Laura Cappelli
- nginx http voms module updated to 1.22.1-1.0.0
\ No newline at end of file
...@@ -72,7 +72,7 @@ Requires(pre): shadow-utils ...@@ -72,7 +72,7 @@ Requires(pre): shadow-utils
%define WITH_CC_OPT $(echo %{optflags} $(pcre2-config --cflags)) -fPIC %define WITH_CC_OPT $(echo %{optflags} $(pcre2-config --cflags)) -fPIC
%define WITH_LD_OPT -Wl,-z,relro -Wl,-z,now -pie %define WITH_LD_OPT -Wl,-z,relro -Wl,-z,now -pie
%define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_sysconfdir}/nginx --sbin-path=%{_sbindir}/nginx --modules-path=%{_libdir}/nginx/modules --conf-path=%{_sysconfdir}/nginx/nginx.conf --error-log-path=%{_localstatedir}/log/nginx/error.log --http-log-path=%{_localstatedir}/log/nginx/access.log --pid-path=%{_localstatedir}/run/nginx.pid --lock-path=%{_localstatedir}/run/nginx.lock --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp --user=%{nginx_user} --group=%{nginx_group} --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --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-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --add-module=%SOURCE10 --add-module=%SOURCE11") %define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_sysconfdir}/nginx --sbin-path=%{_sbindir}/nginx --modules-path=%{_libdir}/nginx/modules --conf-path=%{_sysconfdir}/nginx/nginx.conf --error-log-path=%{_localstatedir}/log/nginx/error.log --http-log-path=%{_localstatedir}/log/nginx/access.log --pid-path=%{_localstatedir}/run/nginx.pid --lock-path=%{_localstatedir}/run/nginx.lock --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp --user=%{nginx_user} --group=%{nginx_group} --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --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-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module")
Summary: High performance web server Summary: High performance web server
Name: nginx Name: nginx
...@@ -92,8 +92,6 @@ Source6: nginx.suse.logrotate ...@@ -92,8 +92,6 @@ Source6: nginx.suse.logrotate
Source7: nginx-debug.service Source7: nginx-debug.service
Source8: nginx.copyright Source8: nginx.copyright
Source9: nginx.check-reload.sh Source9: nginx.check-reload.sh
Source10: echo-nginx-module-0.63
Source11: ngx-http-voms-module
Patch0: nginx-httpg_no_delegation.patch Patch0: nginx-httpg_no_delegation.patch
......
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