More Vagrant stuff.
parent
5f595b066d
commit
27b08c76b8
|
@ -1,16 +1,17 @@
|
||||||
venv
|
|
||||||
.gunicorn.pid
|
.gunicorn.pid
|
||||||
.vagrant
|
|
||||||
*.log
|
|
||||||
.sass-cache
|
.sass-cache
|
||||||
|
.vagrant
|
||||||
|
.venv
|
||||||
|
|
||||||
|
*.log
|
||||||
*.un~
|
*.un~
|
||||||
*.pgdump
|
*.pgdump
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
settings_local.py
|
settings_local.py
|
||||||
media/cache
|
settings_local_server.py
|
||||||
tags
|
|
||||||
|
|
||||||
|
media/cache
|
||||||
media/css/pro.css
|
media/css/pro.css
|
||||||
media/css/snipt.css
|
media/css/snipt.css
|
||||||
media/js/src/account.min.js
|
media/js/src/account.min.js
|
||||||
|
@ -23,9 +24,9 @@ media/js/src/modules/snipt.min.js
|
||||||
media/js/src/pro.min.js
|
media/js/src/pro.min.js
|
||||||
media/js/snipt-all.min.js
|
media/js/snipt-all.min.js
|
||||||
media/js/pro-all.min.js
|
media/js/pro-all.min.js
|
||||||
|
|
||||||
static/admin
|
static/admin
|
||||||
static/css
|
static/css
|
||||||
static/fonts
|
static/fonts
|
||||||
static/img
|
static/img
|
||||||
static/js
|
static/js
|
||||||
|
tags
|
||||||
|
|
35
Makefile
35
Makefile
|
@ -75,6 +75,19 @@ deploy:
|
||||||
deploy-heroku:
|
deploy-heroku:
|
||||||
@git push heroku
|
@git push heroku
|
||||||
|
|
||||||
|
server-settings:
|
||||||
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r settings_local_server.py vagrant@localhost:settings_local.py
|
||||||
|
|
||||||
|
salt-server:
|
||||||
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./salt/ vagrant@localhost:salt
|
||||||
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./pillar/ vagrant@localhost:pillar
|
||||||
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r settings_local_server.py vagrant@localhost:settings_local.py
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo rm -rf /srv'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mkdir /srv'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mv ~/salt /srv/salt'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mv ~/pillar /srv/pillar'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo salt-call --local state.highstate'
|
||||||
|
|
||||||
salt-vagrant:
|
salt-vagrant:
|
||||||
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./salt/ vagrant@localhost:salt
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./salt/ vagrant@localhost:salt
|
||||||
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./pillar/ vagrant@localhost:pillar
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./pillar/ vagrant@localhost:pillar
|
||||||
|
@ -84,6 +97,25 @@ salt-vagrant:
|
||||||
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mv ~/pillar /srv/pillar'
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mv ~/pillar /srv/pillar'
|
||||||
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo salt-call --local state.highstate'
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo salt-call --local state.highstate'
|
||||||
|
|
||||||
|
server:
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo apt-get update'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo apt-get install -y software-properties-common python-software-properties'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo add-apt-repository -y ppa:saltstack/salt'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo apt-get update'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo apt-get install -y salt-minion'
|
||||||
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./salt/ vagrant@localhost:salt
|
||||||
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r ./pillar/ vagrant@localhost:pillar
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo rm -rf /srv'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mkdir /srv'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mv ~/salt /srv/salt'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo mv ~/pillar /srv/pillar'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo salt-call --local state.highstate'
|
||||||
|
@scp -q -P 2222 -i ~/.vagrant.d/insecure_private_key -r settings_local_server.py vagrant@localhost:/var/www/snipt/settings_local.py
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'cd /var/www/snipt; make db'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'cd /var/www/snipt; /var/www/.virtualenvs/snipt/bin/python manage.py syncdb'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'cd /var/www/snipt; /var/www/.virtualenvs/snipt/bin/python manage.py migrate'
|
||||||
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'cd /var/www/snipt; /var/www/.virtualenvs/snipt/bin/python manage.py backfill_api_keys'
|
||||||
|
|
||||||
vagrant:
|
vagrant:
|
||||||
@vagrant up --provider=vmware_fusion
|
@vagrant up --provider=vmware_fusion
|
||||||
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo apt-get update'
|
@ssh vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key 'sudo apt-get update'
|
||||||
|
@ -107,5 +139,8 @@ vagrant:
|
||||||
db, \
|
db, \
|
||||||
deploy, \
|
deploy, \
|
||||||
deploy-heroku, \
|
deploy-heroku, \
|
||||||
|
salt-server, \
|
||||||
salt-vagrant, \
|
salt-vagrant, \
|
||||||
|
server-settings, \
|
||||||
|
server, \
|
||||||
vagrant
|
vagrant
|
||||||
|
|
|
@ -13,6 +13,13 @@ Install [Vagrant](https://www.vagrantup.com/) and either [VirtualBox](https://ww
|
||||||
4. `make vagrant`
|
4. `make vagrant`
|
||||||
5. Visit [http://local.snipt.net:8080/](http://local.snipt.net:8080/).
|
5. Visit [http://local.snipt.net:8080/](http://local.snipt.net:8080/).
|
||||||
|
|
||||||
|
# Deploying to a VM
|
||||||
|
1. Clone the repo.
|
||||||
|
2. `cp settings_local.py-template settings_local_server.py`
|
||||||
|
3. Edit local server settings (choose a database password - you'll be prompted for it).
|
||||||
|
4. Manually change the VM IP address in the Makefile.
|
||||||
|
5. `make server`
|
||||||
|
|
||||||
# Deploying to Heroku
|
# Deploying to Heroku
|
||||||
|
|
||||||
1. Clone the repo.
|
1. Clone the repo.
|
||||||
|
|
|
@ -60,25 +60,39 @@ upstream backend_snipt {
|
||||||
rewrite ^/public/feed/$ https://{{ pillar.hostname }}/public/?rss permanent;
|
rewrite ^/public/feed/$ https://{{ pillar.hostname }}/public/?rss permanent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{% endif %}
|
server {
|
||||||
server {
|
listen 80 default_server;
|
||||||
listen 80 default_server;
|
|
||||||
|
|
||||||
location ~* /favicon.ico {
|
location / {
|
||||||
root /var/www/snipt/static/img/;
|
proxy_pass http://backend_snipt;
|
||||||
expires max;
|
proxy_set_header Host $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://backend_snipt;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
}
|
|
||||||
|
|
||||||
{% if pillar.env_name != 'vagrant' %}
|
|
||||||
location /static/ {
|
location /static/ {
|
||||||
alias /var/www/snipt/static/;
|
alias /var/www/snipt/static/;
|
||||||
expires max;
|
expires max;
|
||||||
}
|
}
|
||||||
{% endif %}
|
location ~* /favicon.ico {
|
||||||
|
root /var/www/snipt/static/img/;
|
||||||
|
expires max;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{% else %}
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
|
||||||
}
|
location / {
|
||||||
|
proxy_pass http://backend_snipt;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /static/ {
|
||||||
|
alias /var/www/snipt/media/;
|
||||||
|
expires max;
|
||||||
|
}
|
||||||
|
location ~* /favicon.ico {
|
||||||
|
root /var/www/snipt/media/img/;
|
||||||
|
expires max;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue