NEW FEATURES:
* None
BBDD CHANGES:
* Not needed
OCTOPUS CHANGES:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$OctopusAPIkey = ""#Octopus API Key | |
$OctopusURL = ""#Octopus Server URL | |
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey } | |
(Invoke-WebRequest $OctopusURL/api/machines/all -Headers $header).content | ConvertFrom-Json | ?{$_.isdisabled -eq $true} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AppPoolName = "" #Name of your app pool | |
$Mode = "" #For "Integrated" set this value to "0" and for "Classic" set it to "1" | |
Import-Module WebAdministration | |
Get-ChildItem IIS:\AppPools | ?{$_.Name -eq $AppPoolName} | Select-Object -ExpandProperty PSPath | %{ Set-ItemProperty $_ managedPipelineMode $mode -Verbose} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name : NY-Tentacle2 | |
ID : Machines-541 | |
Thumbprint : 1F8BA8ABBCD253940D33DD26E4B803622371F21B | |
URI : https://ny-tentacle1:10934/ | |
IsDisabled : False | |
EnvironmentName : {Staging} | |
Roles : {WebServer} | |
HasLatestCalamari : False | |
CommunicationStyle : Listening | |
Status : CalamariNeedsUpgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Id": "Channels-221", | |
"Name": "App 1 Channel", | |
"Description": null, | |
"ProjectId": "Projects-128", | |
"LifecycleId": null, | |
"IsDefault": true, | |
"Rules": [ | |
{ | |
"Id": "ba895979-5b6f-4a43-a3f6-ee8375ad40a9", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"Id": "Projects-821", | |
"VariableSetId": "variableset-Projects-821", | |
"DeploymentProcessId": "deploymentprocess-Projects-821", | |
"IncludedLibraryVariableSetIds": [], | |
"DefaultToSkipIfAlreadyInstalled": false, | |
"TenantedDeploymentMode": "Untenanted", | |
"VersioningStrategy": { | |
"DonorPackageStepId": null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
This script should run from: | |
- A script step | |
- That's executed on the Octopus Server | |
- With a Window size of 1 | |
It'll create an output variable called "MachineNames" Which will have the names of the machines (in octopus, so not the same as $env:computername). | |
To learn more about the usage of output variables read http://octopusdeploy.com/blog/fun-with-output-variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##CONFIG## | |
$Role = "" #Role you want to look for | |
$OctopusAPIkey = "" #API Key for the API calls to get the machine names. Recommended to use a Sensitive Project variable for this. | |
##PROCESS## | |
$OctopusURL = $OctopusParameters['Octopus.Web.BaseUrl'] | |
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey } | |
$MachineIDs = ($OctopusParameters["Octopus.Environment.MachinesInRole[$Role]"]).Split(',') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not exists (select column_name from INFORMATION_SCHEMA.columns where TABLE_SCHEMA = 'dbo' and table_name = 'Deployment' and column_name = 'ChannelId') | |
BEGIN | |
ALTER TABLE dbo.Deployment ADD ChannelId nvarchar(50) NULL | |
END | |
GO | |
| |
-- Update column from json blob. Try to extract rather than joining on Release since it may have changed. | |
UPDATE dbo.Deployment | |
SET ChannelId = c.Id | |
FROM dbo.Deployment d INNER JOIN dbo.Channel c ON d.[JSON] LIKE '%"ChannelID":"' + c.Id + '"%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Glossary: | |
- "Octopus user": A user created by the Octopus server. This user can be created when the Octopus server is in either "User/Password" or "Active Directory" authentication method. These users can be found in the table "Users" | |
- "AD User": An active directory user. This is the one sitting on the AD domain database | |
- "UserPass User": An Octopus user created when a user logs in while the Octopus Server is in User/Password authentication method. | |
When an "AD User" or a "UserPass User" log into the web portal for the first time, Octopus creates an "Octopus User" for them on the database. This user will have its own ID, which will grant him access to the teams. You can see this on the "Team" table on the column "MemberuserIds" | |
The goal of this script is to help users map an "Octopus user" to another "Octopus user". Both could have been created based on an "AD user" or as a "UserPass User" |