Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bugfix: old_releases are now properly set.

  • Loading branch information...
commit 12d18ed0f26b863bc569defb98436412316616b3 1 parent 289d4f3
@wayneeseguin wayneeseguin authored
Showing with 21 additions and 11 deletions.
  1. +1 −0  map
  2. +1 −1  shell/functions
  3. +19 −10 shell/initialize
View
1  map
@@ -1,2 +1,3 @@
=do_deploy()
revert=do_revert()
+rollback=rollback()
View
2  shell/functions
@@ -324,7 +324,7 @@ do_deploy()
PATH="./bin:$PATH" # Account for project-specific command overrides.
# Logging (http://nakedape.cc/wiki/ShellHacks 1.6.1, 1.7, 1.11)
- export log_file="${deploy_log_path}/deploy.log"
+ log_file="${deploy_log_path}/deploy.log"
touch "${log_file}"
#exec 3>>"${log_file}"
exec > >(tee -a "${log_file}") 2>&1
View
29 shell/initialize
@@ -1,7 +1,7 @@
#!/bin/sh
typeset -gx shared_path project_path stage_path release_path discard_path \
- versions_path
+ versions_path log_file
typeset -g previous_releases previous timestamp deploy_log_path \
_hooks_flag environment result
@@ -10,19 +10,24 @@ typeset -ga deploy_steps old_releases
if ! command exists rsync
then
- error "rsync is required in order to use the deploy extension, "\
+ log error "rsync is required in order to use the deploy extension, "\
"please install rsync before continuing\n"\
" sm rsync package install"
fi
-[[ -n "${repository_url}" ]] ||
- error "The project's repository_url must be set in configuration files (eg: ~/.smrc)"
-
-versionedfs create \
- path "${project_path}" strategy name method copy activate first
+if variable is empty
+then
+ log error "The project's repository_url must be set in configuration files (eg: ~/.smrc)"
+fi
timestamp="$(date +%m.%d.%YT%H:%M:%S)"
+versionedfs create \
+ path "${project_path}" \
+ strategy name \
+ method copy \
+ activate first
+
true \
${environment:="development"} \
${discard_path:="${project_path}/discard"} \
@@ -34,14 +39,18 @@ true \
paths create "$deploy_log_path"
+includes api/array
+project_path=$HOME
+project=todo
+keep_releases=3
previous_releases=$( versionedfs versions path "${project_path}" name "${project}" )
-previous="${previous_releases[0]}"
+array first "previous_releases" as "previous"
if (( $(array length previous_releases) > ${keep_releases:-3} ))
then
- old_releases=($(echo ${previous_releases[@]} | sort -r |
- awk "NR > ${keep_releases:-3} { print \$0 }"
+ old_releases=($(
+ echo ${previous_releases} | sort -r | awk "NR > ${keep_releases:-3}"
))
fi
Please sign in to comment.
Something went wrong with that request. Please try again.