diff --git a/README.md b/README.md index 50fa52e..d4cfabd 100644 --- a/README.md +++ b/README.md @@ -120,13 +120,4 @@ git push ## Deploying to production server -``` -workon blender-cloud # activate your virtualenv -cd $projectdir/deploy -./2docker.sh -./build-all.sh # or ./build-quick.sh -./2server.sh servername -``` - -To deploy another branch than `production`, do `export DEPLOY_BRANCH=otherbranch` before starting -the above commands. +See [deploy/README.md](deploy/README.md). diff --git a/deploy/README.md b/deploy/README.md new file mode 100644 index 0000000..23ec6c9 --- /dev/null +++ b/deploy/README.md @@ -0,0 +1,39 @@ +# Deploying to Production + +``` +workon blender-cloud # activate your virtualenv +cd $projectdir/deploy +./full-pull.sh +``` + +## The Details + +Deployment consists of a few steps: + +1. Populate a staging directory with the files from the production branches of the various projects. +2. Create Docker images. +3. Push the docker images to Docker Hub. +4. Pull the docker images on the production server and rebuild+restart the containers. + +The scripts involved are: + +- `2docker.sh`: performs step 1. above. +- `build-{xxx}.sh`: performs steps 2. and 3. above. +- `2server.sh`: performs step 4. above. + +The `full-{xxx}.sh` scripts perform all the steps, and call into `build-{xxx}.sh`. + +For `xxx` there are: + +- `all`: Rebuild all Docker images from scratch. This is good for getting the latest updates to the + base image. +- `pull`: Pull the base and intermediate images from Docker Hub so that they are the same as the + last time someone pushed to production, then rebuilds the final Docker image. +- `quick`: Just rebuild the final Docker image. Only use this if the last time a deployment to + the production server was done was by you, on the machine you're working on now. + + +## Hacking Stuff + +To deploy another branch than `production`, do `export DEPLOY_BRANCH=otherbranch` before starting +the above commands.