Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Fix deploy scripts (now that sources/javadocs may be present)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Syer committed Nov 5, 2014
1 parent ac56a5f commit 1e0c00a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
14 changes: 11 additions & 3 deletions demo_deploy.sh
Expand Up @@ -25,16 +25,24 @@ echo Home: $PLATFORM_HOME
DEMO_HOME=${DEMO_HOME:-$PLATFORM_HOME/customers-stores}
# TODO: clone and build

function find_jar() {
if [ -d $1 ]; then
ls $1/*.jar | egrep -v 'javadoc|sources'
else
echo $1/app.jar
fi
}

function deploy_app() {

APP=$PREFIX$1
NAME=$1
[ "$1" == "stores" ] && NAME=store
JARPATH=$DEMO_HOME/rest-microservices-$NAME/target/*.jar
JARPATH=$(find_jar "$DEMO_HOME/rest-microservices-$NAME/target")
[ "$1" == "customersui" ] && JARPATH=$DEMO_HOME/customers-stores-ui/app.jar
[ "$1" == "hystrix-dashboard" -o "$1" == "turbine" ] && JARPATH=$PLATFORM_HOME/$NAME/target/*.jar
[ "$1" == "hystrix-dashboard" -o "$1" == "turbine" ] && JARPATH=$(find_jar "$PLATFORM_HOME/$NAME/target")

if [ ! -f $JARPATH ]; then
if ! [ -f "$JARPATH" ]; then
echo "No jar for deployment of $1 at: $JARPATH"
exit 0
fi
Expand Down
12 changes: 11 additions & 1 deletion services_deploy.sh
@@ -1,4 +1,5 @@
#!/bin/bash

set -e

DOMAIN=${DOMAIN:-run.pivotal.io}
Expand Down Expand Up @@ -27,12 +28,21 @@ CONFIG_HOME=${CONFIG_HOME:-$PLATFORM_HOME/configserver}

EUREKA_HOME=${EUREKA_HOME:-$PLATFORM_HOME/eureka}

function find_jar() {
if [ -d $1 ]; then
ls $1/*.jar | egrep -v 'javadoc|sources'
else
echo $1/app.jar
fi
}

function deploy() {

APP=$PREFIX$1
APP_HOME=$2

cf push $APP -m 512m -p $APP_HOME/target/*.jar --no-start
JARPATH=$(find_jar "$APP_HOME/target")
cf push $APP -m 512m -p "$JARPATH" --no-start
cf env $APP | grep SPRING_PROFILES_ACTIVE || cf set-env $APP SPRING_PROFILES_ACTIVE cloud
cf env $APP | grep ENCRYPT_KEY || cf set-env $APP ENCRYPT_KEY deadbeef
if [ "$PREFIX" != "" ]; then
Expand Down

0 comments on commit 1e0c00a

Please sign in to comment.