Using pyrax to deploy the DevOps Blog
Initially, when Hart migrated to Octopress from WordPress he was using Swiftly to push new posts to Cloud Files. Swiftly, a tool written by Cloud Files developer Gregory Holt, provides a Client class and a command line tool for common Swift functions. Since Rackspace Cloud Files is based on Swift, it made a great tool to sync our working Octopress directory to a CDN-enabled Cloud Files container. <!-- more -->
Swiftly was and still is great, but it uses version 1.0 of the API. We wanted to move to v2.0, and we wanted to use the Official Rackspace SDKs. I decided to use the Python SDK, pyrax, to deploy using the v2.0 API.
Before and After
The Jenkins server still watches our GitHub repository for changes, only now uses a script I wrote that takes advantage of pyrax's container sync capability. Here are the Jenkins builds, before and after:
bundle install rake install['classic'] rake generate export SWIFTLY_AUTH_URL="https://auth.api.rackspacecloud.com/v1.0" export SWIFTLY_AUTH_USER="USERNAME" export SWIFTLY_AUTH_KEY="API_KEY" swiftly put public -i public -d
cf_sync command is a script I wrote that uses the
pyrax library. It was originally written to handle my personal blog, but also works for the DevOps Blog, or any directory you need to sync with a container. You can download the script for container sync here.