Master
ThoughtWorks
Menu
Close
  • What we do
    • Go to overview
    • Customer Experience, Product and Design
    • Data Strategy, Engineering and Analytics
    • Digital Transformation and Operations
    • Enterprise Modernization, Platforms and Cloud
  • Who we work with
    • Go to overview
    • Automotive
    • Healthcare
    • Public Sector
    • Cleantech, Energy and Utilities
    • Media and Publishing
    • Retail and E-commerce
    • Financial Services and Insurance
    • Not-for-profit
    • Travel and Transport
  • Insights
    • Go to overview
    • Featured

      • Technology

        An in-depth exploration of enterprise technology and engineering excellence

      • Business

        Keep up to date with the latest business and industry insights for digital leaders

      • Culture

        The place for career-building content and tips, and our view on social justice and inclusivity

    • Digital Publications and Tools

      • Technology Radar

        An opinionated guide to technology frontiers

      • Perspectives

        A publication for digital leaders

      • Digital Fluency Model

        A model for prioritizing the digital capabilities needed to navigate uncertainty

      • Decoder

        The business execs' A-Z guide to technology

    • All Insights

      • Articles

        Expert insights to help your business grow

      • Blogs

        Personal perspectives from ThoughtWorkers around the globe

      • Books

        Explore our extensive library

      • Podcasts

        Captivating conversations on the latest in business and tech

  • Careers
    • Go to overview
    • Application process

      What to expect as you interview with us

    • Grads and career changers

      Start your tech career on the right foot

    • Search jobs

      Find open positions in your region

    • Stay connected

      Sign up for our monthly newsletter

  • About
    • Go to overview
    • Our Purpose
    • Awards and Recognition
    • Diversity and Inclusion
    • Our Leaders
    • Partnerships
    • News
    • Conferences and Events
  • Contact
Global | English
  • United States United States
    English
  • China China
    中文 | English
  • India India
    English
  • Canada Canada
    English
  • Singapore Singapore
    English
  • United Kingdom United Kingdom
    English
  • Australia Australia
    English
  • Germany Germany
    English | Deutsch
  • Brazil Brazil
    English | Português
  • Spain Spain
    English | Español
  • Global Global
    English
Blogs
Select a topic
View all topicsClose
Technology 
Agile Project Management Cloud Continuous Delivery  Data Science & Engineering Defending the Free Internet Evolutionary Architecture Experience Design IoT Languages, Tools & Frameworks Legacy Modernization Machine Learning & Artificial Intelligence Microservices Platforms Security Software Testing Technology Strategy 
Business 
Financial Services Global Health Innovation Retail  Transformation 
Careers 
Career Hacks Diversity & Inclusion Social Change 
Blogs

Topics

Choose a topic
  • Technology
    Technology
  • Technology Overview
  • Agile Project Management
  • Cloud
  • Continuous Delivery
  • Data Science & Engineering
  • Defending the Free Internet
  • Evolutionary Architecture
  • Experience Design
  • IoT
  • Languages, Tools & Frameworks
  • Legacy Modernization
  • Machine Learning & Artificial Intelligence
  • Microservices
  • Platforms
  • Security
  • Software Testing
  • Technology Strategy
  • Business
    Business
  • Business Overview
  • Financial Services
  • Global Health
  • Innovation
  • Retail
  • Transformation
  • Careers
    Careers
  • Careers Overview
  • Career Hacks
  • Diversity & Inclusion
  • Social Change
Continuous Delivery Technology

Use Go's new command repository to lookup your config scripts

Sriram Narayan Sriram Narayan

Published: Mar 18, 2013

Why version configuration?

Fully versioned configuration is a prerequisite for fully automated deployment. By fully automated deployment, we mean the ability to  deploy to a set of machines (physical, virtual or cloud) having nothing but a basic level of provisioning (OS, hotfixes, basic network and disk config). 

This is a topic by itself *. Many of us don’t have this level of automation. That’s ok. It is a journey. Some of us use golden images with basic application infrastructure (web servers, load balancers, caches, databases etc) already set up. On top of this we may run deployment scripts using rake, powershell, capistrano, fabric, ant, maven etc.

In all of the above scenarios, Go’s command repository can come handy.

Enter command repository

This a new feature introduced as part of release 13.1. It is an enhancement to Custom Commands in Go. Rather than start from scratch with command name and arguments, you now have the option to look up a command from a repository of useful commands maintained by the Go team. The lookup provides a starting point, you may need to edit the arguments, specify a working directory etc. Once saved, the behaviour is the same as a manually entered custom command.

Go-server looks up these commands from a bundled repository that is a clone of https://github.com/goteam/go-command-repo (contributions welcome)

You might think, “But these are all inline commands. Where are the version controlled scripts?” Good point. The default public repository only hosts commonly used commands in an inline fashion. They are good for experimentation and getting the command right for your situation. If you are already past this stage, simply switch to a private repository. Note that in this mode (no inline commands), we’ll be using this feature not so much as a command repository but rather as a searchable annotated index of configuration scripts.

A searchable annotated index of configuration scripts

Switch to a private repository to use your own set of commands. As a somewhat simplistic example, say you have an existing repository of config scripts organized like this:

.

+-- app-x

¦   +-- build

¦   +-- deploy

¦   +-- provision

+-- app-y

    +-- build

    +-- deploy

    +-- provision

Simply create a parallel hierarchy like this to hold the annotated index.

.

+-- app-x

¦   +-- build

¦   +-- deploy

¦   +-- provision

+-- app-y

¦   +-- build

¦   +-- deploy

¦   +-- provision

+-- cmd-repo

      +-- app-x

      ¦     +-- build

      ¦     +-- deploy

      ¦     +-- provision

      +-- app-y

            +-- build

            +-- deploy

            +-- provision

For app-x/build/buildfile,  create a corresponding index entry under cmd-repo/app-x/build/buildr.xml with contents:

<!--

name: build app-x

description: clean and build app-x with buildr

keywords: app-x, build, buildr

-->

<exec command="buildr">

  <arg>-f</arg>

  <arg>app-x/build/buildfile</arg>

  <arg>clean</arg>

  <arg>build</arg>

</exec>

Clone/checkout the repo on the Go server and point Go to look under $server_root/db/command_repository/my-pvt-repo/cmd-repo. Now, when you need to create a task in Go, you can simply lookup build, buildr or app-x. Don’t forget to add the config-script-repo as a material to the corresponding pipeline. Please refer to the product documentation for more detail.

*Further reading:

  • Don’t install software by hand
  • Configuration Drift
  • Snowflakes and Phoenixes

 

Master
Privacy policy | Modern Slavery statement | Accessibility
Connect with us
×

WeChat

QR code to ThoughtWorks China WeChat subscription account
© 2021 ThoughtWorks, Inc.