Fixes on deployment

This commit is contained in:
Marc Aymerich 2015-10-03 12:02:53 +00:00
parent bea5cb7e7e
commit ac8bcb99bf
2 changed files with 20 additions and 28 deletions

View File

@ -44,7 +44,6 @@ Django-orchestra can be installed on any Linux system, however it is **strongly
``` ```
6. Configure periodic execution of tasks (choose one) 6. Configure periodic execution of tasks (choose one)
1. Use cron 1. Use cron
```bash ```bash

View File

@ -3,44 +3,37 @@ Development and Testing Setup
If you are planing to do some development you may want to consider doing it under the following setup If you are planing to do some development you may want to consider doing it under the following setup
1. Create a basic [LXC](http://linuxcontainers.org/) container, start it and get inside. 1. Install Docker
```bash ```sh
wget -O /tmp/create.sh \ curl https://get.docker.com/ | sh
https://raw.github.com/glic3rinu/django-orchestra/master/scripts/container/create.sh
sudo bash /tmp/create.sh
sudo lxc-start -n orchestra
# root/root
``` ```
2. Deploy Django-orchestra development environment **inside the container**
```bash
# Make sure your container is connected to the Internet
# Probably you will have to configure the NAT first:
# sudo iptables -t nat -A POSTROUTING -s `container_ip` -j MASQUERADE
wget -O /tmp/deploy.sh \
https://raw.github.com/glic3rinu/django-orchestra/master/scripts/container/deploy.sh
cd /tmp/ # Moving away from /root before running deploy.sh
bash /tmp/deploy.sh
```
Django-orchestra source code should be now under `~orchestra/django-orchestra` and an Orchestra instance called _panel_ under `~orchestra/panel`
2. Build a new image, create and start a container
```bash
curl http://git.io/orchestra-Dockerfile > /tmp/Dockerfile
docker build -t orchestra /tmp/
docker create --name orchestra -i -t orchestra bash
docker start orchestra
docker attach orchestra
```
3. Deploy django-orchestra development environment
```bash
su - orchestra
bash <( curl -L https://git.io/deploy-orchestra ) --dev
```
3. Nginx should be serving on port 80, but Django's development server can be used as well: 3. Nginx should be serving on port 80, but Django's development server can be used as well:
```bash ```bash
su - orchestra
cd panel cd panel
python manage.py runserver 0.0.0.0:8888 python3 manage.py runserver 0.0.0.0:8888
``` ```
4. A convenient practice can be mounting `~orchestra` on your host machine so you can code with your favourite IDE, sshfs can be used for that
```bash
# On your host
mkdir ~<user>/orchestra
sshfs orchestra@<container-ip>: ~<user>/orchestra
```
5. To upgrade to current master just re-run the deploy script 5. To upgrade to current master just re-run the deploy script
```bash ```bash
sudo ~orchestra/django-orchestra/scripts/container/deploy.sh bash <( curl -L https://git.io/deploy-orchestra ) --dev
``` ```