gocd-contrib / ansible-gocd

Ansible playbook to install ThoughtWorks open-source continuous delivery tool, Go. Also available on Ansible Galaxy https://galaxy.ansible.com/list#/roles/1690
http://www.go.cd/
MIT License
70 stars 57 forks source link

Snap-CI

ansible-gocd

Ansible Playbook to install Go.

Model even the most complex build & deploy workflow with ease. Unlike CI servers, Go was built from the ground up with pipelines in mind. Go makes it simple to model failing fast, artifact promotion, self-service environments and single-click deployment.

Product details are available at http://www.go.cd . Source available at https://github.com/GoCD/GoCD

requirements

installation instructions

This repository is organized as a multi-role playbook. In order to use it in an existing playbook, you must reference the roles as follows:

roles:
  - tpbrown.gocd/roles/common
  - tpbrown.gocd/roles/agent
  - tpbrown.gocd/roles/server

The default is to install the latest version of the server and agent. To force installation of a specific version override GOCD_GO_VERSION to the desired version.

Server

<pipelines group="goAdmin">
    <pipeline name="backupGo" isLocked="true">
      <timer>0 10 * * * ?</timer>
      <environmentvariables>
        <variable name="ADMIN_USER">
          <value>admin</value>
        </variable>
        <variable name="ADMIN_PASSWORD">
          <value>insecure</value>
        </variable>
      </environmentvariables>
      <materials>
        <git url="git@github.com:YourUser/YourBackupRepo" dest="remote">
          <filter>
            <ignore pattern="*" />
          </filter>
        </git>
        <git url="file:///var/lib/go-server/db/config.git" dest="local" />
      </materials>
      <stage name="defaultStage">
        <jobs>
          <job name="defaultJob">
            <tasks>
              <exec command="/bin/sh">
                <arg>/usr/share/go-server/backup_to_git.sh</arg>
              </exec>
            </tasks>
            <resources>
              <resource>OnServer</resource>
            </resources>
          </job>
        </jobs>
      </stage>
    </pipeline>
  </pipelines>

Optional Configuration Items

This capability is basic now, but the goal is to support full configuration of Go via source control with no dependency on the UI. Hopefully this will include the ability to use individual pipeline configuration files that are included in the resulting Go configuration file.

THIS IS A WORK IN PROGRESS: PLEASE MONITOR YOUR GO LOGS TO DETECT INVALID CHANGES. Sorry.

This role can manage the base Go configuration, without losing agent or pipeline definitions.

Agents

developing

Fork away! Pull requests are always appreciated. :-)

You should be able to do a vagrant up and have a running instance of this role. Take a look inside Vagrantfile and you'll notice we're forcing a role_path on Ansible.

It's been tested on Vagrant 1.5.1 thru 1.6.5 with VirtualBox primarily, with a little attention paid to Docker.

Vagrant 1.8.5 has also been tested. Should you encounter "Warning: Authentication Failure" when attempting to use vagrant up, the issue can be remedied with this patch for Vagrant.