Skip to content

Instantly share code, notes, and snippets.

@tomzo
Last active August 29, 2015 14:24
Show Gist options
  • Save tomzo/5e17c7d193dd2426ed83 to your computer and use it in GitHub Desktop.
Save tomzo/5e17c7d193dd2426ed83 to your computer and use it in GitHub Desktop.
Proposed JSON examples for Go configuration plugins

Groups

{
  "groups" : [
    {
      "name" : "g1",
      "pipelines" : [ ... ]
    },
    {
      "name" : "g2",
      "pipelines" : [ ... ]
    }
  ]
}

Pipeline

Skipped:

  • template
  • params
{
  "name" : "pipeline1",
  "labelTemplate" : "1.2-${COUNT}",
  "isLocked" : true,
  "trackingTool" : {
    "link" : "url",
    "regex" : ""
  },
  "mingle" : {
    "baseUrl" : "url",
    "projectId" : "myproject",
    "mql" : "some criteria"
  },
  "timer" : {
    "timerSpec" : "* * * * 5",
    "onlyOnChanges" : true
  },
  "environmentVariables" : [
     {
       "name" : "var1",
       "value" : "plaintext"
     },
     {
       "name" : "secret1",
       "encryptedvalue" : "34gssi37543"
     }
  ],
  "materials" : [ ... ],
  "stages" : [ ... ]
}

Stages

"stages" : [
  {
    "name" : "build",
    "fetchMaterials" : true,
    "artifactCleanupProhibited" : false,
    "cleanWorkingDir" : false,
    "approval" : {
      "type" : "manual",
      "auth" : { ... }
    },
    "environmentVariables" : [
       {
         "name" : "var2",
         "value" : "plaintext"
       },
       {
         "name" : "secret1",
         "encryptedvalue" : "34i37543"
       }
    ],
    "jobs" : [ ... ]
  }
]

Jobs

"jobs" : [
  {
    "name" : "build",
    "environmentVariables" : [
       {
         "name" : "var2",
         "value" : "plaintext"
       },
       {
         "name" : "secret1",
         "encryptedvalue" : "34i37543"
       }
    ],
    "tabs" : [
      {
        "name" : "test",
        "path" : "testresults.xml"
      }
    ],
    "resources" : [ "win7", "NET_4" ],
    "artifacts" : [
      {
        "src" : "path1",
        "dest" : "path2",
        "type" : "file"
      }
    ],
    "properties" : [
      {
        "name" : "coverage.class",
        "src" : "target/emma/coverage.xml",
        "xpath" : "substring"
      }
    ],
    "runOnAllAgents" : true,
    "runInstanceCount" : 7,
    "timeout" : 120,
    "tasks" : [ ... ]
  }
]

Materials

"materials" : [
  {
    "type" : "svn",
    "url" : "http://svn"
  },
  {
    "type" : "git",
    "url" : "http://git",
    "branch" : "develop"
  },
  {
    "type" : "pipeline",
    "pipeline" : "some-pipe",
    "stage" : "test"
  },
  {
    "type" : "package",
    "packageId" : "someapt",
  },
  {
    "type" : "pluggablescm",
    "scmId" : "mygit",
    "folder" : "dir",
  }
]

Tasks

"tasks" : [
    {
        "type" : "ant",
        "antFile" : "src/build.xml"
    },
    {
      "type" : "fetchartifact",
      "pipelineName" : "pipe1",
      "stage" : "build",
      "runif" : "passed",
      "oncancel" : {
       "type" : "rake"
      }
    },
    {
      "type" : "exec",
      "command" : "tail",
      "args" : [ "-n", "1000", "test.log" ]
    },
    {
      "type" : "pluggabletask",
      "pluginconfiguration" : {
        "id" : "mytask",
        "version" : "1.2"
      },
      "configuration" : [
        {
          "key" : "file",
          "value" : "src/myfile.txt"
        },
        {
          "key" : "secret",
          "encryptedvalue" : "3276g67gtts##@"
        },
      ]
    }
]

Environments

"environments" : [
  {
    "name" : "dev",
    "environmentVariables" : [
       {
         "name" : "var2",
         "value" : "plaintext"
       },
       {
         "name" : "secret1",
         "encryptedvalue" : "34i37543"
       }
    ],
    "agents" : [ "uuid1" ],
    "pipelines" : [ "pipeline1", "pipeline2" ]
  },
  {
    "name" : "prod"
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment