|
| 1 | +# ----------------------------------------------------------------------------- |
| 2 | +# |
| 3 | +# Package : {package_name} |
| 4 | +# Version : {package_version} |
| 5 | +# Source repo : {package_url} |
| 6 | +# Tested on : {distro_name} {distro_version} |
| 7 | +# Script License: Apache License, Version 2 or later |
| 8 | +# Maintainer : BulkPackageSearch Automation {maintainer} |
| 9 | +# |
| 10 | +# Disclaimer: This script has been tested in root mode on given |
| 11 | +# ========== platform using the mentioned version of the package. |
| 12 | +# It may not work as expected with newer versions of the |
| 13 | +# package and/or distribution. In such case, please |
| 14 | +# contact "Maintainer" of this script. |
| 15 | +# |
| 16 | +# ---------------------------------------------------------------------------- |
| 17 | + |
| 18 | +PACKAGE_NAME={package_name} |
| 19 | +PACKAGE_VERSION={package_version} |
| 20 | +PACKAGE_URL={package_url} |
| 21 | + |
| 22 | +yum -y update && yum install -y nodejs nodejs-devel nodejs-packaging npm python38 python38-devel ncurses git jq curl make gcc-c++ procps gnupg2 |
| 23 | +yum install ruby -y && yum install -y libcurl-devel libffi-devel ruby-devel ruby-devel.ppc64le redhat-rpm-config sqlite sqlite-devel java-1.8.0-openjdk-devel |
| 24 | +gem install bundle && gem install bundler:1.17.3 && gem install rake |
| 25 | +curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - |
| 26 | +curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - |
| 27 | +curl -L https://get.rvm.io | bash -s stable |
| 28 | +source /etc/profile.d/rvm.sh |
| 29 | +rvm install jruby |
| 30 | +export PATH=$PATH:/usr/local/rvm/rubies/jruby-9.2.9.0/bin/ |
| 31 | + |
| 32 | +source /etc/profile.d/rvm.sh; |
| 33 | +OS_NAME=`python3 -c "os_file_data=open('/etc/os-release').readlines();os_info = [i.replace('PRETTY_NAME=','').strip() for i in os_file_data if i.startswith('PRETTY_NAME')];print(os_info[0])"` |
| 34 | + |
| 35 | +#install previous version of bundler |
| 36 | +gem install bundler:1.17.3 |
| 37 | +HOME_DIR=`pwd` |
| 38 | +if ! git clone $PACKAGE_URL $PACKAGE_NAME; then |
| 39 | + echo "------------------$PACKAGE_NAME:clone_fails---------------------------------------" |
| 40 | + echo "$PACKAGE_URL $PACKAGE_NAME" |
| 41 | + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Fail | Clone_Fails" |
| 42 | + exit 0 |
| 43 | +fi |
| 44 | + |
| 45 | +cd $HOME_DIR/$PACKAGE_NAME |
| 46 | +git checkout $PACKAGE_VERSION |
| 47 | + |
| 48 | +if ! bundle _1.17.3_ install; then |
| 49 | + if ! bundle install; then |
| 50 | + echo "------------------$PACKAGE_NAME:install_fails-------------------------------------" |
| 51 | + echo "$PACKAGE_URL $PACKAGE_NAME" |
| 52 | + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Fail | Install_Fails" |
| 53 | + exit 0 |
| 54 | + fi |
| 55 | +fi |
| 56 | + |
| 57 | +cd $HOME_DIR/$PACKAGE_NAME |
| 58 | +if ! bundle _1.17.3_ exec rake; then |
| 59 | + if ! bundle exec rake; then |
| 60 | + echo "------------------$PACKAGE_NAME:install_success_but_test_fails---------------------" |
| 61 | + echo "$PACKAGE_URL $PACKAGE_NAME" |
| 62 | + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Fail | Install_success_but_test_Fails" |
| 63 | + exit 0 |
| 64 | + fi |
| 65 | +else |
| 66 | + echo "------------------$PACKAGE_NAME:install_&_test_both_success-------------------------" |
| 67 | + echo "$PACKAGE_URL $PACKAGE_NAME" |
| 68 | + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Pass | Both_Install_and_Test_Success" |
| 69 | + exit 0 |
| 70 | +fi |
0 commit comments