diff --git a/Gemfile b/Gemfile deleted file mode 100644 index aaa580d..0000000 --- a/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -source "https://rubygems.org" -ruby RUBY_VERSION - -gem "fastlane" - -plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') -eval(File.read(plugins_path), binding) if File.exist?(plugins_path) diff --git a/Gemfile b/Gemfile new file mode 120000 index 0000000..d772330 --- /dev/null +++ b/Gemfile @@ -0,0 +1 @@ +lazyDir/Gemfile \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index a1525e0..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,151 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.0) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - atomos (0.1.3) - babosa (1.0.2) - claide (1.0.2) - colored (1.2) - colored2 (3.1.2) - commander-fastlane (4.4.6) - highline (~> 1.7.2) - declarative (0.0.10) - declarative-option (0.1.0) - domain_name (0.5.20180417) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.5.0) - emoji_regex (0.1.1) - excon (0.62.0) - faraday (0.15.3) - multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) - http-cookie (~> 1.0.0) - faraday_middleware (0.12.2) - faraday (>= 0.7.4, < 1.0) - fastimage (2.1.4) - fastlane (2.107.0) - CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.3, < 3.0.0) - babosa (>= 1.0.2, < 2.0.0) - bundler (>= 1.12.0, < 2.0.0) - colored - commander-fastlane (>= 4.4.6, < 5.0.0) - dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (~> 0.1) - excon (>= 0.45.0, < 1.0.0) - faraday (~> 0.9) - faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 0.9) - fastimage (>= 2.1.0, < 3.0.0) - gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.21.2, < 0.24.0) - highline (>= 1.7.2, < 2.0.0) - json (< 3.0.0) - mini_magick (~> 4.5.1) - multi_json - multi_xml (~> 0.5) - multipart-post (~> 2.0.0) - plist (>= 3.1.0, < 4.0.0) - public_suffix (~> 2.0.0) - rubyzip (>= 1.2.2, < 2.0.0) - security (= 0.1.3) - simctl (~> 1.6.3) - slack-notifier (>= 2.0.0, < 3.0.0) - terminal-notifier (>= 1.6.2, < 2.0.0) - terminal-table (>= 1.4.5, < 2.0.0) - tty-screen (>= 0.6.3, < 1.0.0) - tty-spinner (>= 0.8.0, < 1.0.0) - word_wrap (~> 1.0.0) - xcodeproj (>= 1.6.0, < 2.0.0) - xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) - gh_inspector (1.1.3) - google-api-client (0.23.9) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.5, < 0.7.0) - httpclient (>= 2.8.1, < 3.0) - mime-types (~> 3.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.0) - signet (~> 0.9) - googleauth (0.6.7) - faraday (~> 0.12) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (~> 0.7) - highline (1.7.10) - http-cookie (1.0.3) - domain_name (~> 0.5) - httpclient (2.8.3) - json (2.1.0) - jwt (1.5.6) - memoist (0.16.0) - mime-types (3.2.2) - mime-types-data (~> 3.2015) - mime-types-data (3.2018.0812) - mini_magick (4.5.1) - multi_json (1.13.1) - multi_xml (0.6.0) - multipart-post (2.0.0) - nanaimo (0.2.6) - naturally (2.2.0) - os (1.0.0) - plist (3.4.0) - public_suffix (2.0.5) - representable (3.0.4) - declarative (< 0.1.0) - declarative-option (< 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rouge (2.0.7) - rubyzip (1.2.2) - security (0.1.3) - signet (0.11.0) - addressable (~> 2.3) - faraday (~> 0.9) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.5) - CFPropertyList - naturally - slack-notifier (2.3.2) - terminal-notifier (1.8.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - tty-cursor (0.6.0) - tty-screen (0.6.5) - tty-spinner (0.8.0) - tty-cursor (>= 0.5.0) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.5) - unicode-display_width (1.4.0) - word_wrap (1.0.0) - xcodeproj (1.7.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.2.6) - xcpretty (0.3.0) - rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.0) - xcpretty (~> 0.2, >= 0.0.7) - -PLATFORMS - ruby - -DEPENDENCIES - fastlane - -RUBY VERSION - ruby 2.3.3p222 - -BUNDLED WITH - 1.15.4 diff --git a/Gemfile.lock b/Gemfile.lock new file mode 120000 index 0000000..af9906d --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1 @@ +lazyDir/Gemfile.lock \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 0053233..57269aa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,9 +61,14 @@ // Initialize lazyConfig for this pipeline lazyConfig( - name: 'DummyAnd', - env: [ RELEASE: false, ], - noIndex: '(.+_.+|acceptance|production)', // Avoid automatic indexing for release and private branches + name: 'dummy-and', + env: [ + RELEASE: true, + JAVA_HOME: '/usr/java/latest', + ANDROID_HOME: '/opt/android/sdk', + GRADLE_USER_HOME: '/opt/android/gradle', + ], + noIndex: '(.+_.+|production)', // Avoid automatic indexing for release and private branches ) // Define lazyStages @@ -71,7 +76,7 @@ name = 'validate' onlyif = (! deployBranches.contains(lazyConfig['branch']) ) tasks = [ - run: { + pre: { def currentVersion = androidVersion() currentBuild.displayName = "#${env.BUILD_NUMBER} ${currentVersion.string}-${currentVersion.number}" // Try to see if we can still merge the deploy branches @@ -80,24 +85,39 @@ } // Go back to working branch for validation sh("git checkout ${lazyConfig['branch']}") - fastLane('android', 'test') }, - on: 'android', + run: { + fastLane('android', 'test', '', 'rh-ruby24') + }, + args: "-v /opt/android:/opt/android" + + " -e JAVA_HOME=${env.JAVA_HOME}" + + " -e ANDROID_HOME=${env.ANDROID_HOME}" + + " -e GRADLE_USER_HOME=${env.GRADLE_USER_HOME}", + in: [ 'centos7' ], + on: 'android', ] } lazyStage { name = 'package' tasks = [ - run: { + pre: { def currentVersion = androidVersion() currentBuild.displayName = "#${env.BUILD_NUMBER} ${currentVersion.string}-${currentVersion.number}" - fastLane('android', 'build') }, + run: { + fastLane('android', 'build', '', 'rh-ruby24') + }, + args: "-v /opt/android:/opt/android" + + " -v /opt/certificates:/opt/certificates" + + " -e JAVA_HOME=${env.JAVA_HOME}" + + " -e ANDROID_HOME=${env.ANDROID_HOME}" + + " -e GRADLE_USER_HOME=${env.GRADLE_USER_HOME}", + in: [ 'centos7' ], + on: 'android', post: { archiveArtifacts(artifacts: "${buildDir}/**", allowEmptyArchive: false) }, - on: 'android', ] } @@ -145,6 +165,7 @@ gitPush(remote, workingBranch) }) }, + in: [ 'centos7' ], on: 'android', ] } @@ -160,9 +181,14 @@ }, run: { if ( !lazyConfig.env.DRYRUN ) { - fastLane('android', 'alpha') + fastLane('android', 'alpha', '', 'rh-ruby24') } }, + args: "-v /opt/android:/opt/android" + + " -e JAVA_HOME=${env.JAVA_HOME}" + + " -e ANDROID_HOME=${env.ANDROID_HOME}" + + " -e GRADLE_USER_HOME=${env.GRADLE_USER_HOME}", + in: [ 'centos7' ], on: 'android', ] } @@ -177,9 +203,14 @@ }, run: { if ( !lazyConfig.env.DRYRUN ) { - fastLane('android', 'beta') + fastLane('android', 'beta', '', 'rh-ruby24') } }, + args: "-v /opt/android:/opt/android" + + " -e JAVA_HOME=${env.JAVA_HOME}" + + " -e ANDROID_HOME=${env.ANDROID_HOME}" + + " -e GRADLE_USER_HOME=${env.GRADLE_USER_HOME}", + in: [ 'centos7' ], on: 'android', ] } @@ -194,9 +225,14 @@ }, run: { if ( !lazyConfig.env.DRYRUN ) { - fastLane('android', 'beta_crash', "fl_branch:\"${lazyConfig['branch']}\"") + fastLane('android', 'beta_crash', "fl_branch:\"${lazyConfig['branch']}\"", 'rh-ruby24') } }, + args: "-v /opt/android:/opt/android" + + " -e JAVA_HOME=${env.JAVA_HOME}" + + " -e ANDROID_HOME=${env.ANDROID_HOME}" + + " -e GRADLE_USER_HOME=${env.GRADLE_USER_HOME}", + in: [ 'centos7' ], on: 'android', ] } @@ -211,9 +247,14 @@ }, run: { if ( !lazyConfig.env.DRYRUN ) { - fastLane('android', 'production') + fastLane('android', 'production', '', 'rh-ruby24') } }, + args: "-v /opt/android:/opt/android" + + " -e JAVA_HOME=${env.JAVA_HOME}" + + " -e ANDROID_HOME=${env.ANDROID_HOME}" + + " -e GRADLE_USER_HOME=${env.GRADLE_USER_HOME}", + in: [ 'centos7' ], on: 'android', ] } diff --git a/fastlane/Fastfile b/fastlane/Fastfile index b8a0437..7d40857 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -11,7 +11,7 @@ # This is the minimum version number required. # Update this, if you use features of a newer version -fastlane_version "2.107.0" +fastlane_version "2.137.0" default_platform :android diff --git a/gradle.properties b/gradle.properties index e18d862..9ca4480 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,9 +11,24 @@ # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -org.gradle.jvmargs=-XX:NewSize=24m -XX:MaxNewSize=48m -XX:OldSize=32m -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=128m -XX:CompressedClassSpaceSize=32m -XX:ReservedCodeCacheSize=28m -Xms128m -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant +#org.gradle.jvmargs=\ +#-XX:NewSize=24m \ +#-XX:MaxNewSize=48m \ +#-XX:OldSize=32m \ +#-XX:MetaspaceSize=96m \ +#-XX:MaxMetaspaceSize=128m \ +#-XX:CompressedClassSpaceSize=32m \ +#-XX:ReservedCodeCacheSize=28m \ +#-Xms128m -Xmx768m \ +#-Dfile.encoding=UTF-8 \ +#-Duser.country=US \ +#-Duser.language=en \ +#-Duser.variant \ +#-Dme.jenkins # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true +org.gradle.parallel=true +org.gradle.daemon=false +org.gradle.caching=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e0b3fb8..e1953a9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Wed Sep 04 17:57:02 CEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/lazyDir/Gemfile b/lazyDir/Gemfile new file mode 100644 index 0000000..aaa580d --- /dev/null +++ b/lazyDir/Gemfile @@ -0,0 +1,8 @@ +# frozen_string_literal: true +source "https://rubygems.org" +ruby RUBY_VERSION + +gem "fastlane" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval(File.read(plugins_path), binding) if File.exist?(plugins_path) diff --git a/lazyDir/Gemfile.lock b/lazyDir/Gemfile.lock new file mode 100644 index 0000000..f3383a3 --- /dev/null +++ b/lazyDir/Gemfile.lock @@ -0,0 +1,162 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + atomos (0.1.3) + babosa (1.0.3) + claide (1.0.3) + colored (1.2) + colored2 (3.1.2) + commander-fastlane (4.4.6) + highline (~> 1.7.2) + declarative (0.0.10) + declarative-option (0.1.0) + digest-crc (0.4.1) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.7.5) + emoji_regex (1.0.1) + excon (0.70.0) + faraday (0.17.1) + multipart-post (>= 1.2, < 3) + faraday-cookie_jar (0.0.6) + faraday (>= 0.7.4) + http-cookie (~> 1.0.0) + faraday_middleware (0.13.1) + faraday (>= 0.7.4, < 1.0) + fastimage (2.1.7) + fastlane (2.137.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.3, < 3.0.0) + babosa (>= 1.0.2, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander-fastlane (>= 4.4.6, < 5.0.0) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 2.0) + excon (>= 0.45.0, < 1.0.0) + faraday (~> 0.17) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 0.13.1) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-api-client (>= 0.21.2, < 0.24.0) + google-cloud-storage (>= 1.15.0, < 2.0.0) + highline (>= 1.7.2, < 2.0.0) + json (< 3.0.0) + jwt (~> 2.1.0) + mini_magick (>= 4.9.4, < 5.0.0) + multi_xml (~> 0.5) + multipart-post (~> 2.0.0) + plist (>= 3.1.0, < 4.0.0) + public_suffix (~> 2.0.0) + rubyzip (>= 1.3.0, < 2.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + slack-notifier (>= 2.0.0, < 3.0.0) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.8.1, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + gh_inspector (1.1.3) + google-api-client (0.23.9) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.5, < 0.7.0) + httpclient (>= 2.8.1, < 3.0) + mime-types (~> 3.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + signet (~> 0.9) + google-cloud-core (1.4.1) + google-cloud-env (~> 1.0) + google-cloud-env (1.3.0) + faraday (~> 0.11) + google-cloud-storage (1.16.0) + digest-crc (~> 0.4) + google-api-client (~> 0.23) + google-cloud-core (~> 1.2) + googleauth (>= 0.6.2, < 0.10.0) + googleauth (0.6.7) + faraday (~> 0.12) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (~> 0.7) + highline (1.7.10) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + json (2.3.0) + jwt (2.1.0) + memoist (0.16.2) + mime-types (3.3) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.1009) + mini_magick (4.9.5) + multi_json (1.14.1) + multi_xml (0.6.0) + multipart-post (2.0.0) + nanaimo (0.2.6) + naturally (2.2.0) + os (1.0.1) + plist (3.5.0) + public_suffix (2.0.5) + representable (3.0.4) + declarative (< 0.1.0) + declarative-option (< 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rouge (2.0.7) + rubyzip (1.3.0) + security (0.1.3) + signet (0.12.0) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.6) + CFPropertyList + naturally + slack-notifier (2.3.2) + terminal-notifier (2.0.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + tty-cursor (0.7.0) + tty-screen (0.7.0) + tty-spinner (0.9.2) + tty-cursor (~> 0.7) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.6) + unicode-display_width (1.6.0) + word_wrap (1.0.0) + xcodeproj (1.13.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.6) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.0) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + fastlane + +RUBY VERSION + ruby 2.4.6p354 + +BUNDLED WITH + 1.13.7 diff --git a/lazyDir/centos7.Dockerfile b/lazyDir/centos7.Dockerfile new file mode 100644 index 0000000..4292876 --- /dev/null +++ b/lazyDir/centos7.Dockerfile @@ -0,0 +1,108 @@ +# +# 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 + +# Install extra java deps +RUN yum -q clean expire-cache \ + && yum -y install tzdata-java \ + java-11-openjdk-devel \ + && yum -q clean packages + +# Create a symbolic link to latest JVM - for legacy scripts +RUN mkdir /usr/java && ln -s /usr/lib/jvm/java-11-openjdk /usr/java/latest + +# 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=.