Sha256: 200bb260ebb6d3439a44f511d1229dab890d5738271081369b0bea44ca11982d

Contents?: true

Size: 877 Bytes

Versions: 3

Compression:

Stored size: 877 Bytes

Contents

!/usr/bin/env bash

# Exit immediately if there is an error
set -e

# cause a pipeline (for example, curl -s http://sipb.mit.edu/ | grep foo) to produce a failure return code if any command errors not just the last command of the pipeline.
set -o pipefail

# setup basic auth on the container
#
basicauth() {
  if [[ -n ${CF_BASIC_AUTH_PASSWORD+x} ]]
  then
    htpasswd -cb site/Staticfile.auth $CF_BASIC_AUTH_USERNAME $CF_BASIC_AUTH_PASSWORD
  else
    echo "Not setting a password."
  fi
}

# main script function
#
main() {
  readonly GITBRANCH="${CIRCLE_BRANCH}"

  case "${GITBRANCH}" in
    master)
      appname="${CIRCLE_PROJECT_REPONAME}"
      ;;
    *)
      appname="${CIRCLE_PROJECT_REPONAME}-${GITBRANCH}"
      ;;
  esac

  basicauth
  cf api $CF_API
  cf auth $CF_USER $CF_PASSWORD
  cf target -o $CF_ORG
  cf target -s $CF_SPACE
  cf push $appname
}

main $@

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jalpha-0.3 template/bin/cideploy.sh
jalpha-0.2 template/bin/cideploy.sh
jalpha-0.1 template/bin/cideploy.sh