dox Executable Documentation

Vcs integration

Projects can be checked-out and updated automatically

Updating by web hook

Projects can be updated using a web hook

Given the project 'Project'
Given the folder 'user/projects/Project/.git'
When I send a 'post' request to 'projects/Project'
Then executed command 1 should be 'cd [root]/user/projects/Project && git pull origin master'
Then the response should be 'OK - Updated Project'

Do not update if not under git

Given the project 'Project'
Given the folder 'user/projects/Project'
When I try to send a 'post' request to 'projects/Project'
Then an exception should be thrown containing 'Not a git repository'

Clone on demand

If the project files don't exist yet, they are cloned

Given the project 'MyProject'
Given the project 'MyProject' has the repository url 'some/repo.git'
When I request the resource at 'projects/MyProject'
Then executed command 1 should be 'mkdir [root]/user/projects/MyProject'
Then executed command 2 should be 'cd [root]/user/projects/MyProject && git clone some/repo.git .'

Clone fails if no repository is set

Given the project 'MyProject'
When I try to send a 'get' request to 'projects/MyProject'
Then an exception should be thrown containing 'Cannot clone [MyProject]. No repository set.'

Do not clone if folder exists

Given the project 'MyProject'
Given the project 'MyProject' has the repository url 'some/repo.git'
Given the folder 'user/projects/MyProject'
When I try to send a 'get' request to 'projects/MyProject'
Then an exception should be thrown containing 'Project folder already exists'