diff --git a/Jenkinsfile b/Jenkinsfile index 6313b51..645fd7c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,11 +67,11 @@ BUILD_DIR: 'target', GIT_CRED: 'bot-ci-dgm', DEPLOY_USER: 'root', - DEPLOY_HOST_STST: 'bxtsvctwas001.boxtel', - DEPLOY_HOST_ACC1: 'alasvctwas001.infra.qiy.nl', - DEPLOY_HOST_ACC2: 'alasvctwas002.infra.qiy.nl', - DEPLOY_HOST_PRD1: 'alpsvctwas001.infra.qiy.nl', - DEPLOY_HOST_PRD2: 'alpsvctwas002.infra.qiy.nl', + DEPLOY_HOST_STST: 'bxtsvctwas001.in.dolden.net', + DEPLOY_HOST_ACC1: 'bxtsvctwas003.in.dolden.net', + DEPLOY_HOST_ACC2: 'frksvctrpx301.in.dolden.net', + DEPLOY_HOST_PRD1: 'bxtsvctwas004.in.dolden.net', + DEPLOY_HOST_PRD2: 'sbgsvctrpx401.in.dolden.net', DEPLOY_DIR: '/var/www/html/public/dummy-jenkins-pl', DEPLOY_CRED: 'bot-ci-dgm-rsa', ], diff --git a/lazyDir/centos6.Dockerfile b/lazyDir/centos6.Dockerfile deleted file mode 100644 index 812089c..0000000 --- a/lazyDir/centos6.Dockerfile +++ /dev/null @@ -1,92 +0,0 @@ -# -# This work is protected under copyright law in the Kingdom of -# The Netherlands. The rules of the Berne Convention for the -# Protection of Literary and Artistic Works apply. -# Digital Me B.V. is the copyright owner. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Pull base image from official repo -FROM centos:centos6.10 - -# Import local GPG keys and enable epel repo -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 && \ - yum -q clean expire-cache && \ - yum -q makecache && \ - yum -y install --setopt=tsflags=nodocs \ - epel-release \ - && \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 && \ - yum -q -y clean all --enablerepo='*' - -# Install common requirements -RUN yum -q clean expire-cache && \ - yum -q makecache && \ - yum -y install --setopt=tsflags=nodocs \ - git \ - unzip \ - wget \ - which \ - && \ - yum -q -y clean all --enablerepo='*' - -# Enable Software Collections -RUN yum -q clean expire-cache && \ - yum -q makecache && \ - yum -y install --setopt=tsflags=nodocs \ - centos-release-scl \ - scl-utils-build \ - && \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo && \ - yum -q -y clean all --enablerepo='*' - -# Import extra GPG keys -RUN rpm --import http://yum.puppetlabs.com/RPM-GPG-KEY-puppet && \ - rpm --import http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs && \ - rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB - -# Add internal CA -RUN wget -q https://share.qiy.nl/public/certs/ca-digital-me-private-2026.crt -O /etc/pki/ca-trust/source/anchors/ca-digital-me-internal.pem && \ - update-ca-trust force-enable && \ - update-ca-trust extract - -# Configure global Yum repos -RUN rm -rf /var/cache/yum/* && \ - rm -f /etc/yum.repos.d/*.repo && \ - echo '[all]' > /etc/yum.repos.d/all.repo && \ - echo 'name=Private - centos6-x86_64 - All' >> /etc/yum.repos.d/all.repo && \ - echo 'baseurl=https://mrepo.boxtel/mrepo/testci/centos6-x86_64/RPMS.all' >> /etc/yum.repos.d/all.repo && \ - echo 'enabled=1' >> /etc/yum.repos.d/all.repo - -# Install something and its requirements -#RUN yum -q clean expire-cache && \ -# yum -q makecache && \ -# yum -y install --setopt=tsflags=nodocs \ -# ... -# && \ -# yum -q -y clean all --enablerepo='*' - -# Add a dummy user -ARG uid=1000 -ARG user=dummy -ARG gid=1000 -ARG group=dummy - -# Add or modify user and group for build and runtime (convenient) -RUN id ${user} > /dev/null 2>&1 && \ - { groupmod -g "${gid}" "${group}" && usermod -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } || \ - { groupadd -g "${gid}" "${group}" && useradd -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } - -# Get script directory from lazyLib -ARG dir=. diff --git a/lazyDir/centos7.Dockerfile b/lazyDir/centos7.Dockerfile index 343f350..e0e76ca 100644 --- a/lazyDir/centos7.Dockerfile +++ b/lazyDir/centos7.Dockerfile @@ -17,12 +17,16 @@ # limitations under the License. # +############################## +# General level requirements # +############################## + # Pull base image from official repo -FROM centos:centos7.8.2003 +FROM centos:centos7.9.2009 # Import local GPG keys and enable epel repo RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - yum -q clean expire-cache && \ + yum -q clean all && \ yum -q makecache && \ yum -y install --setopt=tsflags=nodocs \ epel-release \ @@ -31,53 +35,74 @@ yum -q -y clean all --enablerepo='*' # Install common requirements -RUN yum -q clean expire-cache && \ +RUN INSTALL_PKGS="git unzip wget which" && \ + yum -q clean expire-cache && \ yum -q makecache && \ - yum -y install --setopt=tsflags=nodocs \ - git \ - unzip \ - wget \ - which \ - && \ + yum -y install --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ yum -q -y clean all --enablerepo='*' -# Enable Software Collections +# Prepare locales +ARG locale=en_US.UTF-8 +ENV LANG "${locale}" +ENV LC_ALL "${locale}" + +# Configure desired timezone +ENV TZ=Europe/Amsterdam +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone + +############################### +# Enable Software Collections # +############################### + +# Add repos, keys and tools RUN yum -q clean expire-cache && \ yum -q makecache && \ yum -y install --setopt=tsflags=nodocs \ centos-release-scl \ - scl-utils-build \ + scl-utils \ && \ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo && \ yum -q -y clean all --enablerepo='*' -# Import extra GPG keys -RUN rpm --import http://yum.puppetlabs.com/RPM-GPG-KEY-puppet && \ - rpm --import http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs && \ - rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB +# Enable SCLs for any later bash session +COPY scl_enable.sh /usr/local/bin/scl_enable +ENV BASH_ENV="/usr/local/bin/scl_enable" \ + ENV="/usr/local/bin/scl_enable" \ + PROMPT_COMMAND=". /usr/local/bin/scl_enable" + +################################## +# Application level requirements # +################################## + +# Update to some specific versions +RUN INSTALL_PKGS="ca-certificates-2021.2.50-72.el7_9" && \ + yum -q clean expire-cache && \ + yum -q makecache && \ + yum -y install --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + yum -q -y clean all --enablerepo='*' # Add internal CA -RUN wget -q https://share.qiy.nl/public/certs/ca-digital-me-private-2026.crt -O /etc/pki/ca-trust/source/anchors/ca-digital-me-internal.pem && \ +RUN wget -q https://share.dolden.net/public/certs/ca-dolden-root.crt \ +-O /etc/pki/ca-trust/source/anchors/ca-dolden-root.pem && \ update-ca-trust force-enable && \ - update-ca-trust extract - -# Configure global Yum repos -RUN rm -rf /var/cache/yum/* && \ - rm -f /etc/yum.repos.d/*.repo && \ - echo '[all]' > /etc/yum.repos.d/all.repo && \ - echo 'name=Private - centos7-x86_64 - All' >> /etc/yum.repos.d/all.repo && \ - echo 'baseurl=https://mrepo.boxtel/mrepo/testci/centos7-x86_64/RPMS.all' >> /etc/yum.repos.d/all.repo && \ - echo 'enabled=1' >> /etc/yum.repos.d/all.repo + update-ca-trust extract # Install something and its requirements -#RUN yum -q clean expire-cache && \ +#RUN INSTALL_PKGS="xxx" && \ +# yum -q clean expire-cache && \ # yum -q makecache && \ -# yum -y install --setopt=tsflags=nodocs \ -# ... -# && \ +# yum -y install --setopt=tsflags=nodocs $INSTALL_PKGS && \ +# rpm -V $INSTALL_PKGS && \ # yum -q -y clean all --enablerepo='*' -# Add a dummy user +########################### +# User level requirements # +########################### + +# Parameters for default user:group ARG uid=1000 ARG user=dummy ARG gid=1000 diff --git a/lazyDir/scl_enable.sh b/lazyDir/scl_enable.sh new file mode 100755 index 0000000..fe24391 --- /dev/null +++ b/lazyDir/scl_enable.sh @@ -0,0 +1,24 @@ +# Make sure home bin directory is in PATH +if ! [[ "${PATH}" =~ "${HOME}/bin" ]]; then + export PATH="${HOME}/bin:${PATH}" +fi + +# Store current debug flag status +WAS_TRACE=0 +if [[ ${SHELLOPTS} =~ xtrace ]]; then + WAS_TRACE=1 +fi + +# Activate all Software Collections - if any +test -x /usr/bin/scl || { echo "ERROR: scl util not available"; exit 1; } +OIFS=$IFS +IFS=$'\n' +SCLS=($(scl --list)) +if [ ${#SCLS[@]} -ne 0 ]; then + test $WAS_TRACE -eq 0 || set +x + source scl_source enable "${SCLS[@]}" + test $WAS_TRACE -eq 0 || set -x +fi +IFS=$OIFS + +unset BASH_ENV PROMPT_COMMAND ENV diff --git a/lazyDir/ubuntu16.Dockerfile b/lazyDir/ubuntu16.Dockerfile index 6a49ea1..0f250f0 100644 --- a/lazyDir/ubuntu16.Dockerfile +++ b/lazyDir/ubuntu16.Dockerfile @@ -17,24 +17,44 @@ # limitations under the License. # +############################## +# General level requirements # +############################## + # Pull base image from official repo FROM ubuntu:16.04 -# Install all current updates -RUN apt-get -y update && \ - apt-get -y dist-upgrade && \ - apt-get clean - # Install common requirements -RUN apt-get -y update && \ - apt-get -y install \ - git \ - unzip \ - wget \ - && \ - apt-get clean +RUN INSTALL_PKGS="git unzip wget" && \ + apt-get -y update && \ + apt-get -y install $INSTALL_PKGS && \ + apt-get clean -# Add user to build and package +# Prepare locales +ARG locale=en_US.UTF-8 +ENV LANG "${locale}" +ENV LC_ALL "${locale}" + +# Configure desired timezone +ENV TZ=Europe/Amsterdam +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone + +################################## +# Application level requirements # +################################## + +# Install something and its requirements# Add user to build and package +#RUN INSTALL_PKGS="xxx" && \ +# apt-get -y update && \ +# apt-get -y install $INSTALL_PKGS && \ +# apt-get clean + +########################### +# User level requirements # +########################### + +# Parameters for default user:group ARG uid=1000 ARG user=dummy ARG gid=1000