diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index b931f0ee..ad3287a3 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,25 +1,100 @@ -# Build ELOG with GCC 10.2 and latest -image: gcc:10.2 +# ELOG Application + +# This template allows you to validate your C++ application. +# The workflow allows running tests and code linting on the default branch. + + +image: gcc:latest + pipelines: default: - - step: - name: Build on GCC 10.2 - image: gcc:10.2 - script: - - apt-get update && apt-get install -y imagemagick cmake - - git submodule update --init - - mkdir build; cd build - - cmake .. - - make + - step: + name: Build run and test + image: gcc:latest + deployment: test + script: + # Execute your C++ application after compilation to check success + - apt-get -qq update && apt-get -y --force-yes -qq install cmake wget lsof + - git submodule update --init + # Add elog user + - groupadd -r elog + - useradd -d / -s /bin/false -g elog -M -r elog + # Build elog + - mkdir build; cd build + - cmake .. + - make + # Install in default /usr/local/elog + - echo "install in test environment" + - make install + # Start elogd + - echo "Start ELOG" + - /usr/local/sbin/elogd -v 3 -c /usr/local/elog/elogd.cfg 2>&1 & + - sleep 5 + - if [ -f /var/run/elogd.pid ]; then cat /var/run/elogd.pid ; fi + # Check open files + - lsof -p $(cat /var/run/elogd.pid) + # Test Web page + - echo "test web" + - sleep 3 + - wget http://localhost:8080 && true || false + - parallel: + steps: + - step: + name: Build on EL7 + image: dokken/centos-7 + # trigger: manual # Uncomment to make this a manual deployment. + script: + - echo "Deploying to test environment" + - yum -y update && yum -y install rpm-build gcc gcc-c++ git openssl-devel krb5-devel pam-devel openldap-devel csh + - git submodule update --init + # git clone https://bitbucket.org/ritt/elog --recursive + - ./buildrpm 3.1.5 $(date +%Y%m%d) -krb5 -ldap -pam -ssl + - mkdir RPMS + - find ~/rpmbuild/RPMS/ -name "*.rpm" -exec mv {} RPMS \; + - ls -l RPMS + artifacts: # defining the artifacts to be passed to each future step. + download: false # do not download artifacts in this step + paths: + - RPMS/*.rpm + - step: + name: Build on EL8 + image: dokken/centos-8 + # trigger: manual # Uncomment to make this a manual deployment. + script: + - echo "Deploying to test environment" + - yum -y update && yum -y install rpm-build gcc gcc-c++ git openssl-devel krb5-devel pam-devel openldap-devel csh + - git submodule update --init + # git clone https://bitbucket.org/ritt/elog --recursive + - ./buildrpm 3.1.5 $(date +%Y%m%d) -krb5 -ldap -pam -ssl + - mkdir RPMS + - find ~/rpmbuild/RPMS/ -name "*.rpm" -exec mv {} RPMS \; + - ls -l RPMS + artifacts: # defining the artifacts to be passed to each future step. + download: false # do not download artifacts in this step + paths: + - RPMS/*.rpm + - step: + name: Build on EL9 + image: dokken/centos-stream-9 + # trigger: manual # Uncomment to make this a manual deployment. + script: + - echo "Deploying to test environment" + - yum -y update && yum -y install rpm-build gcc gcc-c++ git openssl-devel krb5-devel pam-devel openldap-devel csh + - git submodule update --init + # git clone https://bitbucket.org/ritt/elog --recursive + - ./buildrpm 3.1.5 $(date +%Y%m%d) -krb5 -ldap -pam -ssl + - mkdir RPMS + - find ~/rpmbuild/RPMS/ -name "*.rpm" -exec mv {} RPMS \; + - ls -l RPMS + artifacts: # defining the artifacts to be passed to each future step. + download: false # do not download artifacts in this step + paths: + - RPMS/*.rpm + - step: # non-parallel step + name: Deployement + deployment: staging + script: + - echo "Deliver results" + - ls -l RPMS - - step: - name: Build on GCC latest - image: gcc:latest - script: - - gcc --version - - apt-get -qq update && apt-get -y --force-yes -qq install cmake - - git submodule update --init - - mkdir build; cd build - - cmake .. - - make diff --git a/elog.spec.template b/elog.spec.template index 0e7f8abf..a30dd67a 100644 --- a/elog.spec.template +++ b/elog.spec.template @@ -110,7 +110,11 @@ each weblog can be totally different from the rest. -g elog -M -r elog 2>/dev/null || : %build -make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS="$RPM_OPT_FLAGS -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-result -Imxml" +%if 0%{?rhel} == 7 + make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS="$RPM_OPT_FLAGS -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-result -Imxml -std=c++11" +%else + make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS="$RPM_OPT_FLAGS -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-result -Imxml" +%endif sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init %install