Git Product home page Git Product logo

library's Introduction

Library

A repository of step templates and other community-contributed extensions to Octopus Deploy. The website to download step templates from is https://library.octopus.com.

Organization

  • Step templates are checked into /step-templates as raw JSON exports direct from Octopus Deploy
  • The library website is largely under /app, with build artifacts at the root of the repository
  • The /tools folder contains utilities to help with editing step templates

Contributing step templates or to the website

Read our contributing guidelines for information about contributing step templates and to the website.

Reviewing PRs

When reviewing a PR, keep the following things in mind:

  • Id should be a GUID that is not 00000000-0000-0000-0000-000000000000
  • Version should be incremented, otherwise the integration with Octopus won't update the step template correctly
  • Parameter names should not start with $
  • The DefaultValues of Parameters should be either a string or null.
  • LastModifiedBy field must be present, and (optionally) updated with the correct author
  • If a new Category has been created:
    • An image with the name {categoryname}.png must be present under the step-templates/logos folder
    • The switch in the humanize function in gulpfile.babel.js must have a case statement corresponding to it

library's People

Contributors

adamoctoclose avatar bcullman avatar benjimac93 avatar bobjwalker avatar damianmac avatar daniellittledev avatar dependabot[bot] avatar devopsderek avatar domrichardson avatar droyad avatar ekrapfl avatar harrisonmeister avatar hnrkndrssn avatar jburger avatar joaoasrosa avatar matt-richardson avatar mcasperson avatar mikeclayton avatar mjrichardson avatar nblumhardt avatar octocrock avatar pascaln2 avatar paulstovell avatar pawelpabich avatar ryanrousseau avatar severswoed avatar timhunt303 avatar twerthi avatar xtreampb avatar zogamorph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

library's Issues

IIS Create Template Incorrectly handles virtual directory parent checking

Trying to do a deployment where there is a parent virtual directory not tied to an app pool. Script failed with "Failed to ensure parent". I thought well thats odd as the physical path is there and it shoudln't need an app pool tied to that parent - I'll just update the script to handle it. Someone had handled it but there is a bug in the script.

Code in Question:

Write-Host "Getting web site $parentSite"
# Workaround to bug in Get-WebSite cmdlet which would return all sites
# See http://forums.iis.net/p/1167298/1943273.aspx / http://stackoverflow.com/a/6832577/785750
$site = Get-WebSite  | where { $_.Name -eq $parentSite }
if (!$site) {
    throw "The web site '$parentSite' does not exist. Please create the site first."
}

$path = $site.PhysicalPath;
$parts = $virtualPath -split "[/\\]"
$name = ""

for ($i = 0; $i -lt $parts.Length; $i++) {
    $name = $name + "/" + $parts[$i]
    $name = $name.TrimStart('/').TrimEnd('/')
    if ($i -eq $parts.Length - 1) {

    }
    elseif ([string]::IsNullOrEmpty($name) -eq $false -and $name -ne "") {
        Write-Host "Ensuring parent exists: $name"

        $path = [IO.Path]::Combine($path, $parts[$i])  # yields something like %SystemDrive%\inetpub\wwwroot\SomeFolder
        $app = Get-WebApplication -Name $name -Site $parentSite

        if (!$app) {
            $vdir = Get-WebVirtualDirectory -Name $name -site $parentSite
            if (!$vdir) {
                Write-Verbose "The application or virtual directory '$name' does not exist"
                if([IO.Directory]::Exists($path) -eq $true) #Does not evaluate Environment Variables
                {
                    Write-Verbose "Using physical path '$path' as parent"
                }
                else
                {
                 #   New-WebVirtualDirectory -Site $parentSite -Name ContosoVDir -PhysicalPath c:\inetpub\contoso
                    throw "Failed to ensure parent"
                }
            }
            else
            {
                $path = $vdir.PhysicalPath
            }
        }
        else
        {
            $path = $app.PhysicalPath
        }
    }
}

