Disclaimer: The statements and opinions expressed in this article are those of the author(s) and do not necessarily reflect the positions of Thoughtworks.
We have already discussed the benefits of deploying from packages rather than from a tag, branch or binary. One of the benefits is the support for packages from infrastructure automation tools (e.g. Chef, Puppet, Ansible etc.).
What! Use infrastructure automation for app deployment? Yes, why not? Many teams are already doing so. Granted, some of these tools were created to address the problem of configuration drift. But they can be used in orchestration mode to fit the automated application deployment use case.
How Go 13.3’s support for package materials helps this
For example, one of the ways to use Chef/Puppet in orchestration mode is to simply use chef-solo/masterless puppet as illustrated below.
Use of infrastructure automation tools for application deployment
Here we have a very simple 3-stage build pipeline and a 2-stage deployment pipeline modeled in Go. The second pipeline deploys to a test environment and kicks off some tests. It may be triggered by the publication of a new build-package or by changes to deployment config (stored in version control). When triggered, the deployment job on the Go agent, passes along the revision of the package to be deployed via a remote orchestration call like this:
ssh user@host sudo chef-solo -c config.rb -j json-attribs.rb -l debug
where json-attribs.rb is pre-populated like this with package revision information:
ssh user@host echo '{"mypkg": $GO_PACKAGE_REPONAME_PKGNAME_LABEL}' > json-attribs.rb
Note the arrow labeled with Go 13.3. We have introduced the ability for pipelines to poll package repositories. Watch this space for an imminent announcement of release 13.3
Infrastructure Automation isn’t the same as scripting
Sure, we could achieve the above with just plain scripts but infrastructure automation tools provide a higher-level language - a DSL for dealing with infrastructure. While shell scripts are also a DSL, infrastructure automation DSL scripts are to plain scripts what a high level language like Java is to assembly. Well-written infrastructure automation is mostly declarative at the highest level, compared to plain scripts that are imperative.
By using these tools, we adopt the notion of infrastructure-as-code and take a step closer to devops as they:
Disclaimer: The statements and opinions expressed in this article are those of the author(s) and do not necessarily reflect the positions of Thoughtworks.
Thoughtworks acknowledges the Traditional Owners of the land where we work and live, and their continued connection to Country. We pay our respects to Elders past and present. Aboriginal and Torres Strait Islander peoples were the world's first scientists, technologists, engineers and mathematicians. We celebrate the stories, culture and traditions of Aboriginal and Torres Strait Islander Elders of all communities who also work and live on this land.
As a company, we invite Thoughtworkers to be actively engaged in advancing reconciliation and strengthen their solidarity with the First Peoples of Australia. Since 2019, we have been working with Reconciliation Australia to formalize our commitment and take meaningful action to advance reconciliation. We invite you to review our Reconciliation Action Plan.