|
|
@ -1,6 +1,8 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
if [[ $(whoami) != 'root' ]]; then |
|
|
|
server='master0.entrydns.net' |
|
|
|
echo 'Must be run with sudo.' |
|
|
|
|
|
|
|
exit 1 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [[ $# != 1 ]]; then |
|
|
|
if [[ $# != 1 ]]; then |
|
|
|
echo 'Specify rpm file to deploy' |
|
|
|
echo 'Specify rpm file to deploy' |
|
|
@ -9,7 +11,9 @@ else: |
|
|
|
package=${1} |
|
|
|
package=${1} |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
scp ${package} ${server}:/tmp |
|
|
|
yum update -y ${package} |
|
|
|
|
|
|
|
su - entrydns -c 'bundle exec rake db:migrate RAILS_ENV=production' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
systemctl reload unicorn-entrydns.service |
|
|
|
|
|
|
|
|
|
|
|
ssh -t ${server} "sudo yum update -y /tmp/${package}" |
|
|
|
systemctl status unicorn-entrydns.service |
|
|
|
ssh -t ${server} "su - entrydns -c 'cd ${HOME} && bundle exec rake db:migrate RAILS_ENV=production' |
|
|
|
|
|
|
|