Sha256: dd8f45c5350125823ff096fae455cb04b9cc807a1629af608decc2e4719b110e

Contents?: true

Size: 1.62 KB

Versions: 20

Compression:

Stored size: 1.62 KB

Contents

#!/bin/bash
set -e

SELFROOT=`dirname "$0"`
SELFROOT=`cd "$SELFROOT" && pwd`

GIT_DIR=
GIT_URL=
GIT_REF=origin/master

function usage()
{
  echo "Usage: ./git_update [OPTIONS]"
  echo "Update git sources for a project."
  echo
  echo "Required options:"
  echo "  -p PATH         Path to a project"
  echo
  echo "  -P PATH         Path to a Git repo directory"
  echo "  -u URL          Git URL"
  echo
  echo "Optional options:"
  echo "  -r REF          Use this specific Git commit or tag"
}

function parse_options()
{
  local OPTIND=1
  local opt
  while getopts "p:P:u:r:h" opt; do
    case "$opt" in
    p)
      GIT_DIR="$OPTARG/git"
      GIT_URL=`cat "$OPTARG/git_url"`
      ;;
    P)
      GIT_DIR="$OPTARG"
      ;;
    u)
      GIT_URL="$OPTARG"
      ;;
    r)
      GIT_REF="$OPTARG"
      ;;
    h)
      usage
      exit
      ;;
    *)
      return 1
      ;;
    esac
  done

  if [[ "$GIT_DIR" = "" ]]; then
    echo "Please specify a project using -p, or a Git repo using -P."
    exit 1
  fi
  if [[ "$GIT_URL" = "" ]]; then
    echo "Please specify a project using -p, or Git URL using -u."
    exit 1
  fi
}

function cleanup()
{
  local pids=`jobs -p`
  set +e
  if [[ "$pids" != "" ]]; then
    kill $pids >/dev/null 2>/dev/null
  fi
}

trap cleanup EXIT
parse_options "$@"
APP_UID=`id -u`
APP_GID=`id -g`

exec docker run --rm \
  -v "$SELFROOT:/system:ro" \
  -v "$GIT_DIR:/git" \
  -e "APP_UID=$APP_UID" \
  -e "APP_GID=$APP_GID" \
  -e "GIT_URL=$GIT_URL" \
  -e "GIT_REF=$GIT_REF" \
  phusion/passenger_rpm_automation \
  /system/internal/my_init --skip-runit --skip-startup-files --quiet -- \
  /system/internal/git_update

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
passenger-4.0.60 packaging/rpm/git_update
passenger-5.0.4 packaging/rpm/git_update
passenger-5.0.3 packaging/rpm/git_update
passenger-5.0.2 packaging/rpm/git_update
passenger-5.0.1 packaging/rpm/git_update
passenger-5.0.0.rc2 packaging/rpm/git_update
passenger-5.0.0.rc1 packaging/rpm/git_update
passenger-4.0.59 packaging/rpm/git_update
passenger-5.0.0.beta3 packaging/rpm/git_update
passenger-4.0.58 packaging/rpm/git_update
passenger-4.0.57 packaging/rpm/git_update
passenger-5.0.0.beta2 packaging/rpm/git_update
passenger-4.0.56 packaging/rpm/git_update
passenger-4.0.55 packaging/rpm/git_update
passenger-5.0.0.beta1 packaging/rpm/git_update
passenger-4.0.53 packaging/rpm/git_update
passenger-4.0.52 packaging/rpm/git_update
passenger-4.0.51 packaging/rpm/git_update
passenger-4.0.50 packaging/rpm/git_update
passenger-4.0.49 packaging/rpm/git_update