ManageIQ/manageiq

View on GitHub
bin/before_install

Summary

Maintainability
Test Coverage
#!/bin/bash

set -e

APP_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &>/dev/null && pwd)

if [ -n "$CI" ]; then
  echo "== Installing system packages =="
  sudo apt-get update
  sudo apt-get install -y libcurl4-openssl-dev
  echo

  # Install gettext for I18n msgfmt specs
  sudo apt-get install -y gettext
  echo

  if [ -n "$ACT" ]; then
    # Install cmake so we can build rugged gem
    sudo apt-get install -y cmake
    echo
  fi

  # Install ansible-runner for ansible-runner execution specs
  if [ -n "$ACT" ]; then
    sudo apt-get install -y python3-pip ansible
  fi
  pip3 install ansible-runner 'setuptools>=62.4.0'
  ansible --version
  ansible-runner --version
  echo
fi

if [ -n "$CI" ]; then
  echo "== Setup git config =="
  git config --global user.name "ManageIQ"
  git config --global user.email "contact@manageiq.org"
  git config --global init.defaultBranch "master"
  echo

  # Gemfile.lock.release only applies to non-master branches and PRs to non-master branches
  if [[ "$GITHUB_REPOSITORY_OWNER" = "ManageIQ" && "$GITHUB_BASE_REF" != "master" && "$GITHUB_REF_NAME" != "master" && "$GITHUB_REF_NAME" != "revert-"* && "$GITHUB_REF_NAME" != "dependabot/"* && "$GITHUB_REF_NAME" != "renovate/"* ]]; then
    echo "== Setup Gemfile.lock.release =="
    cp -f "$APP_ROOT/Gemfile.lock.release" "$APP_ROOT/Gemfile.lock"
    echo
  fi
fi