Skip to content

versionone/spigot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spigot

Install

Global install

npm install -g git+ssh://git@github.com:versionone/spigot.git

Cloning

git clone git@github.com:versionone/spigot.git

Developing

Local build

#Install dependencies
npm install

#Build
npm run build

Running

Globally installed

spigot

Local clone

./bin/spigot

Options

spigot --url <url> --username <username> --password <password> --throttle <events per second> --forever --parallel [spigot files]
  • --url Url to VersionOne
  • --username Username
  • --password Password
  • --throttle Number of events per second
  • --parallel Run commands in parallel
  • --forever Repeat spigot infinitely
  • [spigot files] A list of spigot json files

Interact with VersionOne

Creating an asset

{
    "commands": [{
        "command": "create",
        "assetType": "Story",
        "attributes": {
            "Name": "Story 1",
            "Scope": "Scope:0"
        }
    }]
}

Creating an asset n times (requires name).

{
    "commands": [{
        "command": "create",
        "times": "5",
        "assetType": "Story",
        "attributes": {
            "Name": "StoryName",
            "Scope": "Scope:0"
        }
    },
    {
        "command": "create",
        "assetType": "Bundle",
        "attributes": {
            "Name": "Story 1",
            "Workitems":  [
                "{{StoryName 1}}",
                "{{StoryName 2}}",
                "{{StoryName 3}}"
                "{{StoryName 4}}"
            ]
        }
    }]
}

Updating an asset

{
    "commands": [{
        "command": "update",
        "assetType": "Story",
        "oid": "Story:1005",
        "attributes": {
            "Name": "Renamed Story"
        }
    }]
}

Updating a multi relation

{
    "commands": [
        {
            "command": "create",
            "assetType": "Story",
            "attributes": {
                "Name": "Story with owners",
                "Scope": "Scope:0"
            }
        },
        {
            "command": "update",
            "assetType": "Story",
            "oid": "{{Story}}",
            "attributes": {
                "Owners": [
                    "Member:20",
                    "Member:1133",
                    "Member:1134"
                ]
            }
        },
        {
            "command": "update",
            "assetType": "Story",
            "oid": "{{Story}}",
            "attributes": {
                "Owners": [
                    { "idref": "Member:1133", "act": "remove" }
                 ]
            }
        }
    ]
}

Referencing an oid

Use {{<assettype>}} example: {{Story}} or {{Task}}

{
    "commands": [{
        "command": "create",
        "assetType": "Story",
        "attributes": {
            "Name": "Story 1",
            "Scope": "Scope:0"
        }
    }, {
        "command": "create",
        "assetType": "Task",
        "attributes": {
            "Name": "Task 1",
            "Parent": "{{Story}}"
        }
    },
}

Use {{<asset name>}} example: {{Story 1}} or {{A Specific Story}}

{
    "commands": [{
        "command": "create",
        "assetType": "Story",
        "attributes": {
            "Name": "Story 1",
            "Scope": "Scope:0"
        }
    }, {
        "command": "create",
        "assetType": "Task",
        "attributes": {
            "Name": "Task 1",
            "Parent": "{{Story 1}}"
        }
    },{
        "command": "create",
        "assetType": "Task",
        "attributes": {
            "Name": "Task 2",
            "Parent": "{{A Specific Story}}"
        }
    }
}

Executing an Operation

{
    "commands": [{
        "command": "execute",
        "assetType": "Story",
        "oid": "Story:1005",
        "operation": "Inactivate"
    }]
}

Additional

Url

Override the defaults url

{
	"url": "http://<versionone>",
	"commands":[]
}

Username/Password

Overrides the default username and password. This can be useful for simulating multiple users.

{
	"username": "admin",
	"password": "password",
	"commands":[]
}

Incrementing Number

Supply an incrementing number in strings

{
    "username": "admin",
    "password": "admin",

    "commands": [
        {
            "command": "create",
            "assetType": "Story",
            "attributes": {
                "Name": "Story {{number}}",
                "Scope": "Scope:0"
            }
        },
        {
            "command": "create",
            "assetType": "Story",
            "attributes": {
                "Name": "Story {{number}}",
                "Scope": "Scope:0"
            }
        }
	]
}

Array of commands

Multiple command sets can be supplied by multiple files. Using a single file use the following format

[{
    "username": "admin",
    "password": "admin",
    "commands": [{
        "command": "create",
        "assetType": "Story",
        "attributes": {
            "Name": "Story 1",
            "Scope": "Scope:0"
        }
    }]
}, {
    "username": "bob",
    "password": "bob",
    "commands": [{
        "command": "create",
        "assetType": "Story",
        "attributes": {
            "Name": "Story 1",
            "Scope": "Scope:0"
        }
    }]
}, {
    "username": "jennifer",
    "password": "jennifer",
    "commands": [{
        "command": "create",
        "assetType": "Story",
        "attributes": {
            "Name": "Story 1",
            "Scope": "Scope:0"
        }
    }]
}]

About

Create, update, and operate against VersionOne Lifecycle

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published