2016-08-17 15:17:47 +02:00
|
|
|
# Blender Cloud
|
|
|
|
|
2017-03-07 13:56:01 +01:00
|
|
|
Welcome to the [Blender Cloud](https://cloud.blender.org/) code repo!
|
|
|
|
Blender Cloud runs on the [Pillar](https://pillarframework.org/) framework.
|
2016-08-17 15:17:47 +02:00
|
|
|
|
|
|
|
## Quick setup
|
2017-03-07 13:59:43 +01:00
|
|
|
Set up a node with these commands.
|
2016-08-17 15:17:47 +02:00
|
|
|
|
|
|
|
```
|
2016-09-30 12:08:55 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-03-07 13:59:43 +01:00
|
|
|
sudo mkdir -p /data/{git,storage,config,certs}
|
2016-09-30 12:08:55 +02:00
|
|
|
sudo apt-get update
|
2017-03-07 13:59:43 +01:00
|
|
|
sudo apt-get -y install python3-pip
|
|
|
|
pip3 install docker-compose
|
2016-09-30 12:08:55 +02:00
|
|
|
|
|
|
|
cd /data/git
|
|
|
|
git clone git://git.blender.org/pillar-python-sdk.git
|
2017-03-12 12:15:21 +01:00
|
|
|
git clone git://git.blender.org/pillar.git -b production
|
|
|
|
git clone git://git.blender.org/attract.git -b production
|
|
|
|
git clone git://git.blender.org/flamenco.git -b production
|
|
|
|
git clone git://git.blender.org/blender-cloud.git -b production
|
|
|
|
git clone https://github.com/armadillica/grafista.git -b production
|
2017-03-07 13:59:43 +01:00
|
|
|
|
2017-03-12 12:15:44 +01:00
|
|
|
echo '0 8 * * * root docker exec -d grafista bash manage.sh collect' > /etc/cron.d/grafista
|
|
|
|
|
2016-09-30 12:08:55 +02:00
|
|
|
```
|
|
|
|
|
2017-03-07 13:59:43 +01:00
|
|
|
After these commands, run `deploy.sh` to build the static files and deploy
|
|
|
|
those too (see below).
|
|
|
|
|
|
|
|
|
2018-02-02 11:47:29 +01:00
|
|
|
## Preparing the production branch for deployment
|
|
|
|
|
|
|
|
All revisions to deploy to production should be on the `production` branches of all the relevant
|
|
|
|
repositories.
|
2016-09-30 12:08:55 +02:00
|
|
|
|
2018-02-02 11:47:29 +01:00
|
|
|
Make sure you have these aliases in the `[alias]` section of your `~/.gitconfig`:
|
2016-09-30 12:08:55 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
prod = "!git checkout production && git fetch origin production && gitk --all"
|
|
|
|
ff = "merge --ff-only"
|
|
|
|
```
|
|
|
|
|
2018-02-02 11:47:29 +01:00
|
|
|
The following commands should be executed for each (sub)project; specifically for
|
|
|
|
the current repository, Pillar, Attract, Flamenco, and Pillar-SVNMan:
|
2016-09-30 12:08:55 +02:00
|
|
|
|
2016-08-17 15:17:47 +02:00
|
|
|
```
|
2016-09-30 12:08:55 +02:00
|
|
|
cd $projectdir
|
|
|
|
|
|
|
|
# Ensure there are no local, uncommitted changes.
|
|
|
|
git status
|
|
|
|
git stash # if you still have local stuff.
|
|
|
|
|
|
|
|
# pull from master, run unittests, push your changes to master.
|
|
|
|
git pull
|
|
|
|
py.test
|
|
|
|
git push
|
|
|
|
|
|
|
|
# Switch to production branch, and investigate the situation.
|
|
|
|
git prod
|
|
|
|
|
|
|
|
# Fast-forward the production branch to the master branch.
|
|
|
|
git ff master
|
|
|
|
|
|
|
|
# Run tests again
|
|
|
|
py.test
|
|
|
|
|
2018-02-02 11:47:29 +01:00
|
|
|
# Push the production branch.
|
|
|
|
git push
|
2016-09-30 12:08:55 +02:00
|
|
|
```
|
|
|
|
|
2018-02-02 11:47:29 +01:00
|
|
|
## Deploying to production server
|
2016-10-20 15:05:28 +02:00
|
|
|
|
2018-02-02 11:47:29 +01:00
|
|
|
```
|
|
|
|
workon blender-cloud # activate your virtualenv
|
|
|
|
cd $projectdir/deploy
|
|
|
|
./2docker.sh
|
|
|
|
cd $projectdir/docker
|
|
|
|
./full_rebuild.sh # or one of the other build scripts, if you know what you're doing.
|
|
|
|
docker push armadillica/blender_cloud:latest
|
|
|
|
cd $projectdir/deploy
|
2018-02-02 12:20:00 +01:00
|
|
|
./2server.sh servername
|
2018-02-02 11:47:29 +01:00
|
|
|
```
|
2016-10-20 15:05:28 +02:00
|
|
|
|
2018-02-02 11:47:29 +01:00
|
|
|
To deploy another branch than `production`, do `export DEPLOY_BRANCH=otherbranch` before starting
|
|
|
|
the above commands.
|