github.com/asifdxtreme/cli@v6.1.3-0.20150123051144-9ead8700b4ae+incompatible/bin/generate-release-notes (about)

     1  #!/usr/bin/env bash
     2  
     3  PREVIOUS_VERSION=$1
     4  
     5  if [ -z $PREVIOUS_VERSION ]; then
     6      cat <<-INFO
     7  NAME:
     8    generate-release-notes - Generate release notes relative to a given version
     9  
    10  USAGE:
    11    generate-release-notes PREVIOUS_VERSION [--all]
    12  
    13  EXAMPLE:
    14    generate-release-notes 6.0.1
    15  INFO
    16  
    17      exit 1
    18  fi
    19  
    20  if [ -z $(echo $PREVIOUS_VERSION | grep -e 'v') ]; then
    21      echo "Error - PREVIOUS_VERSION argument should have this form: v6.0.1"
    22      exit 1
    23  fi
    24  
    25  SHOW_ALL_COMMITS=''
    26  if [ "$2" = "--all" ]; then
    27    SHOW_ALL_COMMITS=true
    28  fi
    29  
    30  VERSION=v$(cat VERSION)
    31  URL_VERSION=$(cat VERSION)
    32  
    33  cat <<-NOTES
    34  CF version $VERSION
    35  ===================
    36  Installers
    37  ----------
    38  - [Debian 32 bit](https://cli.run.pivotal.io/stable?release=debian32&version=$URL_VERSION&source=github-rel)
    39  - [Debian 64 bit](https://cli.run.pivotal.io/stable?release=debian64&version=$URL_VERSION&source=github-rel)
    40  - [Redhat 32 bit](https://cli.run.pivotal.io/stable?release=redhat32&version=$URL_VERSION&source=github-rel)
    41  - [Redhat 64 bit](https://cli.run.pivotal.io/stable?release=redhat64&version=$URL_VERSION&source=github-rel)
    42  - [Mac OS X 64 bit](https://cli.run.pivotal.io/stable?release=macosx64&version=$URL_VERSION&source=github-rel)
    43  - [Windows 32 bit](https://cli.run.pivotal.io/stable?release=windows32&version=$URL_VERSION&source=github-rel)
    44  - [Windows 64 bit](https://cli.run.pivotal.io/stable?release=windows64&version=$URL_VERSION&source=github-rel)
    45  
    46  Binaries
    47  --------
    48  - [Linux 32 bit binary]   (https://cli.run.pivotal.io/stable?release=linux32-binary&version=$URL_VERSION&source=github-rel)
    49  - [Linux 64 bit binary]   (https://cli.run.pivotal.io/stable?release=linux64-binary&version=$URL_VERSION&source=github-rel)
    50  - [Mac OS X 64 bit binary](https://cli.run.pivotal.io/stable?release=macosx64-binary&version=$URL_VERSION&source=github-rel)
    51  - [Windows 32 bit binary] (https://cli.run.pivotal.io/stable?release=windows32-exe&version=$URL_VERSION&source=github-rel)
    52  - [Windows 64 bit binary] (https://cli.run.pivotal.io/stable?release=windows64-exe&version=$URL_VERSION&source=github-rel)
    53  
    54  Change Log
    55  ----------
    56  NOTES
    57  
    58  if [ -z $SHOW_ALL_COMMITS ]; then
    59    git --no-pager log \
    60      $PREVIOUS_VERSION..$VERSION \
    61      --grep "\[.*\d*\]" \
    62      --pretty=format:'* %s%n%b'
    63  else
    64    git --no-pager log \
    65      $PREVIOUS_VERSION..$VERSION \
    66      --pretty=format:'* %s%n%b'
    67  fi