Skip to content

Commit

Permalink
Don't check for build before releasing (plushu/plusku#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartpb committed Aug 20, 2014
1 parent 1d0af36 commit 9cf0cb1
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 52 deletions.
11 changes: 6 additions & 5 deletions command
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ else
fi

app_dir=$PLUSHU_ROOT/apps/$app
env_file=$app_dir/config.env

# Check if app exists with the same name
if [ ! -d "$app_dir" ]; then
echo "App $app does not exist" >&2
# Check if app exists
if [[ ! -d "$app_dir" ]]; then
echo "App not found: $app" >&2
exit 1
fi

if [ ! -f "$env_file" ]; then
env_file=$app_dir/config.env

if [[ ! -f "$env_file" ]]; then
touch "$env_file"
fi

Expand Down
22 changes: 10 additions & 12 deletions subcommands/empty
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x

if [[ -n "$PLUSHU_APP_NAME" ]]; then
app=$PLUSHU_APP_NAME
Expand All @@ -12,15 +12,16 @@ else
fi

app_dir=$PLUSHU_ROOT/apps/$app
env_file=$app_dir/config.env

# Check if app exists with the same name
if [ ! -d "$app_dir" ]; then
echo "App $app does not exist" >&2
# Check if app exists
if [[ ! -d "$app_dir" ]]; then
echo "App not found: $app" >&2
exit 1
fi

if [ ! -f "$env_file" ]; then
env_file=$app_dir/config.env

if [[ ! -f "$env_file" ]]; then
touch "$env_file"
fi

Expand All @@ -34,9 +35,6 @@ else
> "$env_file"
fi

# If there is a build image to base a release on
if [[ -f "$app_dir/build.iid" ]]; then
# Restart app with new configuration
"$PLUSHU_ROOT/lib/plushook" release-app "$app"
"$PLUSHU_ROOT/lib/plushook" deploy-app "$app"
fi
# Restart app with new configuration
"$PLUSHU_ROOT/lib/plushook" release-app "$app"
"$PLUSHU_ROOT/lib/plushook" deploy-app "$app"
13 changes: 7 additions & 6 deletions subcommands/get
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x

if [[ -n "$PLUSHU_APP_NAME" ]]; then
app=$PLUSHU_APP_NAME
Expand All @@ -12,15 +12,16 @@ else
fi

app_dir=$PLUSHU_ROOT/apps/$app
env_file=$app_dir/config.env

# Check if app exists with the same name
if [ ! -d "$app_dir" ]; then
echo "App $app does not exist" >&2
# Check if app exists
if [[ ! -d "$app_dir" ]]; then
echo "App not found: $app" >&2
exit 1
fi

if [ ! -f "$env_file" ]; then
env_file=$app_dir/config.env

if [[ ! -f "$env_file" ]]; then
touch "$env_file"
fi

Expand Down
11 changes: 6 additions & 5 deletions subcommands/pretty
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ else
fi

app_dir=$PLUSHU_ROOT/apps/$app
env_file=$app_dir/config.env

# Check if app exists with the same name
if [ ! -d "$app_dir" ]; then
echo "App $app does not exist" >&2
# Check if app exists
if [[ ! -d "$app_dir" ]]; then
echo "App not found: $app" >&2
exit 1
fi

if [ ! -f "$env_file" ]; then
env_file=$app_dir/config.env

if [[ ! -f "$env_file" ]]; then
touch "$env_file"
fi

Expand Down
23 changes: 11 additions & 12 deletions subcommands/set
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x

if [[ -n "$PLUSHU_APP_NAME" ]]; then
app=$PLUSHU_APP_NAME
Expand All @@ -12,15 +12,16 @@ else
fi

app_dir=$PLUSHU_ROOT/apps/$app
env_file=$app_dir/config.env

# Check if app exists with the same name
if [ ! -d "$app_dir" ]; then
echo "App $app does not exist" >&2
# Check if app exists
if [[ ! -d "$app_dir" ]]; then
echo "App not found: $app" >&2
exit 1
fi

if [ ! -f "$env_file" ]; then
env_file=$app_dir/config.env

if [[ ! -f "$env_file" ]]; then
touch "$env_file"
fi

Expand Down Expand Up @@ -64,9 +65,7 @@ for pair in "${pairs[@]}"; do
printf "$key=%q\n" "$value" >>"$env_file"
done

# If there is a build image to base a release on
if [[ -f "$app_dir/build.iid" ]]; then
# Restart app with new configuration
"$PLUSHU_ROOT/lib/plushook" release-app "$app"
"$PLUSHU_ROOT/lib/plushook" deploy-app "$app"
fi
# Restart app with new configuration
"$PLUSHU_ROOT/lib/plushook" release-app "$app"
"$PLUSHU_ROOT/lib/plushook" deploy-app "$app"

23 changes: 11 additions & 12 deletions subcommands/unset
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x

if [[ -n "$PLUSHU_APP_NAME" ]]; then
app=$PLUSHU_APP_NAME
Expand All @@ -12,15 +12,16 @@ else
fi

app_dir=$PLUSHU_ROOT/apps/$app
env_file=$app_dir/config.env

# Check if app exists with the same name
if [ ! -d "$app_dir" ]; then
echo "App $app does not exist" >&2
# Check if app exists
if [[ ! -d "$app_dir" ]]; then
echo "App not found: $app" >&2
exit 1
fi

if [ ! -f "$env_file" ]; then
env_file=$app_dir/config.env

if [[ ! -f "$env_file" ]]; then
touch "$env_file"
fi

Expand All @@ -46,9 +47,7 @@ for key in "${keys[@]}"; do
sed -i "/^$key=/ d" "$env_file"
done

# If there is a build image to base a release on
if [[ -f "$app_dir/build.iid" ]]; then
# Restart app with new configuration
"$PLUSHU_ROOT/lib/plushook" release-app "$app"
"$PLUSHU_ROOT/lib/plushook" deploy-app "$app"
fi
# Restart app with new configuration
"$PLUSHU_ROOT/lib/plushook" release-app "$app"
"$PLUSHU_ROOT/lib/plushook" deploy-app "$app"

0 comments on commit 9cf0cb1

Please sign in to comment.