-
Notifications
You must be signed in to change notification settings - Fork 71
tja-develop branch PR (When a Sitecore instance is selected you can install/uninstall SPS) #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sc-TylerJass
wants to merge
55
commits into
develop
Choose a base branch
from
tja-develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
3012eed
created Install PS button, enabled it as long as an instance is selec…
sc-TylerJass b8aef0a
Added first Wizard step page (not completed, not visible)
sc-TylerJass 6372657
Completed wizard pipeline (bare minumum required, second page to come…
sc-TylerJass ff9c599
Added a new first wizard page to select PS version and provide links …
sc-TylerJass fd6a992
Pipeline processors are working, installation seems good. Project ef…
sc-TylerJass 58dbeea
Added Install Publishing Service button to right click context menu
sc-TylerJass d2c681e
Fixed bug where moving back and forward in wizard incorrectly adds mo…
sc-TylerJass df2f4f4
Added another processor to check the status endpoint after installati…
sc-TylerJass 1168c05
Added completion instructions for installing the PS module afterward
sc-TylerJass 06d6b23
Fixed a typo and added an overwrite option (work in progress)
sc-TylerJass fa65944
Finished overwrite functionality
sc-TylerJass b19b3b8
Finished overwrite functionality
sc-TylerJass 05fa0e0
Created uninstall publishing service button
sc-TylerJass bf278df
Renamed class names and members to use 'SPS' instead of 'PublishingSe…
sc-TylerJass aec2399
Fixed merge conflicts from tja-develop-sps-install branch
sc-TylerJass a81936f
First wizard page created for sps uninstall (work in progress)
sc-TylerJass 644a047
Added sps uninstall to right-click context menu
sc-TylerJass 83f2ced
Cleaned up some code, attempted to add port, but now bad gateway issu…
sc-TylerJass c928506
Resolved bad gateway issue (not caused by port, it was missing connec…
sc-TylerJass 27c9b22
resolved merge
sc-TylerJass 3de75b3
Fixed class name
sc-TylerJass de03f6e
joining branches
sc-TylerJass be23467
Uninstall sps wizard essentially complete (want to pull site name fro…
sc-TylerJass 62849d9
Finished uninstall pipeline
sc-TylerJass 1539d02
Pulled develop branch, resolving final merge conflicts before pull re…
sc-TylerJass 2ebbdfd
Pulled and merged develop into this 'tja-develop' branch to resolve m…
sc-TylerJass c3294ac
Removing exception stacktrace from WindowHelper popup message (previo…
sc-TylerJass b0e6c91
Extended Instance class to return a collection of Roles, and bool pro…
sc-TylerJass 4cd73e2
Install group of Edit tab is no longer visible for all instances, mov…
sc-TylerJass b2f3f4c
Preventing potential NullRefenceExceptions if a package is not selected
sc-TylerJass 0ec9fbd
Removed '#' from wizard pipeline step names
sc-TylerJass 0e1c0ea
SPS Installer now looks for packages in the SIM local repo and any su…
sc-TylerJass 6a69d06
Only display Sitecore Publishing Service packages that are compatible…
sc-TylerJass 17ca458
Fixed visibility for install/uninstall button given the selected inst…
sc-TylerJass 1b80d85
Fixed some potential nullreferenceexceptions, and cleaned up unused u…
sc-TylerJass 3310e93
Removed code that was intended only for debugging
sc-TylerJass 311b466
Removed install/uninstall buttons from context menu
sc-TylerJass bef9012
Made install/uninstall wizard arg titles shorter
sc-TylerJass a4d3116
Initial sps name generated from cm instance name
sc-TylerJass e2721e5
Removed empty region
sc-TylerJass 6b69cbd
Added special case for SPS 312 package name, wrapped IsCompatible bod…
sc-TylerJass ba829ca
Filtered connectionstring selection options and fixed typo
sc-TylerJass 5b3310a
Removed overwrite functionality
sc-TylerJass 491247d
Removed overwrite functionality (last commit, committed too early, no…
sc-TylerJass e993155
Updated instance roles logic
sc-TylerJass a33dbed
Changed auto generated SPS name
sc-TylerJass e446ee0
updated abstract SPSProcessor class
sc-TylerJass 15e3857
Changed directory in the powershell context instead of changing the a…
sc-TylerJass 4cdb9f1
added try-catch around instance role resolving logic
sc-TylerJass bf0f52a
Moved old compatibility to globalsettings config file
sc-TylerJass e223036
Add SPS to environment group when installed, and remove when uninstalled
sc-TylerJass d771238
Fixed bug where SPS instance only joined environment group if the gro…
sc-TylerJass a9f7d78
Instane list refreshes after sps install/uninstall
sc-TylerJass 65c1294
Reorganized SPS Pipeline processors files
sc-TylerJass 1bc8332
Moved all compatibility to globalsettings.config, added compatibility…
sc-TylerJass File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| using System.Management.Automation; | ||
|
|
||
| namespace SIM.Pipelines.PublishingService | ||
| { | ||
| public static class Commands | ||
| { | ||
| private const string SET_CONNECTION_STRING = "configuration setconnectionstring {0} \"{1}\""; | ||
| private const string SCHEMA_UPGRADE = "schema upgrade --force"; | ||
| private const string SCHEMA_RESET = "schema reset --force"; | ||
| private const string IIS_INSTALL = "iis install --sitename \"{0}\" --apppool \"{1}\" --port \"{2}\" --hosts --force"; | ||
|
|
||
| public static string CommandRoot { get; set; } | ||
|
|
||
| public static void SetConnectionString(string connectionStringName, string connectionStringValue) | ||
| { | ||
| ExecuteCommand(SET_CONNECTION_STRING, connectionStringName, connectionStringValue); | ||
| } | ||
|
|
||
| public static void SchemaUpgrade() | ||
| { | ||
| ExecuteCommand(SCHEMA_UPGRADE); | ||
| } | ||
|
|
||
| public static void SchemaReset() | ||
| { | ||
| ExecuteCommand(SCHEMA_RESET); | ||
| } | ||
|
|
||
| public static void IISInstall(string siteName, string appPoolName, int port) | ||
| { | ||
| ExecuteCommand(IIS_INSTALL, siteName, appPoolName, port); | ||
| } | ||
|
|
||
| private static void ExecuteCommand(string commandArgs, params object[] args) | ||
| { | ||
| using (PowerShell PS = PowerShell.Create()) | ||
| { | ||
| PS.AddScript($"Set-Location {CommandRoot}").Invoke(); | ||
| PS.AddScript(string.Format(".\\Sitecore.Framework.Publishing.Host.exe " + commandArgs, args)).Invoke(); | ||
| } | ||
| } | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
src/SIM.Pipelines/PublishingService/Install/AddToEnvironmentProcessor.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using SIM.SitecoreEnvironments; | ||
| using Sitecore.Diagnostics.Logging; | ||
|
|
||
| namespace SIM.Pipelines.PublishingService.Install | ||
| { | ||
| public class AddToEnvironmentProcessor : SPSProcessor<InstallSPSProcessorArgs> | ||
| { | ||
| protected override void ProcessCore(InstallSPSProcessorArgs args) | ||
| { | ||
| try | ||
| { | ||
| SitecoreEnvironment se = SitecoreEnvironmentHelper.GetExistingOrNewSitecoreEnvironment(args.CMInstance.Name); | ||
| if (se.Members == null) | ||
| { | ||
| se.Members = new List<SitecoreEnvironmentMember>(); | ||
| } | ||
|
|
||
| se.Members.Add(new SitecoreEnvironmentMember(args.SPSSiteName, SitecoreEnvironmentMember.Types.Site.ToString())); | ||
| SitecoreEnvironmentHelper.AddOrUpdateSitecoreEnvironment(se); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| Log.Warn(ex, $"Exception thrown while adding new SPS instance to CM environment:\n{ex}"); | ||
| } | ||
| } | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/SIM.Pipelines/PublishingService/Install/CreateIISiteProcessor.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| namespace SIM.Pipelines.PublishingService.Install | ||
| { | ||
| public class CreateIISiteProcessor : SPSProcessor<InstallSPSProcessorArgs> | ||
| { | ||
| protected override void ProcessCore(InstallSPSProcessorArgs args) | ||
| { | ||
| Commands.IISInstall(args.SPSSiteName, args.SPSSiteName, args.SPSPort); | ||
| } | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
src/SIM.Pipelines/PublishingService/Install/InstallSPSProcessorArgs.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| using System.Collections.Generic; | ||
| using System.Data.SqlClient; | ||
| using SIM.Instances; | ||
| using SIM.Pipelines.Processors; | ||
|
|
||
| namespace SIM.Pipelines.PublishingService.Install | ||
| { | ||
| public class InstallSPSProcessorArgs : ProcessorArgs | ||
| { | ||
| #region Properties | ||
| public Instance CMInstance { get; set; } | ||
| public string InstanceFolder { get; set; } | ||
| public string SPSInstanceFolder { get; set; } | ||
| public string SqlAdminUsername { get; set; } | ||
| public string SqlAdminPassword { get; set; } | ||
| public string SPSPackagePath { get; set; } | ||
| public string SPSSiteName { get; set; } | ||
| public string SPSAppPoolName { get; set; } | ||
| public string SPSWebroot { get; set; } | ||
| public int SPSPort { get; set; } | ||
| public Dictionary<string, SqlConnectionStringBuilder> SPSConnectionStrings { get; set; } | ||
|
|
||
| #endregion | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/SIM.Pipelines/PublishingService/Install/PrepareInstallationProcessor.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| using System.IO.Compression; | ||
|
|
||
| namespace SIM.Pipelines.PublishingService.Install | ||
| { | ||
| public class PrepareInstallationProcessor : SPSProcessor<InstallSPSProcessorArgs> | ||
| { | ||
| protected override void ProcessCore(InstallSPSProcessorArgs args) | ||
| { | ||
| ZipFile.ExtractToDirectory(args.SPSPackagePath, args.SPSWebroot); | ||
| Commands.CommandRoot = args.SPSWebroot; | ||
| } | ||
| } | ||
| } |
11 changes: 11 additions & 0 deletions
11
src/SIM.Pipelines/PublishingService/Install/ResetDatabaseSchemaProcessor.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| namespace SIM.Pipelines.PublishingService.Install | ||
| { | ||
| public class ResetDatabaseSchemaProcessor : SPSProcessor<InstallSPSProcessorArgs> | ||
| { | ||
| //Resetting the schema is done to clear any potentially existing Publishing tables | ||
| protected override void ProcessCore(InstallSPSProcessorArgs args) | ||
| { | ||
| Commands.SchemaReset(); | ||
| } | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/SIM.Pipelines/PublishingService/Install/SetActualConnectionStringsProcessor.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using System.Collections.Generic; | ||
| using System.Data.SqlClient; | ||
|
|
||
| namespace SIM.Pipelines.PublishingService.Install | ||
| { | ||
| public class SetActualConnectionStringsProcessor : SPSProcessor<InstallSPSProcessorArgs> | ||
| { | ||
| protected override void ProcessCore(InstallSPSProcessorArgs args) | ||
| { | ||
| foreach (KeyValuePair<string, SqlConnectionStringBuilder> connString in args.SPSConnectionStrings) | ||
| { | ||
| Commands.SetConnectionString(connString.Key, connString.Value.ToString()); | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.