مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-16 21:23:37 +00:00
update auto upgrade script to work with packages plus direct from repo
هذا الالتزام موجود في:
@@ -7,6 +7,13 @@
|
|||||||
# It can be run as any user that has access to /opt/postal and that can run
|
# It can be run as any user that has access to /opt/postal and that can run
|
||||||
# commands as postal.
|
# commands as postal.
|
||||||
|
|
||||||
|
CHANNEL = ARGV[0] || "stable"
|
||||||
|
|
||||||
|
unless ['beta', 'stable'].include?(CHANNEL)
|
||||||
|
puts "Channel must be either 'stable' or 'beta'"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
def run(command, options = {})
|
def run(command, options = {})
|
||||||
if system(command)
|
if system(command)
|
||||||
# Good.
|
# Good.
|
||||||
@@ -19,11 +26,19 @@ end
|
|||||||
puts "Stopping current Postal instance"
|
puts "Stopping current Postal instance"
|
||||||
run "postal stop", :exit_on_failure => false
|
run "postal stop", :exit_on_failure => false
|
||||||
|
|
||||||
puts "Getting latest version of repository"
|
if File.exist?("/opt/postal/app/.git")
|
||||||
run "cd /opt/postal/app && git pull"
|
puts "Getting latest version of repository"
|
||||||
|
run "cd /opt/postal/app && git pull"
|
||||||
|
else
|
||||||
|
puts "Backing up previous application files"
|
||||||
|
run "rm -Rf /opt/postal/app.backup"
|
||||||
|
run "cp -R /opt/postal/app /opt/postal/app.backup"
|
||||||
|
puts "Downloading latest version of application"
|
||||||
|
run "wget https://postal.atech.media/packages/#{CHANNEL}/latest.tgz -O - | tar zxpv -C /opt/postal/app"
|
||||||
|
end
|
||||||
|
|
||||||
puts "Installing dependencies"
|
puts "Installing dependencies"
|
||||||
run "postal bundle /opt/postal/app/vendor/bundle"
|
run "postal bundle /opt/postal/vendor/bundle"
|
||||||
|
|
||||||
puts "Upgrading database & assets"
|
puts "Upgrading database & assets"
|
||||||
run "postal upgrade"
|
run "postal upgrade"
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم