diff --git a/Jenkinsfile b/Jenkinsfile index 0053233..e9bba0b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,7 +61,7 @@ // Initialize lazyConfig for this pipeline lazyConfig( - name: 'DummyAnd', + name: 'dummy-and', env: [ RELEASE: false, ], noIndex: '(.+_.+|acceptance|production)', // Avoid automatic indexing for release and private branches ) @@ -82,6 +82,7 @@ sh("git checkout ${lazyConfig['branch']}") fastLane('android', 'test') }, + in: [ 'centos7' ], on: 'android', ] } @@ -97,6 +98,7 @@ post: { archiveArtifacts(artifacts: "${buildDir}/**", allowEmptyArchive: false) }, + in: [ 'centos7' ], on: 'android', ] } @@ -145,6 +147,7 @@ gitPush(remote, workingBranch) }) }, + in: [ 'centos7' ], on: 'android', ] } @@ -163,6 +166,7 @@ fastLane('android', 'alpha') } }, + in: [ 'centos7' ], on: 'android', ] } @@ -180,6 +184,7 @@ fastLane('android', 'beta') } }, + in: [ 'centos7' ], on: 'android', ] } @@ -197,6 +202,7 @@ fastLane('android', 'beta_crash', "fl_branch:\"${lazyConfig['branch']}\"") } }, + in: [ 'centos7' ], on: 'android', ] } @@ -214,6 +220,7 @@ fastLane('android', 'production') } }, + in: [ 'centos7' ], on: 'android', ] } diff --git a/lazyDir/centos7.Dockerfile b/lazyDir/centos7.Dockerfile new file mode 100644 index 0000000..36f290f --- /dev/null +++ b/lazyDir/centos7.Dockerfile @@ -0,0 +1,99 @@ +# +# 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:centos7.7.1908 + +# Import required GPG keys +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 \ + && rpm --import http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 \ + && 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 epel repo and Install all current updates +RUN yum -q -y update \ + && yum -y install epel-release \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 \ + && yum -y upgrade \ + && yum -q clean all + +# Install common requirements +RUN yum -q -y update \ + && yum -y install \ + git \ + wget \ + unzip \ + which \ + && yum -q clean all + +# Install Ruby 2.4 from SCLO repo +RUN yum -q clean expire-cache \ + && yum -y install centos-release-scl scl-utils-build \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo \ + && yum -y install \ + rh-ruby24-ruby \ + rh-ruby24-ruby-libs \ + rh-ruby24-ruby-devel \ + rh-ruby24-rubygems \ + rh-ruby24-rubygem-bundler \ + && yum -q clean packages + +# Install extra dev tools +RUN yum -q clean expire-cache \ + && yum -y install epel-release \ + && yum -y install \ + gcc \ + gcc-c++ \ + make \ + nodejs \ + zlib-devel \ + && yum -q clean packages + +# Parameters for default user:group +ARG uid=1000 +ARG user=android +ARG gid=1000 +ARG group=android + +# Add user to build +RUN groupadd -g "${gid}" "${group}" && useradd -ms /bin/bash -g "${group}" -u "${uid}" "${user}" + +# Copy and install requirements +COPY "Gemfile" "/home/${user}/Gemfile" +COPY "Gemfile.lock" "/home/${user}/Gemfile.lock" +RUN chown "${user}:${group}" "/home/${user}/Gemfile"* +RUN su - "${user}" -c 'scl enable rh-ruby24 "bundler install"' + +# Enable Ruby 2.4 for any later bash session +RUN echo "#!/bin/bash" > "/usr/local/bin/withruby" \ + && echo "export PATH=\$PATH:/home/${user}/bin" >> "/usr/local/bin/withruby" \ + && echo "source scl_source enable rh-ruby24" >> "/usr/local/bin/withruby" \ + && echo 'exec "$@"' >> "/usr/local/bin/withruby" \ + && chmod 0755 "/usr/local/bin/withruby" + +# Prepare locales (for Jekyll) +ARG locale=en_US.UTF-8 +ENV LANG "${locale}" +ENV LC_ALL "${locale}" + +ENTRYPOINT [ "/usr/local/bin/withruby" ] + +# Get script directory from lazyLib at last to avoid warning w/o invalidating the cache +ARG dir=.