CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -a -ldflags '-s -w' -o myapp-linux main.go
rsync -avz --progress -e ssh go_file_location user@ip:dir_location
ng build
rsync -avz --progress -e ssh ng_file_location user@ip:dir_location
mv /home/ubuntu/temp/dist/blog /var/www/hrxlifefrontend
sudo chown -R www-data:www-data /var/www/hrxlifefrontend/
sudo find /var/www/hrxlifefrontend/ -type d -exec chmod 755 {} \\;
sudo find /var/www/hrxlifefrontend/ -type f -exec chmod 644 {} \\;
pg_dump -U postgres -d blog -f blog_backup.sql
rsync -avz --progress -e ssh sql_file_location user@ip:dir_location`
#删除已有数据库
sudo -i -u postgres / psql -U postgres -c "DROP DATABASE blog;"
#创建新的数据库
createdb -U postgres blog
#导入数据
mv sql_file_location /var/lib/postgresql/
sudo -i -u postgres / psql -U postgres -d blog -f blog_backup.sql