The two lines in questions (with the comments i've added for visiblity) are

$path = [IO.Path]::Combine($path, $parts[$i])  # yields something like %SystemDrive%\inetpub\wwwroot\SomeFolder

if([IO.Directory]::Exists($path) -eq $true) #Does not evaluate Environment Variables

The problem is DirectoryExists won't evaluate the environment variables and instead return false when the physical path will indeed exist on the machine.

Easy Verification:

C:\Projects> [IO.Directory]::Exists("%SystemDrive%")
False
C:\Projects> [IO.Directory]::Exists("C:")
True
C:\Projects> [IO.Directory]::Exists([System.Environment]::ExpandEnvironmentVariables("%SystemDrive%"))
True

Will submit pull request with fix.

Question: Octopus URL system variable

Is there a default variable for the canonical URL where the Octopus instance is running?

I have a template where I want to send a link to a deployment task, and I'd like to have some variable like Octopus.Web.BaseUrl that would be equal to something like https://my-octopus.example.com/.

I suppose this would be difficult since by default Octopus allows multiple host headers and ports to be bound to it, but would make life simpler for me.

Enable 32bit applications always resolving to true

When creating application pools on the servers, we have unchecked the box to install as a 32 bit application. Once the app pool is created, it is set to a 32 bit application. I have also modified the default value of the parameter to be equal to false. When I create a new release and deploy, the pool is still created as a 32 bit application. I am testing on my side to figure out how to create the pool as a 65 bit pool. Could someone look into this also?

Creating a release in GitHub requires passing boolean values

In github-tag-release.json we pass the string value of the checkboxes for draft and prerelease settings, this used to work but failed this morning when doing a release.

Fix is to use [bool]::Parse for the draft and prerelease values and pass that to the GitHub API.

Favicon

It's the small things! :)

IIS Website Create Step Template - SSL Binding Issue

Hi,

It seems a invalid variable has crept into this template that causes it to fail to create an SSL binding in certain scenarios.

This below line uses a variable that is never initialized or assigned to ($ipAddress). I think it is just a typo and should in fact be using this variable '$bindingIpAddress'.

$sslBindingsPath = (\"IIS:\\SslBindings\\\" + $ipAddress + \"!\" + $port)

Let me know if you want a pull request for this one.

Awesome product by the way!

Thanks,

Jon

Step Template Structure

I started working on a step template and got stuck on the recommended article: http://www.lavinski.me/making-great-octopus-powershell-step-templates/

I like the idea of testing the script outside of Octopus and providing parameter validation, but struggled a bit. In a nutshell:

  • I didn't want to define my parameters in three different spots in my script
  • I found a few problems specifying required parameters, then I noticed the basic script at the bottom doesn't work (run it without parameters and it doesn't throw an error).

So assuming I'm not missing anything, I created a function for testing. It sets up $OctopusParameters and then calls a tweaked/shortened version of the blog's example. See my Gist for an example.

I plan to create a pull request for my step when it is finished. If there is interest in adopting this style of testing, I was curious if there is a place I could through that script.

update a step?

i have been using the SQL Database Backup step for quite a while in several projects. Now I see there's an update (I'm on v5 and the one here is v6). How do I update (re-import) my step in Octopus Deploy without having to re-add the step to all my projects?

I know I can change the Powershell script manually but I want to re-import so I know I'm getting the changes represented here.

Thx

newrelic-complete-deployment returning HTTP 422 "Unprocessable Entity"

The newrelic-complete-deployment template seems to cause an HTTP 422 when sending the POST to NewRelic. After debugging, looks like this is happening because the body is malformed. The $body hashtable is being declared by using &deployment. Removing the ampersand makes the request successful.

SSRS step template error - Cannot find LoadReportDefinition method

Hi,

We have been trying to use the step template to deploy SSRS reports and shared datasets found here: https://library.octopusdeploy.com/#!/step-template/actiontemplate-deploy-ssrs-reports-from-a-package

One problem we are getting is that the following piece of code which is located in the Update-ReportParameters function is failing:

$ExecutionInfo = $ReportExecutionProxy.LoadReportDefinition($ReportData, [ref] $ReportExecutionWarnings);

For some reason it can't find the method LoadReportDefinition on the $ReportExecutionProxy object. We have stepped through it using Powershell ISE and the method doesn't even appear in the code autocomplete. Is there any work around for this or maybe a missing namespace?

Chocolatey Install template does not pass -y when choco is > 0.9.9

The Chocolatey Install Template currently does not pass the required params when 0.9.9.5 or above is installed.

The -y or similar should be added from the Install Cmds

e.g.

Installing package conemu from the Chocolatey package repository...
Info    22:08:44
Chocolatey v0.9.9.5
Installing the following packages:
conemu
By installing you accept licenses for the packages.
Info    22:08:52
ConEmu v15.5.4.0
Info    22:08:54
The package ConEmu wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Do you want to run the script?
 1) yes
 2) no
 3) print

Will try to send a PR soon.

Variables - Substitute in Files

Hi,
We using Octopus version 2.6.5.1010, and in the C:\Octopus\Applications.SQ-TWSYDSV633-1FF6A2BC\Octopus.Tentacle\2.6.5.1010\Octopus.Platform.dll' I can see the Octopus.Platform.dll but I'm getting the below error. Can anyone help?

Add-Type : Could not load file or assembly 'file:///C:\Octopus\Applications.SQ-TWSYDSV633-1FF6A2BC\Octopus.Tentacle\2.6.5.1010\Octopus.Platform.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

At C:\Users\sabiztalkdev\AppData\Local\Tentacle\Temp\a8924e8f-3e75-474e-aea8-42

  • Add-Type <<<< -Path ($OctopusParameters['Octopus.Tentacle.Agent.ProgramDirecoryPath'] + "\Octopus.Platform.dll")
    • CategoryInfo : NotSpecified: (:) [Add-Type], BadImageFormatException
    • FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand

Info 09:09:04

PowerShell exit code: 1

Fatal 09:09:04
PowerShell script returned a non-zero exit code: 1
Tentacle version 2.6.5.1010

Support specifying multiple authentication options when creating IIS Web Site

Right now the IIS WebSite - Create step template only allows selecting a single authentication option. However, some web sites might want to allow mixed authentication modes where some content is public and some content is secured. It should be possible to specify multiple authentication options via the step template to support this kind of scenario.

Step templates from PowerShell DSC modules

Hi,

I'm working on a PS script that generates step templates from DSC modules. I think it might be useful to someone but I didn't find any info on how to contribute something other than a step template. Any suggestions?

Add JSON Linting to gulp build

npm install --save-dev gulp-jsonlint

var jsonlint = require("gulp-jsonlint");

gulp.task('lint:step-templates', () => {
  return gulp.src('./step-templates/*')
    .pipe($.expect({ errorOnFailure: true }, glob.sync('step-templates/*.json')))
    .pipe(jsonlint())
    .pipe(jsonlint.reporter());
});

iis-change-app-offline-online.json is incorrect

I think the variable are declared incorrectly and the logic is flawed. The last if statement that removes the offline html doesn't make sense to me. If your taking the application offline why would you remove the existing offline file? I think instead the logic should be used when your moving the application online. If both the online and offline files exists - just remove the offline file. I attached what I think is the correct approach.

export.txt

Problem with community step template: Deploy SSRS Reports from a package

@twerthi Thanks for the great step template (#150)

I found an issue with it that Iโ€™m trying to fix, but maybe you can help out.

When deploying a report with 2 datasets that each target a different shared data source, the targeted data sources get swapped:

image

I think the problem is in the script function Set-ReportDataSources, but I'm weak with powershell, so it's taking me some effort to debug it. Can you lend a hand?

Template ideas

Ideas for new templates are collated (informally) here. Before starting work on a new template, feel free to post an issue or comment asking for opinions This list isn't definitive - it's best to check the library site too.

  • Azure: VIP swap between staging/production
  • Git: Pull a repository
  • Git: Push a repository
  • Git: Tag a branch
  • Services: Stop a Windows service
  • Services: Start a Windows service
  • Services: Restart a Windows service
  • Services: Set service restart conditions
  • File system: XPath poke a file
  • File system: Find & replace in file
  • Comms: Send a message to HipChat
  • SQL: Create a database
  • SQL: Backup a database
  • SQL: Restore a database
  • SQL: Run a SQL script
  • SQL: Deploy a .dacpac
  • IIS: Delete website
  • IIS: Delete application pool
  • IIS: Create an application pool
  • IIS: Configure common application pool settings
  • IIS: Create a website
  • IIS: Create an application
  • IIS: Create a virtual directory
  • NuGet: Push a NuGet package
  • Build & test: Run MSBuild
  • Build & test: Run NUnit
  • Octopus: Deploy/promote a release
  • Chocolatey: Install Chocolatey
  • Chocolatey: Install a package
  • Windows: Ensure a set of Windows Features are installed (e.g., IIS)
  • Windows: Create/configure a scheduled task
  • Windows: Ensure a VPN connection is open
  • Windows: Ensure a VPN connection is closed
  • TFS: Update state of work items associated with a given team build
  • TFS: Update "fixed in" field of work items associated with a given team build
  • TFS: Update build quality of a given team build
  • EC2: Remove machine from load balancer
  • EC2: Add machine to load balancer
  • Ensure a Windows user account exists
  • Remove a user account
  • Collect a file
  • Collect a folder
  • Push via WebDeploy
  • Variables - Substitute in Files
  • Install a TopShelf service
  • Create an MSMQ message queue

Pop-out/overlay "full" view of scripts/templates

Currently long lines in scripts or templates are cut off with an ellipsis. Rather than show ugly scroll bars (which are an option) it might be nicer to have a "full screen" button that opens an expanded/scrollable view over the top of the page.

"IIS Application - Create" step template incorrectly check for parent site existence

The "Get-Website" cmdlet is used which has an active bug that ignores the -name parameter thus returning all websites. So the following check just checks if any website exist:

$site = Get-Website -name $parentSite
if (!$site) {
    throw "The web site '$parentSite' does not exist. Please create the site first."
}

It should instead be changed to:

try{
   **$site = Get-Website |?{$_.Name -eq $parentSite}**
} 
catch [System.IO.FileNotFoundException]{
   $site = Get-Website |?{$_.Name -eq $parentSite}
} 
finally {
    Write-Host $site.name # or do whatever meaningful thing we want to do...
}

Or similar.

Update AppPool for existing Applications

The "IIS Application - Create" template will set app pool when it creates an application but does not update the value if the applications already exists. I see that it will change the physical path but was there a reason for not updating the application pool? If this was simply an omission I can provide a PR.

Step Template - Windows Add Users to Local Groups

I believe this template has a bug? If I try to assign a domain user to a local group that contains a local account on the workstation (ie the local administrator account) I receive the following error:

foreach : Error while invoking GetType. Could not find member.
At line:67 char:30

  • ... ($members | foreach {$_.GetType().InvokeMember("Name", 'GetProperty', ...

$isInGroup = ($members | foreach {$.GetType().InvokeMember("Name", 'GetProperty', $null, $, $null)}) -contains "$($user.Name)"

I think it has trouble parsing local account objects? I found this while trying to use it to add an IIS virtual account (IIS AppPool\AppPoolName) to a local group (having problems with this too).

Any help would be appreciated!
Thank you,
Chris

Getting Website Running Locally

just tried getting the website up and running locally to make a few small contributions, but unable to get it up and running. I am presuming it's an angular express js app. What commands should I be running to get it started? (npm start?) Tried a few things but just ending up with this error

Error: ENOENT, stat '/Users/u/github/library/public/index.html'

case sensitive iis-app-create.json

This script (iis-app-create.json) must be tested better.
I tried to used it as-is but it failed multiple times, because powershell is case sensitive (at least on my servers).

IIS-AppPool Create Step Template doesn't cover all Runtime Options

Great library. I ran into an issue when I needed to create a new Application Pool that specifically didn't use a .NET CLR, instead using the "No managed code" option.

The correct way to set this in the library is to just set the ManagedRuntimVersion to an empty string. So I modified the step template on my own Octopus server and added in an option;

None|No Managed Code

And then in the relevant section of the script;

    IF ($appPoolManagedRuntimeVersion -ne "None")
    {
        Write-Output "Setting: ManagedRuntimeVersion = $appPoolManagedRuntimeVersion"
        $pool.ManagedRuntimeVersion = $appPoolManagedRuntimeVersion
    }
    else 
    {
        Write-Output "Setting: ManagedRuntimeVersion = None"
        $pool.ManagedRuntimeVersion = ""
    }

Not entirely sure how to push changes to public repos on GitHub, so posting it here.

Support EnabledProtocols within IIS Application - Create

Currently there is no way to bind multiple protocols for an application. There could be sites that have applications supporting different protocols like 'http,net.msmq' for example. The IIS Application - Create step template should support customizing the supported protocols.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.