Create Large number of Projects

binh.au's Avatar

binh.au

19 May, 2017 04:21 PM

I'm looking at a situation where we may receive large number of different web applications for deployment. The design I have in mind is that each application will be a project and all the application project will have the same deployment steps. The only difference between the application project will be:
1) Target Role
2) Variable values

I need a means to quickly create (plus recreate if change occurs) these project and I came up with the following solution:
1) Auto generate the project from scratch using powershell script (instead of the UI) - which will allow me to source manage project construction.
       - The question here is, how difficult is this and do we have any sample code to do this?
2) Create a Project template using the UI and then Clone and amend the project using powershell.
       I've found the script to do the Clone project and Amend the Variables. Now how do you amend Step details (e.g. Role)

It would be interesting to hear whether you have any other suggest on how we can tackle the setup of large quantity of application.

  1. Support Staff 1 Posted by Daniel Fischer on 22 May, 2017 01:57 AM

    Daniel Fischer's Avatar

    Hi,

    Thanks for getting in touch! From what I can see, it does not look like we have anything currently written for this. However, we do have a quite extensive wiki for our API which I can help by pointing out appropriate pages and documentation.

    The first place to start would be the GitHub and docs page for our API:
    https://github.com/OctopusDeploy/OctopusDeploy-Api
    https://octopus.com/docs/api-and-integration/octopus-rest-api

    The docs have some basic info and links to the GitHub API page. The GitHub page has links to the API wiki and a bunch of example scripts that have been useful at one point or another. You should be able to use these example scripts alongside the API wiki to create a script to do what you are after.

    In our API wiki we have some instructions on creating projects via the API:
    https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/Projects

    There is also a section on creating deployment steps:
    https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/DeploymentS...

    As for your second idea, there are users who create a single reference project and clone it multiple times in the UI. You could then use PowerShell and the above API info to make these changes.

    Again, this will all require quite a bit of coding on your end as I cannot find any example code to do this with.

    Let me know what you think here. 

    Best regards,
    Daniel

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac