Skip to content

Instantly share code, notes, and snippets.

View Dalmirog-zz's full-sized avatar

Dalmiro Granas Dalmirog-zz

View GitHub Profile
{
"Projects": [
{
"Id": "Projects-489",
"Name": "3GVCfR95Nn_clone",
"Slug": "3gvcfr95nn-clone",
"ProjectGroupId": "ProjectGroups-128",
"Links": {
"Self": "/api/projects/Projects-489"
}
@Dalmirog-zz
Dalmirog-zz / deploymentjournal.xml
Created March 29, 2016 17:56
deploymentjournalexample
<?xml version="1.0" encoding="utf-8"?>
<Deployments>
<Deployment Id="f425808f-f0da-4a58-936a-e4182c3d17aa" EnvironmentId="Environments-1" ProjectId="Projects-1" PackageId="Testapp" PackageVersion="1.0.13" InstalledOn="2015-12-12 17:48:28" ExtractedFrom="C:\Octopus\Files\Testapp.1.0.13.nupkg-39128d1f-2e6c-450c-b3ae-092b2797792b" ExtractedTo="C:\Octopus\Applications\Development\Testapp\1.0.13" RetentionPolicySet="Environments-1/Projects-1/Step-Deploy/Machines-2/&lt;default&gt;" CustomInstallationDirectory="c:\deploy" WasSuccessful="False" />
<Deployment Id="385f2ed5-3786-4214-be45-993c6e910467" EnvironmentId="Environments-1" ProjectId="Projects-1" PackageId="Testapp" PackageVersion="1.0.13" InstalledOn="2015-12-12 17:50:32" ExtractedFrom="C:\Octopus\Files\Testapp.1.0.13.nupkg-39128d1f-2e6c-450c-b3ae-092b2797792b" ExtractedTo="C:\Octopus\Applications\Development\Testapp\1.0.13_1" RetentionPolicySet="Environments-1/Projects-1/Step-Deploy/Machines-2/&lt;default&gt;" CustomInstallationDirectory="c:\deploy" WasS
{
"ItemType": "Interruption",
"IsStale": false,
"TotalResults": 1,
"ItemsPerPage": 30,
"Items": [
{
"Id": "Interruptions-61",
"Title": "Manual intervention",
"Created": "2016-02-10T17:13:58.287+00:00",
@Dalmirog-zz
Dalmirog-zz / getlicenselimitinfo.ps1
Created March 24, 2016 17:40
GetLicenseLimitInfo
##CONFIG##
$OctopusAPIkey = "" #API Key. Needs to belong to a user with Admin permissions.
$OctopusURL = "" #Octopus URL
$LicenseLevel = "" #Accepted values are "Team","Professional","Enterprise"
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$Projects = ((Invoke-WebRequest $OctopusURL/api/projects/all -Headers $header).content | ConvertFrom-Json).count
@Dalmirog-zz
Dalmirog-zz / ArtifactDownload.ps1
Created March 23, 2016 21:41
Download Artifact from same release by name
<#
This script will list all the artifacts related to this release and then It'll download
the one declared on the variable $ArtifactName to the path $downloadPath
Lets say you create an artifact when you deploy to Staging and you want to download
it during your deployment to Production. This script will use the current release ID at the time of the Prod deployment (which would be shared
between your deployment to Stage and to Prod) and then It'll use the octopus API to fetch the artifact.
#>
##Config (What you need to touch)

By doing a GET to /api/machines/all you'll get a list of all the Machines registered in Octopus. Each of them will look a bit like this:

{
    "Id": "Machines-28",
    "Name": "T1Listening1",
    "Thumbprint": "5B39B11EA8804D9E02E8D10189343074891BED21",
    "Uri": "https://ny-tentacle1:10933/",
    "IsDisabled": false,
 "EnvironmentIds": [
@Dalmirog-zz
Dalmirog-zz / DiscoverandAddTentacles.md
Last active February 23, 2016 14:29
Discovering and adding Tentacles

From the web portal you'll normally do:

  1. Click on "Add new Deployment Target" on the Environments page.

  2. Hit the "Discover" button to automatically populate the Tentacle Thumbprint by giving the Tentacle FQDN/IP and Port.

  3. Fill the Tentacle name, environments, roles and then click "Save".

@Dalmirog-zz
Dalmirog-zz / createservice.ps1
Created February 22, 2016 22:29
BrianH script
$cloudservice= 'rdc-sb-test-auto7'
Get-AzureAccount -debug
#Change: added -debug to the cmdlet
$existingcloudservice= Get-AzureService -ServiceName $cloudservice -ErrorActionSilentlyContinue -debug
if ($existingcloudservice) {
Write-Host "Cloud Service named $cloudservice already exists, no need to provision it."
}
@Dalmirog-zz
Dalmirog-zz / RenameCSCFG.ps1
Created February 18, 2016 16:41
rename cscfg file
$EnvironmentName = $OctopusParameters['Octopus.Environment.Name']
$cscfgFile = Get-ChildItem | ?{$_.Name -like "*cscfg"}
if($cscfgFile.count -ne 1){
Write-error "Amount of .CSCFG files found: $($cscfgFile.count) . There should be (only) 1 CSCFG file"
}
Rename-Item -path $cscfgFile.FullName -NewName "ServiceConfiguration.$EnvironmentName.cscfg" -Verbose
@Dalmirog-zz
Dalmirog-zz / script.ps1
Created February 17, 2016 13:30
Get Lifecycle phases info
##CONFIG
$OctopusURL = "" #Octopus URL
$OctopusAPIKey = "" #Octopus API Key
$LifecycleName = "" #Name of the Lifecycle you want to get info from
##PROCESS
$header = @{ "X-Octopus-ApiKey" = $env:OctopusAPIKey }