In this episode, we pushed CI built static files to S3, then pulled those files into the Ansible deployment. This is part of the ongoing effort to simplify deployment by moving work to CI.
tar command to create a tarball (i.e., a
.tar.gz file) that contains all the static assets.
The first task from this episode was the upload the generated tarball to AWS S3. I created an S3 bucket where the asset tarballs can live. We then used the Circle CI AWS S3 orb to push the generated tarball to the new S3 bucket.
With the tarball on S3, we were finally ready to move to deployment. I created Ansible tasks to:
- Create a directory for asset tarballs to live on the server.
- Pull a tarball from S3 and store it in the directory.
- Extract the tarball files into the static root directory where Nginx can serve the files to users.
I didn't quite finish it all because some file permission issues popped that we still need to resolve. Next time we will fix those issues, then do the fun stuff of ripping out the old deployment steps.
Show notes for this stream are at Episode 29 Show Notes.
To learn more about the stream, please check out Building SaaS with Python and Django.