Skip to content

Instantly share code, notes, and snippets.

@leafsummer
Last active August 29, 2015 14:24
Show Gist options
  • Save leafsummer/d373e9f99bb5bd48a0a3 to your computer and use it in GitHub Desktop.
Save leafsummer/d373e9f99bb5bd48a0a3 to your computer and use it in GitHub Desktop.
static web deploy shell
#!/bin/bash
#celery web deploy
NGINX_CONF=/opt/disk2/var/serverconfig/www-nginx.conf
SVN_USERNAME=""
SVN_PASSWORD=""
CELERY_WEB_SVN=""
WEB_PROJECT_DIR=/opt/disk2/var/www
sed -i -e "/uwsgi_pass\s\+127.0.0.1:9001;/d" $NGINX_CONF
sed -i -e "/include\s\+uwsgi_params;/d" $NGINX_CONF
sed -i -e "/location\s\+\/media/i location ^~ /choi_wan_api/ {\n proxy_pass http://$1:80;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_redirect off;\n}" $NGINX_CONF
rm -r $WEB_PROJECT_DIR/*
svn co $CELERY_WEB_SVN $WEB_PROJECT_DIR --username $SVN_USERNAME --password $SVN_PASSWORD -q --no-auth-cache 2>&1 <<EOF
t
EOF
cd WEB_PROJECT_DIR
sed -i -e ""
/etc/init.d/nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment