From c03da74d0bed9dff279182d439ceff26b4cc1b08 Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 12:58:00 -0500 Subject: [PATCH 001/188] Installer code from https://github.com/SitecoreSupport/SitecoreInstaller --- .../GlobalFilesMap.json | 4 + .../GlobalParams90XM1.json | 43 ++++ .../GlobalParams_9.0_XP0.json | 105 ++++++++ .../GlobalParams_9.0_XP1.json | 105 ++++++++ .../GlobalParams_9.1_XP0.json | 201 +++++++++++++++ .../GlobalParams_9.1_XP1.json | 201 +++++++++++++++ src/SIM.Sitecore9Installer/InstallParam.cs | 51 ++++ .../Properties/AssemblyInfo.cs | 36 +++ .../Properties/Resources.Designer.cs | 63 +++++ .../Properties/Resources.resx | 117 +++++++++ .../Properties/Settings.Designer.cs | 26 ++ .../Properties/Settings.settings | 7 + .../SIM.Sitecore9Installer.csproj | 154 ++++++++++++ src/SIM.Sitecore9Installer/SitecoreTask.cs | 172 +++++++++++++ src/SIM.Sitecore9Installer/Tasker.cs | 235 ++++++++++++++++++ src/SIM.Sitecore9Installer/packages.config | 5 + 16 files changed, 1525 insertions(+) create mode 100644 src/SIM.Sitecore9Installer/GlobalFilesMap.json create mode 100644 src/SIM.Sitecore9Installer/GlobalParams90XM1.json create mode 100644 src/SIM.Sitecore9Installer/GlobalParams_9.0_XP0.json create mode 100644 src/SIM.Sitecore9Installer/GlobalParams_9.0_XP1.json create mode 100644 src/SIM.Sitecore9Installer/GlobalParams_9.1_XP0.json create mode 100644 src/SIM.Sitecore9Installer/GlobalParams_9.1_XP1.json create mode 100644 src/SIM.Sitecore9Installer/InstallParam.cs create mode 100644 src/SIM.Sitecore9Installer/Properties/AssemblyInfo.cs create mode 100644 src/SIM.Sitecore9Installer/Properties/Resources.Designer.cs create mode 100644 src/SIM.Sitecore9Installer/Properties/Resources.resx create mode 100644 src/SIM.Sitecore9Installer/Properties/Settings.Designer.cs create mode 100644 src/SIM.Sitecore9Installer/Properties/Settings.settings create mode 100644 src/SIM.Sitecore9Installer/SIM.Sitecore9Installer.csproj create mode 100644 src/SIM.Sitecore9Installer/SitecoreTask.cs create mode 100644 src/SIM.Sitecore9Installer/Tasker.cs create mode 100644 src/SIM.Sitecore9Installer/packages.config diff --git a/src/SIM.Sitecore9Installer/GlobalFilesMap.json b/src/SIM.Sitecore9Installer/GlobalFilesMap.json new file mode 100644 index 00000000..cf7b21ff --- /dev/null +++ b/src/SIM.Sitecore9Installer/GlobalFilesMap.json @@ -0,0 +1,4 @@ +{ + "9.1.\\d.* XP0": "GlobalParams_9.1_XP0.json", + "9.1.\\d.* XP1": "GlobalParams_9.1_XP1.json" +} diff --git a/src/SIM.Sitecore9Installer/GlobalParams90XM1.json b/src/SIM.Sitecore9Installer/GlobalParams90XM1.json new file mode 100644 index 00000000..c46c8631 --- /dev/null +++ b/src/SIM.Sitecore9Installer/GlobalParams90XM1.json @@ -0,0 +1,43 @@ +{ + "Parameters": { + //global + "DeploymentRoot": "c:/sitecores/sc91rev001564XP0", + "SIFVersion": "1.2.1", + "SqlServer": "LT-IVS-T-CA\\SQL2016SP1", + "SqlAdminUser": "sa", + "SqlAdminPassword": "Password12345", + "SqlDbPrefix": "sc90XM1", + "LicenseFile": "", + "DnsName": "$installParams.SiteName", + //solr + "SolrUrl": "https://localhost:8983/solr", + "SolrRoot": "C:/SOLR/solr-6.6.2", + "SolrService": "solr", + "CorePrefix": "$SqlDbPrefix", + "BaseConfig": "", + //Sitecore + "SitecoreAdminPassword": "b", + "SolrCorePrefix": "$CorePrefix", + "SqlCoreUser": "$SqlAdminUser", + "SqlCorePassword": "$SqlAdminPassword", + "SqlWebUser": "$SqlAdminUser", + "SqlWebPassword": "$SqlAdminPassword", + "SqlFormsUser": "$SqlAdminUser", + "SqlFormsPassword": "$SqlAdminPassword", + "SqlMasterUser": "$SqlAdminUser", + "SqlMasterPassword": "$SqlAdminPassword", + "SolrZookeeperUrl": "", + "TelerikEncryptionKey": "" + }, + + "PackageMapping": { + "sitecore-XM1-cd": "* (OnPrem)_cd.scwdp.zip", + "sitecore-XM1-cm": "* (OnPrem)_cm.scwdp.zip" + }, + + "ExecSequense": { + "sitecore-solr": {}, + "sitecore-XM1-cd": {}, + "sitecore-XM1-cm": {} + } +} diff --git a/src/SIM.Sitecore9Installer/GlobalParams_9.0_XP0.json b/src/SIM.Sitecore9Installer/GlobalParams_9.0_XP0.json new file mode 100644 index 00000000..830f63ae --- /dev/null +++ b/src/SIM.Sitecore9Installer/GlobalParams_9.0_XP0.json @@ -0,0 +1,105 @@ +{ + "Parameters": { + //global + "SIFVersion": "1.2.1", + "SqlServer": "", + "SqlAdminUser": "", + "SqlAdminPassword": "", + "SqlDbPrefix": "", + "LicenseFile": "", + //solr + "SolrUrl": "", + "SolrRoot": "", + "SolrService": "", + "CorePrefix": "$SqlDbPrefix", + "BaseConfig": "", + //cert + "CertificateName": "$SqlDbPrefix+_xconnect_client", + "CertPath": "c:/certificates", + "RootCertFileName": "SIF121Root", + //xConnect + "XConnectCert": "$CertificateName", + "SqlMarketingAutomationUser": "$SqlAdminUser", + "SqlMarketingAutomationPassword": "$SqlAdminPassword", + "SqlReferenceDataUser": "$SqlAdminUser", + "SqlReferenceDataPassword": "$SqlAdminPassword", + "SqlProcessingPoolsUser": "$SqlAdminUser", + "SqlProcessingPoolsPassword": "$SqlAdminPassword", + "SqlCollectionUser": "$SqlAdminUser", + "SqlCollectionPassword": "$SqlAdminPassword", + "XConnectEnvironment": "", + "XConnectLogLevel": "", + //Sitecore + "SitecoreAdminPassword": "b", + "SolrCorePrefix": "$CorePrefix", + "SqlCoreUser": "$SqlAdminUser", + "SqlCorePassword": "$SqlAdminPassword", + "SqlWebUser": "$SqlAdminUser", + "SqlWebPassword": "$SqlAdminPassword", + "SqlFormsUser": "$SqlAdminUser", + "SqlFormsPassword": "$SqlAdminPassword", + "SqlMasterUser": "$SqlAdminUser", + "SqlMasterPassword": "$SqlAdminPassword", + "SqlReportingUser": "$SqlAdminUser", + "SqlReportingPassword": "$SqlAdminPassword", + "SqlProcessingTasksUser": "$SqlAdminUser", + "SqlProcessingTasksPassword": "$SqlAdminPassword", + "SqlExmMasterUser": "$SqlAdminUser", + "SqlExmMasterPassword": "$SqlAdminPassword", + "ExmEdsProvider": "", + "EXMCryptographicKey": "", + "EXMAuthenticationKey": "", + "SolrZookeeperUrl": "", + "XConnectCollectionService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "XConnectCollectionSearchService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "XConnectReferenceDataService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "MarketingAutomationOperationsService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "MarketingAutomationReportingService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "ProcessingService": "", + "ReportingService": "", + "ReportingServiceApiKey": "", + "TelerikEncryptionKey": "", + "SqlMessagingUser": "$SqlAdminUser", + "SqlMessagingPassword": "$SqlAdminPassword" + }, + "PackageMapping": { + + "sitecore-XP0": "* (OnPrem)_single.scwdp.zip", + "xconnect-xp0": "* (OnPrem)_xp0xconnect.scwdp.zip", + "sitecore-XP1-cd": "* (OnPrem)_cd.scwdp.zip", + "sitecore-XP1-cm": "* (OnPrem)_cm.scwdp.zip", + "sitecore-XP1-prc": "* (OnPrem)_prc.scwdp.zip", + "sitecore-XP1-rep": "* (OnPrem)_rep.scwdp.zip", + "xconnect-XP1-collection": "* (onPrem)_xp1collection.scwdp.zip", + "xconnect-xp1-collectionsearch": "* (onPrem)_xp1collectionsearch.scwdp.zip", + "xconnect-xp1-MarketingAutomation": "* (onPrem)_xp1marketingautomation.scwdp.zip", + "xconnect-xp1-MarketingAutomationReporting": "* (onPrem)_xp1marketingautomationreporting.scwdp.zip", + "xconnect-xp1-ReferenceData": "* (onPrem)_xp1referencedata.scwdp.zip", + "sitecore-xp1-dds": "* (OnPrem)_dds.scwdp.zip", + "sitecore-XP1-cm-dds-patch": "Sitecore.Patch.EXM (OnPrem)_CM.zip" + }, + + "ExecSequense": { + "xconnect-createcert": {}, + "xconnect-solr": {}, + "sitecore-solr": {}, + "xconnect-xp0": {}, + "sitecore-XP0": {}, + "sitecore-XP1-cd": {}, + "sitecore-XP1-prc": {}, + "sitecore-XP1-rep": {}, + "sitecore-xp1-dds": {}, + "xconnect-xp1-collection": {}, + "xconnect-xp1-collectionsearch": {}, + "xconnect-xp1-MarketingAutomation": {}, + "xconnect-xp1-ReferenceData": {}, + "xconnect-xp1-MarketingAutomationReporting": {}, + "sitecore-XP1-cm": {}, + "sitecore-XP1-cm-dds-patch": {} + + + + + } + +} diff --git a/src/SIM.Sitecore9Installer/GlobalParams_9.0_XP1.json b/src/SIM.Sitecore9Installer/GlobalParams_9.0_XP1.json new file mode 100644 index 00000000..d6814fc7 --- /dev/null +++ b/src/SIM.Sitecore9Installer/GlobalParams_9.0_XP1.json @@ -0,0 +1,105 @@ +{ + "Parameters": { + //global + "SIFVersion": "1.2.1", + "SqlServer": "", + "SqlAdminUser": "", + "SqlAdminPassword": "", + "SqlDbPrefix": "", + "LicenseFile": "", + //solr + "SolrUrl": "", + "SolrRoot": "", + "SolrService": "", + "CorePrefix": "$SqlDbPrefix", + "BaseConfig": "", + //cert + "CertificateName": "$SqlDbPrefix+_xconnect_client", + "CertPath": "c:/certificates", + "RootCertFileName": "SIF121Root", + //xConnect + "XConnectCert": "$CertificateName", + "SqlMarketingAutomationUser": "$SqlAdminUser", + "SqlMarketingAutomationPassword": "$SqlAdminPassword", + "SqlReferenceDataUser": "$SqlAdminUser", + "SqlReferenceDataPassword": "$SqlAdminPassword", + "SqlProcessingPoolsUser": "$SqlAdminUser", + "SqlProcessingPoolsPassword": "$SqlAdminPassword", + "SqlCollectionUser": "$SqlAdminUser", + "SqlCollectionPassword": "$SqlAdminPassword", + "XConnectEnvironment": "", + "XConnectLogLevel": "", + //Sitecore + "SitecoreAdminPassword": "b", + "SolrCorePrefix": "$CorePrefix", + "SqlCoreUser": "$SqlAdminUser", + "SqlCorePassword": "$SqlAdminPassword", + "SqlWebUser": "$SqlAdminUser", + "SqlWebPassword": "$SqlAdminPassword", + "SqlFormsUser": "$SqlAdminUser", + "SqlFormsPassword": "$SqlAdminPassword", + "SqlMasterUser": "$SqlAdminUser", + "SqlMasterPassword": "$SqlAdminPassword", + "SqlReportingUser": "$SqlAdminUser", + "SqlReportingPassword": "$SqlAdminPassword", + "SqlProcessingTasksUser": "$SqlAdminUser", + "SqlProcessingTasksPassword": "$SqlAdminPassword", + "SqlExmMasterUser": "$SqlAdminUser", + "SqlExmMasterPassword": "$SqlAdminPassword", + "ExmEdsProvider": "", + "EXMCryptographicKey": "", + "EXMAuthenticationKey": "", + "SolrZookeeperUrl": "", + "XConnectCollectionService": "https://+\"$SqlDbPrefix+\"XColl.local", + "XConnectCollectionSearchService": "https://+\"$SqlDbPrefix+\"XSear.local", + "XConnectReferenceDataService": "https://+\"$SqlDbPrefix+\"Xref.local", + "MarketingAutomationOperationsService": "https://+\"$SqlDbPrefix+\"XP1XMA.local", + "MarketingAutomationReportingService": "https://+\"$SqlDbPrefix+\"XMAR.local", + "ProcessingService": "https://+\"$SqlDbPrefix+\"PRC.local", + "ReportingService": "https://+\"$SqlDbPrefix+\"REP.local", + "ReportingServiceApiKey": "abcde111112222233333444445555566", + "TelerikEncryptionKey": "", + "SqlMessagingUser": "$SqlAdminUser", + "SqlMessagingPassword": "$SqlAdminPassword" + }, + "PackageMapping": { + + "sitecore-XP0": "* (OnPrem)_single.scwdp.zip", + "xconnect-xp0": "* (OnPrem)_xp0xconnect.scwdp.zip", + "sitecore-XP1-cd": "* (OnPrem)_cd.scwdp.zip", + "sitecore-XP1-cm": "* (OnPrem)_cm.scwdp.zip", + "sitecore-XP1-prc": "* (OnPrem)_prc.scwdp.zip", + "sitecore-XP1-rep": "* (OnPrem)_rep.scwdp.zip", + "xconnect-XP1-collection": "* (onPrem)_xp1collection.scwdp.zip", + "xconnect-xp1-collectionsearch": "* (onPrem)_xp1collectionsearch.scwdp.zip", + "xconnect-xp1-MarketingAutomation": "* (onPrem)_xp1marketingautomation.scwdp.zip", + "xconnect-xp1-MarketingAutomationReporting": "* (onPrem)_xp1marketingautomationreporting.scwdp.zip", + "xconnect-xp1-ReferenceData": "* (onPrem)_xp1referencedata.scwdp.zip", + "sitecore-xp1-dds": "* (OnPrem)_dds.scwdp.zip", + "sitecore-XP1-cm-dds-patch": "Sitecore.Patch.EXM (OnPrem)_CM.zip" + }, + + "ExecSequense": { + "xconnect-createcert": {}, + "xconnect-solr": {}, + "sitecore-solr": {}, + "xconnect-xp0": {}, + "sitecore-XP0": {}, + "sitecore-XP1-cd": {}, + "sitecore-XP1-prc": {}, + "sitecore-XP1-rep": {}, + "sitecore-xp1-dds": {}, + "xconnect-xp1-collection": {}, + "xconnect-xp1-collectionsearch": {}, + "xconnect-xp1-MarketingAutomation": {}, + "xconnect-xp1-ReferenceData": {}, + "xconnect-xp1-MarketingAutomationReporting": {}, + "sitecore-XP1-cm": {}, + "sitecore-XP1-cm-dds-patch": {} + + + + + } + +} diff --git a/src/SIM.Sitecore9Installer/GlobalParams_9.1_XP0.json b/src/SIM.Sitecore9Installer/GlobalParams_9.1_XP0.json new file mode 100644 index 00000000..902778ab --- /dev/null +++ b/src/SIM.Sitecore9Installer/GlobalParams_9.1_XP0.json @@ -0,0 +1,201 @@ +{ + "Parameters": { + //global + "SIFVersion": "2.0.0", + "SqlServer": "", + "SqlAdminUser": "", + "SqlAdminPassword": "", + "SqlDbPrefix": "", + "LicenseFile": "", + "DnsName": "$installParams.SiteName", + //solr + "SolrUrl": "", + "SolrRoot": "", + "SolrService": "", + "CorePrefix": "$SqlDbPrefix", + "BaseConfig": "", + //cert + "CertificateName": "$SqlDbPrefix+\"xconnect_client\"", + "CertPath": "c:/certificates", + "RootCertFileName": "", + //xConnect + "XConnectCert": "$CertificateName", + "SqlMarketingAutomationUser": "$SqlAdminUser", + "SqlMarketingAutomationPassword": "$SqlAdminPassword", + "SqlReferenceDataUser": "$SqlAdminUser", + "SqlReferenceDataPassword": "$SqlAdminPassword", + "SqlProcessingPoolsUser": "$SqlAdminUser", + "SqlProcessingPoolsPassword": "$SqlAdminPassword", + "SqlCollectionUser": "$SqlAdminUser", + "SqlCollectionPassword": "$SqlAdminPassword", + "XConnectEnvironment": "", + "XConnectLogLevel": "", + //cortex + "XConnectSearchService": "$XConnectCollectionSearchService", + "CortexReportingService": "$XConnectCollectionService", + "SqlProcessingEngineUser": "$SqlAdminUser", + "SqlProcessingEnginePassword": "$SqlAdminPassword", + //identity + "ClientSecret": "SIF-Default", + "AllowedCorsOrigins": "http://\"+$SqlDbPrefix+\".local", + "PasswordRecoveryUrl": "http://\"+$SqlDbPrefix+\".local", + "SqlCoreDbName": "", + "SitecoreIdentityCert": "$SqlDbPrefix+\"Id.local\"", + "SitecoreIdentityAuthority": "https://\"+$SqlDbPrefix+\"Id.local", + //Sitecore + "SitecoreIdentitySecret": "$ClientSecret", + "EXMInternalApiKey": "", + "SqlSecurityPassword": "$SqlAdminPassword", + "SqlSecurityUser": "secur", + "SitecoreAdminPassword": "b", + "SolrCorePrefix": "$CorePrefix", + "SqlCoreUser": "$SqlAdminUser", + "SqlCorePassword": "$SqlAdminPassword", + "SqlWebUser": "$SqlAdminUser", + "SqlWebPassword": "$SqlAdminPassword", + "SqlFormsUser": "$SqlAdminUser", + "SqlFormsPassword": "$SqlAdminPassword", + "SqlMasterUser": "$SqlAdminUser", + "SqlMasterPassword": "$SqlAdminPassword", + "SqlReportingUser": "$SqlAdminUser", + "SqlReportingPassword": "$SqlAdminPassword", + "SqlProcessingTasksUser": "$SqlAdminUser", + "SqlProcessingTasksPassword": "$SqlAdminPassword", + "SqlExmMasterUser": "$SqlAdminUser", + "SqlExmMasterPassword": "$SqlAdminPassword", + "ExmEdsProvider": "", + "EXMCryptographicKey": "", + "EXMAuthenticationKey": "", + "SolrZookeeperUrl": "", + "XConnectCollectionService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "XConnectCollectionSearchService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "XConnectReferenceDataService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "MarketingAutomationOperationsService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "MarketingAutomationReportingService": "https://\"+$SqlDbPrefix+\"XConnect.local", + "ProcessingService": "", + "ReportingService": "", + "ReportingServiceApiKey": "", + "TelerikEncryptionKey": "", + "SqlMessagingUser": "$SqlAdminUser", + "SqlMessagingPassword": "$SqlAdminPassword" + + }, + "PackageMapping": { + + "sitecore-XP0": "* (OnPrem)_single.scwdp.zip", + "xconnect-xp0": "* (OnPrem)_xp0xconnect.scwdp.zip", + "sitecore-XP1-cd": "* (OnPrem)_cd.scwdp.zip", + "sitecore-XP1-cm": "* (OnPrem)_cm.scwdp.zip", + "sitecore-XP1-prc": "* (OnPrem)_prc.scwdp.zip", + "sitecore-XP1-rep": "* (OnPrem)_rep.scwdp.zip", + "xconnect-XP1-collection": "* (onPrem)_xp1collection.scwdp.zip", + "xconnect-xp1-collectionsearch": "* (onPrem)_xp1collectionsearch.scwdp.zip", + "xconnect-xp1-MarketingAutomation": "* (onPrem)_xp1marketingautomation.scwdp.zip", + "xconnect-xp1-MarketingAutomationReporting": "* (onPrem)_xp1marketingautomationreporting.scwdp.zip", + "xconnect-xp1-ReferenceData": "* (onPrem)_xp1referencedata.scwdp.zip", + "sitecore-xp1-dds": "* (OnPrem)_dds.scwdp.zip", + "xconnect-xp1-CortexProcessing": "* (OnPrem)_xp1cortexprocessing.scwdp.zip", + "xconnect-xp1-CortexReporting": "* (OnPrem)_xp1cortexreporting.scwdp.zip", + "IdentityServer": "* (OnPrem)_identityserver.scwdp.zip", + "sitecore-XP1-cm-dds-patch": "Sitecore.Patch.EXM (OnPrem)_CM.zip" + + + }, + + "ExecSequense": { + + "IdentityServerCertificates": { + "Parameters": { + "RealName": "createcert", + "CertificateName": "$SitecoreIdentityCert" + + } + }, + "IdentityServer": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"Id.local\"" + } + }, + "XConnectCertificates": { + "Parameters": { + "RealName": "createcert", + "CertificateName": "$CertificateName" + } + }, + "xconnect-solr": {}, + "xconnect-xp0": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XConnect.local\"" + } + }, + "xconnect-xp1-collection": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XColl.local\"" + } + }, + "xconnect-xp1-collectionsearch": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XSear.local\"" + } + }, + "xconnect-xp1-referencedata": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XRef.local\"" + } + }, + "xconnect-xp1-marketingautomation": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XMA.local\"" + } + }, + "xconnect-xp1-marketingautomationreporting": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XMar.local\"" + } + }, + "xconnect-xp1-cortexprocessing": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CorPrc.local\"" + } + }, + "xconnect-xp1-cortexreporting": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CorRep.local\"" + } + }, + "Sitecore-solr": {}, + "Sitecore-XP0": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\".local\"" + } + + }, + "Sitecore-xp1-cd": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CD.local\"" + } + }, + "Sitecore-xp1-prc": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"Prc.local\"" + } + }, + "Sitecore-xp1-rep": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"Rep.local\"" + } + }, + "Sitecore-xp1-cm": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CM.local\"" + } + }, + "sitecore-xp1-dds": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"DDS.local\"" + } + }, + "sitecore-XP1-cm-dds-patch": {} + + } +} diff --git a/src/SIM.Sitecore9Installer/GlobalParams_9.1_XP1.json b/src/SIM.Sitecore9Installer/GlobalParams_9.1_XP1.json new file mode 100644 index 00000000..56f82b01 --- /dev/null +++ b/src/SIM.Sitecore9Installer/GlobalParams_9.1_XP1.json @@ -0,0 +1,201 @@ +{ + "Parameters": { + //global + "DeploymentRoot": "c:/sitecores/sc91", + "SIFVersion": "2.0.0", + "SqlServer": "", + "SqlAdminUser": "", + "SqlAdminPassword": "", + "SqlDbPrefix": "", + "LicenseFile": "", + "DnsName": "$installParams.SiteName", + //solr + "SolrUrl": "", + "SolrRoot": "", + "SolrService": "", + "CorePrefix": "$SqlDbPrefix", + "BaseConfig": "", + //cert + "CertificateName": "$SqlDbPrefix+\"xconnect_client\"", + "CertPath": "c:/certificates", + "RootCertFileName": "", + //xConnect + "XConnectCert": "$CertificateName", + "SqlMarketingAutomationUser": "$SqlAdminUser", + "SqlMarketingAutomationPassword": "$SqlAdminPassword", + "SqlReferenceDataUser": "$SqlAdminUser", + "SqlReferenceDataPassword": "$SqlAdminPassword", + "SqlProcessingPoolsUser": "$SqlAdminUser", + "SqlProcessingPoolsPassword": "$SqlAdminPassword", + "SqlCollectionUser": "$SqlAdminUser", + "SqlCollectionPassword": "$SqlAdminPassword", + "XConnectEnvironment": "", + "XConnectLogLevel": "", + //cortex + "XConnectSearchService": "$XConnectCollectionSearchService", + "CortexReportingService": "https://\"+$SqlDbPrefix+\"CortexRep.local", + "SqlProcessingEngineUser": "$SqlAdminUser", + "SqlProcessingEnginePassword": "$SqlAdminPassword", + //identity + "ClientSecret": "SIF-Default", + "AllowedCorsOrigins": "https://\"+$SqlDbPrefix+\"CM.local", + "PasswordRecoveryUrl": "https://\"+$SqlDbPrefix+\"CM.local", + "SqlCoreDbName": "", + "SitecoreIdentityCert": "$SqlDbPrefix+\"Id.local\"", + "SitecoreIdentityAuthority": "https://\"+$SqlDbPrefix+\"Id.local", + //Sitecore + "SitecoreIdentitySecret": "$ClientSecret", + "EXMInternalApiKey": "", + "SqlSecurityPassword": "$SqlAdminPassword", + "SqlSecurityUser": "secur", + "SitecoreAdminPassword": "b", + "SolrCorePrefix": "$CorePrefix", + "SqlCoreUser": "$SqlAdminUser", + "SqlCorePassword": "$SqlAdminPassword", + "SqlWebUser": "$SqlAdminUser", + "SqlWebPassword": "$SqlAdminPassword", + "SqlFormsUser": "$SqlAdminUser", + "SqlFormsPassword": "$SqlAdminPassword", + "SqlMasterUser": "$SqlAdminUser", + "SqlMasterPassword": "$SqlAdminPassword", + "SqlReportingUser": "$SqlAdminUser", + "SqlReportingPassword": "$SqlAdminPassword", + "SqlProcessingTasksUser": "$SqlAdminUser", + "SqlProcessingTasksPassword": "$SqlAdminPassword", + "SqlExmMasterUser": "$SqlAdminUser", + "SqlExmMasterPassword": "$SqlAdminPassword", + "ExmEdsProvider": "", + "EXMCryptographicKey": "", + "EXMAuthenticationKey": "", + "SolrZookeeperUrl": "", + "XConnectCollectionService": "https://\"+$SqlDbPrefix+\"XColl.local", + "XConnectCollectionSearchService": "https://\"+$SqlDbPrefix+\"XSear.local", + "XConnectReferenceDataService": "https://\"+$SqlDbPrefix+\"Xref.local", + "MarketingAutomationOperationsService": "https://\"+$SqlDbPrefix+\"XMA.local", + "MarketingAutomationReportingService": "https://\"+$SqlDbPrefix+\"XMAR.local", + "ProcessingService": "https://\"+$SqlDbPrefix+\"PRC.local", + "ReportingService": "https://\"+$SqlDbPrefix+\"REP.local", + "ReportingServiceApiKey": "abcde111112222233333444445555566", + "TelerikEncryptionKey": "", + "SqlMessagingUser": "$SqlAdminUser", + "SqlMessagingPassword": "$SqlAdminPassword" + + }, + "PackageMapping": { + + "sitecore-XP0": "* (OnPrem)_single.scwdp.zip", + "xconnect-xp0": "* (OnPrem)_xp0xconnect.scwdp.zip", + "sitecore-XP1-cd": "* (OnPrem)_cd.scwdp.zip", + "sitecore-XP1-cm": "* (OnPrem)_cm.scwdp.zip", + "sitecore-XP1-prc": "* (OnPrem)_prc.scwdp.zip", + "sitecore-XP1-rep": "* (OnPrem)_rep.scwdp.zip", + "xconnect-XP1-collection": "* (onPrem)_xp1collection.scwdp.zip", + "xconnect-xp1-collectionsearch": "* (onPrem)_xp1collectionsearch.scwdp.zip", + "xconnect-xp1-MarketingAutomation": "* (onPrem)_xp1marketingautomation.scwdp.zip", + "xconnect-xp1-MarketingAutomationReporting": "* (onPrem)_xp1marketingautomationreporting.scwdp.zip", + "xconnect-xp1-ReferenceData": "* (onPrem)_xp1referencedata.scwdp.zip", + "sitecore-xp1-dds": "* (OnPrem)_dds.scwdp.zip", + "xconnect-xp1-CortexProcessing": "* (OnPrem)_xp1cortexprocessing.scwdp.zip", + "xconnect-xp1-CortexReporting": "* (OnPrem)_xp1cortexreporting.scwdp.zip", + "IdentityServer": "* (OnPrem)_identityserver.scwdp.zip", + "sitecore-XP1-cm-dds-patch": "Sitecore.Patch.EXM (OnPrem)_CM.zip" + + }, + + "ExecSequense": { + + "IdentityServerCertificates": { + "Parameters": { + "RealName": "createcert", + "CertificateName": "$SitecoreIdentityCert" + + } + }, + "IdentityServer": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"Id.local\"" + } + }, + "XConnectCertificates": { + "Parameters": { + "RealName": "createcert", + "CertificateName": "$CertificateName" + } + }, + "xconnect-solr": {}, + "xconnect-xp0": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XConnect.local\"" + } + }, + "xconnect-xp1-collection": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XColl.local\"" + } + }, + "xconnect-xp1-collectionsearch": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XSear.local\"" + } + }, + "xconnect-xp1-referencedata": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XRef.local\"" + } + }, + "xconnect-xp1-marketingautomation": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XMA.local\"" + } + }, + "xconnect-xp1-marketingautomationreporting": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"XMar.local\"" + } + }, + "xconnect-xp1-cortexprocessing": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CorPrc.local\"" + } + }, + "xconnect-xp1-cortexreporting": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CorRep.local\"" + } + }, + "Sitecore-solr": {}, + "Sitecore-XP0": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\".local\"" + } + + }, + "Sitecore-xp1-cd": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CD.local\"" + } + }, + "Sitecore-xp1-prc": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"Prc.local\"" + } + }, + "Sitecore-xp1-rep": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"Rep.local\"" + } + }, + "Sitecore-xp1-cm": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"CM.local\"" + } + }, + "sitecore-xp1-dds": { + "Parameters": { + "SiteName": "$SqlDbPrefix+\"DDS.local\"" + } + }, + "sitecore-XP1-cm-dds-patch": {} + + } +} diff --git a/src/SIM.Sitecore9Installer/InstallParam.cs b/src/SIM.Sitecore9Installer/InstallParam.cs new file mode 100644 index 00000000..bdaa7563 --- /dev/null +++ b/src/SIM.Sitecore9Installer/InstallParam.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SIM.Sitecore9Installer +{ + public class InstallParam + { + public event EventHandler ParamValueUpdated; + string value; + public InstallParam(string name, string value) + { + this.name = name; + this.Value = value; + } + + private string name; + public string Name { get => this.name; } + public string Value + { + get + { + return this.value; + } + set + { + string oldValue = this.value; + this.value = value; + if (this.ParamValueUpdated != null) + { + ParamValueUpdatedArgs args = new ParamValueUpdatedArgs(oldValue); + + this.ParamValueUpdated(this, args); + } + } + } + public string Description { get; set; } + } + + public class ParamValueUpdatedArgs : EventArgs + { + public ParamValueUpdatedArgs(string oldValue) + { + this.OldValue = oldValue; + } + + public string OldValue { get; } + } +} diff --git a/src/SIM.Sitecore9Installer/Properties/AssemblyInfo.cs b/src/SIM.Sitecore9Installer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..6a02592b --- /dev/null +++ b/src/SIM.Sitecore9Installer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WindowsFormsApp2")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WindowsFormsApp2")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5c870ab3-89f2-4e24-ae5d-3593ec816495")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/SIM.Sitecore9Installer/Properties/Resources.Designer.cs b/src/SIM.Sitecore9Installer/Properties/Resources.Designer.cs new file mode 100644 index 00000000..54cb3f93 --- /dev/null +++ b/src/SIM.Sitecore9Installer/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SIM.Sitecore9Installer.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SIM.Sitecore9Installer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/src/SIM.Sitecore9Installer/Properties/Resources.resx b/src/SIM.Sitecore9Installer/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/src/SIM.Sitecore9Installer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/SIM.Sitecore9Installer/Properties/Settings.Designer.cs b/src/SIM.Sitecore9Installer/Properties/Settings.Designer.cs new file mode 100644 index 00000000..c54b656d --- /dev/null +++ b/src/SIM.Sitecore9Installer/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SIM.Sitecore9Installer.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/src/SIM.Sitecore9Installer/Properties/Settings.settings b/src/SIM.Sitecore9Installer/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/src/SIM.Sitecore9Installer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/SIM.Sitecore9Installer/SIM.Sitecore9Installer.csproj b/src/SIM.Sitecore9Installer/SIM.Sitecore9Installer.csproj new file mode 100644 index 00000000..6188ed5d --- /dev/null +++ b/src/SIM.Sitecore9Installer/SIM.Sitecore9Installer.csproj @@ -0,0 +1,154 @@ + + + + + Debug + AnyCPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495} + Library + SIM.Sitecore9Installer + SIM.Sitecore9Installer + v4.5 + 512 + true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + x64 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + + + + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + + + ..\packages\Microsoft.PowerShell.5.1.ReferenceAssemblies.1.0.0\lib\net461\System.Management.Automation.dll + True + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + Always + + + Always + + + + Always + + + Always + + + Always + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + False + Microsoft .NET Framework 4.6.1 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + {bc8b4ee5-c053-42e1-a5ba-07f8c41915a9} + SIM.Products + + + + \ No newline at end of file diff --git a/src/SIM.Sitecore9Installer/SitecoreTask.cs b/src/SIM.Sitecore9Installer/SitecoreTask.cs new file mode 100644 index 00000000..4a81d885 --- /dev/null +++ b/src/SIM.Sitecore9Installer/SitecoreTask.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Threading.Tasks; + +namespace SIM.Sitecore9Installer +{ + public enum TaskState + { + Pending, Running, Finished, Warning, Failed + } + public class SitecoreTask + { + TaskState state; + string name; + StringBuilder results = new StringBuilder(); + public SitecoreTask(string name) + { + this.name = name; + this.InnerTasks = new List(); + this.state = TaskState.Pending; + this.ShouldRun = true; + } + + public TaskState State { get => this.state; } + public string Name { get => this.name; } + public bool ShouldRun { get; set; } + public List GlobalParams { get; set; } + public List LocalParams { get; set; } + public List InnerTasks { get; } + //public string Run() + //{ + // this.state = TaskState.Running; + // string tabName = this.name; + // StringBuilder script = new StringBuilder(); + // foreach (InstallParam param in this.GlobalParams) + // { + // string value = param.Value.StartsWith("$") ? param.Value : string.Format("\"{0}\"", param.Value); + // script.AppendLine(string.Format("${0}={1}", param.Name, value)); + // } + + // script.AppendLine("$installParams=@{"); + // foreach (InstallParam param in this.LocalParams) + // { + // if (string.IsNullOrEmpty(param.Value)) + // { + // continue; + // } + + // string value = param.Value.StartsWith("$") ? param.Value : string.Format("\"{0}\"", param.Value); + // script.AppendLine(string.Format("{0}={1}", param.Name, value)); + // } + // script.Append("}"); + // using (PowerShell PowerShellInstance = PowerShell.Create()) + // { + // PowerShellInstance.AddScript(string.Format("cd \"{0}\"", Path.GetDirectoryName(this.LocalParams.First(p => p.Name == "Path").Value))); + // PowerShellInstance.AddScript("Set-ExecutionPolicy Bypass -Force"); + // PowerShellInstance.AddScript("Import-Module SitecoreFundamentals"); + // string sifVersion = this.GlobalParams.FirstOrDefault(p => p.Name == "SIFVersion")?.Value; + // string importParam = string.Empty; + // if (!string.IsNullOrEmpty(sifVersion)) + // { + // importParam = string.Format(" -RequiredVersion {0}", sifVersion); + // } + + // PowerShellInstance.AddScript(string.Format("Import-Module SitecoreInstallFramework{0}", importParam)); + // PowerShellInstance.AddScript(script.ToString()); + // PowerShellInstance.Invoke(); + // PowerShellInstance.AddScript("Install-SitecoreConfiguration @installParams -Verbose"); + // Collection PSOutput = PowerShellInstance.Invoke(); + + // if (PowerShellInstance.Streams.Error.Count > 0) + // { + // this.state = TaskState.Failed; + // foreach (var error in PowerShellInstance.Streams.Error) + // { + // results.AppendLine(error.ToString()); + // } + // } + // else + // { + // this.state = TaskState.Finished; + // } + // } + + // return results.ToString().Trim(); + //} + + public string Run() + { + this.state = TaskState.Running; + using (PowerShell PowerShellInstance = PowerShell.Create()) + { + PowerShellInstance.AddScript(this.GetScript()); + try + { + PowerShellInstance.Invoke(); + } + catch (Exception ex) + { + this.state = TaskState.Failed; + return ex.ToString(); + } + + if (PowerShellInstance.Streams.Error.Count > 0) + { + this.state = TaskState.Warning; + foreach (var error in PowerShellInstance.Streams.Error) + { + results.AppendLine(error.ToString()); + } + } + else + { + this.state = TaskState.Finished; + } + } + + return results.ToString(); + } + + public string GetScript() + { + StringBuilder script = new StringBuilder(); + foreach (InstallParam param in this.GlobalParams) + { + string value = param.Value.StartsWith("$") ? param.Value : string.Format("\"{0}\"", param.Value); + script.AppendLine(string.Format("${0}={1}", param.Name, value)); + } + + //script.AppendLine("$installParams=@{"); + StringBuilder installParams = new StringBuilder(); + installParams.AppendLine("$installParams=@{"); + foreach (InstallParam param in this.LocalParams) + { + if (string.IsNullOrEmpty(param.Value)) + { + continue; + } + + + string value = param.Value.StartsWith("$") ? param.Value : string.Format("\"{0}\"", param.Value); + + installParams.AppendLine(string.Format("{0}={1}", param.Name, value)); + + } + + installParams.AppendLine("}"); + script.Append(installParams); + script.Append(installParams); + script.AppendLine(string.Format("cd \"{0}\"", Path.GetDirectoryName(this.LocalParams.First(p => p.Name == "Path").Value))); + script.AppendLine("Set-ExecutionPolicy Bypass -Force"); + script.AppendLine("Import-Module SitecoreFundamentals"); + string sifVersion = this.GlobalParams.FirstOrDefault(p => p.Name == "SIFVersion")?.Value ?? string.Empty; + string importParam = string.Empty; + if (!string.IsNullOrEmpty(sifVersion)) + { + importParam = string.Format(" -RequiredVersion {0}", sifVersion); + } + + script.AppendLine(string.Format("Import-Module SitecoreInstallFramework{0}", importParam)); + // script.AppendLine(script.ToString()); + string log = !sifVersion.StartsWith("1") ? string.Format("*>&1 | Tee-Object {0}.log", this.Name) : string.Empty; + script.AppendLine(string.Format("Install-SitecoreConfiguration @installParams {0} -Verbose", log)); + return script.ToString(); + } + } +} diff --git a/src/SIM.Sitecore9Installer/Tasker.cs b/src/SIM.Sitecore9Installer/Tasker.cs new file mode 100644 index 00000000..fd15f2bc --- /dev/null +++ b/src/SIM.Sitecore9Installer/Tasker.cs @@ -0,0 +1,235 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using SIM.Products; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace SIM.Sitecore9Installer +{ + public class Tasker + { + + List tasksToRun = new List(); + List mapping; + string filesRoot; + string globalParamsFile; + JObject doc; + List globalParams; + + public static FileInfo ResolveGlobalFile(Product product) + { + string packageName = Path.GetFileNameWithoutExtension(product.PackagePath); + string jsonGlobalFilesMap = string.Empty; + using(var reader= new StreamReader(Path.Combine(Directory.GetCurrentDirectory(), "GlobalFilesMap.json"))) + { + jsonGlobalFilesMap = reader.ReadToEnd(); + } + + Dictionary globalFilesMap= JsonConvert.DeserializeObject>(jsonGlobalFilesMap); + foreach(string pattern in globalFilesMap.Keys) + { + if (Regex.IsMatch(packageName, pattern)) + { + return new FileInfo(Path.Combine(Directory.GetCurrentDirectory(), globalFilesMap[pattern])); + } + } + + return null; + } + + public List GlobalParams + { + get + { + return this.globalParams; + } + } + + public List Tasks + { + get + { + return this.tasksToRun; + } + } + + + public Tasker(string root, string globalFile) + { + this.filesRoot = root; + this.globalParamsFile = globalFile; + this.mapping = this.GetPackageMapping(); + this.doc = JObject.Parse(File.ReadAllText(this.globalParamsFile)); + this.globalParams = this.GetGlobalParams(); + this.LoadTasks(); + } + + private List GetGlobalParams() + { + List list = new List(); + list.Add(new InstallParam("FilesRoot", this.filesRoot)); + foreach (JProperty param in doc["Parameters"].Children()) + { + InstallParam p = new InstallParam(param.Name, param.Value.ToString()); + if (p.Name == "LicenseFile") + { + string license = Path.Combine(this.filesRoot, "license.xml"); + if (File.Exists(license)) + { + p.Value = license; + } + } + + p.ParamValueUpdated += GlobalParamValueUpdated; + list.Add(p); + } + + return list; + } + + private void GlobalParamValueUpdated(object sender, ParamValueUpdatedArgs e) + { + InstallParam updatedParam = (InstallParam)sender; + foreach (SitecoreTask task in this.Tasks) + { + InstallParam param = task.LocalParams.FirstOrDefault(p => p.Name == updatedParam.Name); + if (param != null) + { + param.Value = updatedParam.Value; + } + } + } + + public string RunAllTasks() + { + StringBuilder results = new StringBuilder(); + + foreach (SitecoreTask task in this.tasksToRun.Where(t=>t.ShouldRun)) + { + try + { + results.AppendLine(task.Run()); + if (task.State == TaskState.Failed) + { + break; + } + } + catch (Exception ex) + { + results.AppendLine(ex.ToString()); + break; + } + } + + return results.ToString().Trim(); + } + + public void GenerateScripts() + { + string path = Path.Combine(this.filesRoot, "generated_scripts"); + Directory.CreateDirectory(path); + foreach (SitecoreTask task in this.Tasks.Where(t=>t.ShouldRun)) + { + using (StreamWriter writer = new StreamWriter(Path.Combine(path, string.Format("{0}.ps1", task.Name)))) + { + writer.Write(task.GetScript()); + } + } + } + + private List GetTaskParameters(string name) + { + string file = Directory.GetFiles(this.filesRoot, string.Format("{0}.json", name),SearchOption.AllDirectories).First(); + + List installParams = new List(); + JObject doc = JObject.Parse(File.ReadAllText(file)); + foreach (JProperty param in doc["Parameters"].Children()) + { + string dafultValue = param.Value["DefaultValue"]?.ToString(); + + InstallParam p = new InstallParam(param.Name, dafultValue); + p.Description = param.Value["Description"]?.ToString(); + if (this.globalParams.Any(g => g.Name == p.Name && !string.IsNullOrEmpty(g.Value))) + { + p.Value = this.globalParams.First(g => g.Name == p.Name).Value; + } + installParams.Add(p); + + if (p.Name == "Package") + { + InstallParam pack = mapping.FirstOrDefault(g => g.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (!string.IsNullOrEmpty(pack?.Value)) + { + p.Value = Directory.GetFiles(this.filesRoot, pack.Value).FirstOrDefault(); + } + } + } + installParams.Add(new InstallParam("Path", file)); + return installParams; + } + + private void LoadTasks() + { + foreach (JProperty param in doc["ExecSequense"].Children()) + { + var overridden = param.Value["Parameters"]; + string realName = param.Name; + if (overridden != null && overridden["RealName"] != null) + { + realName = overridden["RealName"]?.ToString(); + } + + string taskFile= Directory.GetFiles(this.filesRoot, string.Format("{0}.json", realName), SearchOption.AllDirectories).FirstOrDefault(); + if (string.IsNullOrEmpty(taskFile)) + { + continue; + } + + //if (!File.Exists(string.Format("{0}.json", Path.Combine(filesRoot, realName)))) + //{ + // continue; + //} + + SitecoreTask t = new SitecoreTask(param.Name); + t.GlobalParams = this.GlobalParams; + t.LocalParams = this.GetTaskParameters(realName); + + if (overridden != null) + { + foreach (JProperty newJParam in overridden.Children()) + { + InstallParam newParam = t.LocalParams.FirstOrDefault(p => p.Name == newJParam.Name); + if (newParam != null) + { + newParam.Value = newJParam.Value.ToString(); + } + } + } + + this.tasksToRun.Add(t); + } + } + + + private List GetPackageMapping() + { + List list = new List(); + + string file = this.globalParamsFile; + JObject doc = JObject.Parse(File.ReadAllText(file)); + foreach (JProperty param in doc["PackageMapping"].Children()) + { + InstallParam p = new InstallParam(param.Name, param.Value.ToString()); + list.Add(p); + } + + return list; + } + + } +} diff --git a/src/SIM.Sitecore9Installer/packages.config b/src/SIM.Sitecore9Installer/packages.config new file mode 100644 index 00000000..b4fc5d14 --- /dev/null +++ b/src/SIM.Sitecore9Installer/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From c8541c61913761f43a8e11afcb96359f5a7e99a8 Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 12:58:29 -0500 Subject: [PATCH 002/188] gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6ee13859..e0cda16a 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ src/SIM.Foundation.SqlAdapter/bin/ src/SIM.Foundation.SqlAdapter/obj/ src/SIM.Foundation.SqlAdapter.IntegrationTests/bin/ src/SIM.Foundation.SqlAdapter.IntegrationTests/obj/ +src/SIM.Sitecore9Installer/bin/ From 9560931349bbf5b1baa15e5668d4f98d05d307a7 Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 12:59:50 -0500 Subject: [PATCH 003/188] Update processor title property to support unique names for dynamic processors in hive --- src/SIM.Base/Pipelines/Processors/Processor.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SIM.Base/Pipelines/Processors/Processor.cs b/src/SIM.Base/Pipelines/Processors/Processor.cs index cc57352f..7e685a96 100644 --- a/src/SIM.Base/Pipelines/Processors/Processor.cs +++ b/src/SIM.Base/Pipelines/Processors/Processor.cs @@ -18,6 +18,7 @@ public abstract class Processor : DataObject public readonly List _NestedProcessors = new List(); + string title; #endregion #region Constructors @@ -58,7 +59,17 @@ public string Title { get { - return ProcessorDefinition.Title; + if (string.IsNullOrEmpty(this.title)) + { + return ProcessorDefinition.Title; + } + + return this.title; + } + + set + { + this.title = value; } } From f17ce6e3f612ccf61a73265fd507c3ed4325081e Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 13:00:35 -0500 Subject: [PATCH 004/188] sln file --- src/Sitecore Instance Manager.sln | 75 ++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/src/Sitecore Instance Manager.sln b/src/Sitecore Instance Manager.sln index 7044fe01..d6966369 100644 --- a/src/Sitecore Instance Manager.sln +++ b/src/Sitecore Instance Manager.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.16 +VisualStudioVersion = 15.0.27130.2036 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIM.Tool", "SIM.Tool\SIM.Tool.csproj", "{7479AF0F-C156-4844-AEC1-778FF1B854C8}" EndProject @@ -39,172 +39,244 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIM.Foundation.SqlAdapter", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIM.Foundation.SqlAdapter.IntegrationTests", "SIM.Foundation.SqlAdapter.IntegrationTests\SIM.Foundation.SqlAdapter.IntegrationTests.csproj", "{293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIM.Sitecore9Installer", "SIM.Sitecore9Installer\SIM.Sitecore9Installer.csproj", "{5C870AB3-89F2-4E24-AE5D-3593EC816495}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Debug|Any CPU.ActiveCfg = Debug|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Debug|x64.ActiveCfg = Debug|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Debug|x86.ActiveCfg = Debug|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Debug|x86.Build.0 = Debug|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Release|Any CPU.ActiveCfg = Release|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Release|Mixed Platforms.ActiveCfg = Release|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Release|Mixed Platforms.Build.0 = Release|x86 + {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Release|x64.ActiveCfg = Release|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Release|x86.ActiveCfg = Release|x86 {7479AF0F-C156-4844-AEC1-778FF1B854C8}.Release|x86.Build.0 = Release|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Debug|Any CPU.ActiveCfg = Debug|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Debug|x64.ActiveCfg = Debug|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Debug|x86.ActiveCfg = Debug|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Debug|x86.Build.0 = Debug|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Release|Any CPU.ActiveCfg = Release|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Release|Mixed Platforms.ActiveCfg = Release|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Release|Mixed Platforms.Build.0 = Release|x86 + {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Release|x64.ActiveCfg = Release|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Release|x86.ActiveCfg = Release|x86 {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8}.Release|x86.Build.0 = Release|x86 {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|Any CPU.Build.0 = Debug|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|x64.ActiveCfg = Debug|Any CPU + {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|x64.Build.0 = Debug|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|x86.ActiveCfg = Debug|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Debug|x86.Build.0 = Debug|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Release|Any CPU.ActiveCfg = Release|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Release|Any CPU.Build.0 = Release|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Release|x64.ActiveCfg = Release|Any CPU + {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Release|x64.Build.0 = Release|Any CPU {CA40C57A-EF4F-474D-BE8B-98E51AE62C1F}.Release|x86.ActiveCfg = Release|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|Any CPU.Build.0 = Debug|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|x64.ActiveCfg = Debug|Any CPU + {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|x64.Build.0 = Debug|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|x86.ActiveCfg = Debug|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Debug|x86.Build.0 = Debug|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Release|Any CPU.Build.0 = Release|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Release|x64.ActiveCfg = Release|Any CPU + {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Release|x64.Build.0 = Release|Any CPU {CA9339A0-9A7D-4900-839E-F21B7269BDAA}.Release|x86.ActiveCfg = Release|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|Any CPU.Build.0 = Debug|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|x64.ActiveCfg = Debug|Any CPU + {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|x64.Build.0 = Debug|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|x86.ActiveCfg = Debug|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Debug|x86.Build.0 = Debug|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Release|Any CPU.ActiveCfg = Release|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Release|Any CPU.Build.0 = Release|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Release|x64.ActiveCfg = Release|Any CPU + {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Release|x64.Build.0 = Release|Any CPU {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9}.Release|x86.ActiveCfg = Release|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|Any CPU.Build.0 = Debug|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|x64.ActiveCfg = Debug|Any CPU + {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|x64.Build.0 = Debug|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|x86.ActiveCfg = Debug|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Debug|x86.Build.0 = Debug|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Release|Any CPU.Build.0 = Release|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Release|x64.ActiveCfg = Release|Any CPU + {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Release|x64.Build.0 = Release|Any CPU {CCA7B157-A743-4A5A-A03B-B6B27CB2BE1C}.Release|x86.ActiveCfg = Release|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|Any CPU.Build.0 = Debug|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|x64.ActiveCfg = Debug|Any CPU + {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|x64.Build.0 = Debug|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|x86.ActiveCfg = Debug|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Debug|x86.Build.0 = Debug|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Release|Any CPU.ActiveCfg = Release|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Release|Any CPU.Build.0 = Release|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Release|x64.ActiveCfg = Release|Any CPU + {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Release|x64.Build.0 = Release|Any CPU {8F514FFE-EE16-49B0-96F6-503DA3CCF332}.Release|x86.ActiveCfg = Release|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|Any CPU.Build.0 = Debug|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|x64.ActiveCfg = Debug|Any CPU + {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|x64.Build.0 = Debug|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|x86.ActiveCfg = Debug|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Debug|x86.Build.0 = Debug|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Release|Any CPU.ActiveCfg = Release|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Release|Any CPU.Build.0 = Release|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Release|x64.ActiveCfg = Release|Any CPU + {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Release|x64.Build.0 = Release|Any CPU {EF380B2A-1171-4A9F-96D0-176ABA6CAD74}.Release|x86.ActiveCfg = Release|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|x64.ActiveCfg = Debug|Any CPU + {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|x64.Build.0 = Debug|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|x86.ActiveCfg = Debug|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Debug|x86.Build.0 = Debug|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Release|Any CPU.Build.0 = Release|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Release|x64.ActiveCfg = Release|Any CPU + {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Release|x64.Build.0 = Release|Any CPU {221FB0E1-56C0-499C-82F3-BA4060D6ED0C}.Release|x86.ActiveCfg = Release|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|Any CPU.Build.0 = Debug|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|x64.ActiveCfg = Debug|Any CPU + {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|x64.Build.0 = Debug|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|x86.ActiveCfg = Debug|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Debug|x86.Build.0 = Debug|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Release|Any CPU.ActiveCfg = Release|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Release|Any CPU.Build.0 = Release|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A124D359-B9BF-44F4-98CB-C40D3D490839}.Release|x64.ActiveCfg = Release|Any CPU + {A124D359-B9BF-44F4-98CB-C40D3D490839}.Release|x64.Build.0 = Release|Any CPU {A124D359-B9BF-44F4-98CB-C40D3D490839}.Release|x86.ActiveCfg = Release|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|Any CPU.Build.0 = Debug|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|x64.ActiveCfg = Debug|Any CPU + {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|x64.Build.0 = Debug|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|x86.ActiveCfg = Debug|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Debug|x86.Build.0 = Debug|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|Any CPU.ActiveCfg = Release|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|Any CPU.Build.0 = Release|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|x64.ActiveCfg = Release|Any CPU + {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|x64.Build.0 = Release|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|x86.ActiveCfg = Release|Any CPU {02B6C2D7-3083-4DF3-B86D-B6D4728C4EF2}.Release|x86.Build.0 = Release|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|Any CPU.Build.0 = Debug|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|x64.ActiveCfg = Debug|Any CPU + {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|x64.Build.0 = Debug|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|x86.ActiveCfg = Debug|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Debug|x86.Build.0 = Debug|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|Any CPU.ActiveCfg = Release|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|Any CPU.Build.0 = Release|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|x64.ActiveCfg = Release|Any CPU + {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|x64.Build.0 = Release|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|x86.ActiveCfg = Release|Any CPU {46623BF6-DF60-4A1A-AADF-C0BECE17FE74}.Release|x86.Build.0 = Release|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|Any CPU.Build.0 = Debug|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|x64.ActiveCfg = Debug|Any CPU + {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|x64.Build.0 = Debug|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|x86.ActiveCfg = Debug|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Debug|x86.Build.0 = Debug|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|Any CPU.ActiveCfg = Release|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|Any CPU.Build.0 = Release|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|x64.ActiveCfg = Release|Any CPU + {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|x64.Build.0 = Release|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|x86.ActiveCfg = Release|Any CPU {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78}.Release|x86.Build.0 = Release|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|Any CPU.Build.0 = Debug|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|x64.ActiveCfg = Debug|Any CPU + {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|x64.Build.0 = Debug|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|x86.ActiveCfg = Debug|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Debug|x86.Build.0 = Debug|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|Any CPU.ActiveCfg = Release|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|Any CPU.Build.0 = Release|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|x64.ActiveCfg = Release|Any CPU + {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|x64.Build.0 = Release|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|x86.ActiveCfg = Release|Any CPU {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA}.Release|x86.Build.0 = Release|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|x64.ActiveCfg = Debug|x64 + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|x64.Build.0 = Debug|x64 + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|x86.ActiveCfg = Debug|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Debug|x86.Build.0 = Debug|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|Any CPU.Build.0 = Release|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|x64.ActiveCfg = Release|x64 + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|x64.Build.0 = Release|x64 + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|x86.ActiveCfg = Release|Any CPU + {5C870AB3-89F2-4E24-AE5D-3593EC816495}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -225,6 +297,7 @@ Global {46623BF6-DF60-4A1A-AADF-C0BECE17FE74} = {9285A641-C759-471D-A4FE-9C92C529128C} {3748B30C-ABF5-4DEE-9F22-74E4F69FFF78} = {9285A641-C759-471D-A4FE-9C92C529128C} {293D8E00-5C24-4E62-9BF7-4E0FB224D1BA} = {9285A641-C759-471D-A4FE-9C92C529128C} + {5C870AB3-89F2-4E24-AE5D-3593EC816495} = {9285A641-C759-471D-A4FE-9C92C529128C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5F97C0C4-9F5F-48C7-ACB3-983A4AEF8C84} From 60ee08f2c54c6a122b196e2d3a11dcd3a73f2c47 Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 13:01:33 -0500 Subject: [PATCH 005/188] install9 pipeline definition --- src/SIM.Pipelines/PipelinesConfig.cs | 6 ++++++ src/SIM.Pipelines/SIM.Pipelines.csproj | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/SIM.Pipelines/PipelinesConfig.cs b/src/SIM.Pipelines/PipelinesConfig.cs index 3cd58d6c..14f030dd 100644 --- a/src/SIM.Pipelines/PipelinesConfig.cs +++ b/src/SIM.Pipelines/PipelinesConfig.cs @@ -3,6 +3,12 @@ public static class PipelinesConfig { public const string Contents = @" + + + + + + diff --git a/src/SIM.Pipelines/SIM.Pipelines.csproj b/src/SIM.Pipelines/SIM.Pipelines.csproj index 7197b1ab..7cd015b5 100644 --- a/src/SIM.Pipelines/SIM.Pipelines.csproj +++ b/src/SIM.Pipelines/SIM.Pipelines.csproj @@ -99,6 +99,8 @@ + + @@ -109,7 +111,10 @@ + + + @@ -241,6 +246,10 @@ {BC8B4EE5-C053-42E1-A5BA-07F8C41915A9} SIM.Products + + {5c870ab3-89f2-4e24-ae5d-3593ec816495} + SIM.Sitecore9Installer + From 59f253b0487b32cf66cf9f4f5ccd4d5a113a8960 Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 13:03:47 -0500 Subject: [PATCH 006/188] processors and argumnets for 9 installation --- .../Install/GenerateScriptProcessor.cs | 44 +++++++++++++++++++ src/SIM.Pipelines/Install/Install9Args.cs | 29 ++++++++++++ src/SIM.Pipelines/Install/Run9Installation.cs | 27 ++++++++++++ .../Install/RunSitecoreTaskProcessor.cs | 35 +++++++++++++++ .../Install/RunSitecoreTasksProcessor.cs | 40 +++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 src/SIM.Pipelines/Install/GenerateScriptProcessor.cs create mode 100644 src/SIM.Pipelines/Install/Install9Args.cs create mode 100644 src/SIM.Pipelines/Install/Run9Installation.cs create mode 100644 src/SIM.Pipelines/Install/RunSitecoreTaskProcessor.cs create mode 100644 src/SIM.Pipelines/Install/RunSitecoreTasksProcessor.cs diff --git a/src/SIM.Pipelines/Install/GenerateScriptProcessor.cs b/src/SIM.Pipelines/Install/GenerateScriptProcessor.cs new file mode 100644 index 00000000..dc1156d0 --- /dev/null +++ b/src/SIM.Pipelines/Install/GenerateScriptProcessor.cs @@ -0,0 +1,44 @@ +using JetBrains.Annotations; +using SIM.Pipelines.Processors; +using SIM.Sitecore9Installer; +using Sitecore.Diagnostics.Base; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SIM.Pipelines.Install +{ + public class GenerateScriptProcessor : Processor + { + + string taskName; + public GenerateScriptProcessor(string TaskName) + { + Assert.ArgumentNotNullOrEmpty(TaskName, nameof(TaskName)); + this.taskName = TaskName; + } + protected override void Process([NotNull] ProcessorArgs args) + { + Install9Args arguments = (Install9Args)args; + SitecoreTask task = arguments.Tasker.Tasks.FirstOrDefault(t => t.Name == this.taskName); + Assert.ArgumentNotNull(task, nameof(task)); + string result = task.GetScript(); + if (task.State == TaskState.Failed) + { + throw new AggregateException(string.Format("Failed to execute {0} task. \n{1}", task.Name, result)); + } + + string path = Path.Combine(arguments.Tasker.GlobalParams.First(p=>p.Name== "FilesRoot").Value , "generated_scripts"); + Directory.CreateDirectory(path); + + using (StreamWriter writer = new StreamWriter(Path.Combine(path, string.Format("{0}.ps1", task.Name)))) + { + writer.Write(task.GetScript()); + } + + } + } +} diff --git a/src/SIM.Pipelines/Install/Install9Args.cs b/src/SIM.Pipelines/Install/Install9Args.cs new file mode 100644 index 00000000..f706229e --- /dev/null +++ b/src/SIM.Pipelines/Install/Install9Args.cs @@ -0,0 +1,29 @@ +using JetBrains.Annotations; +using SIM.IO; +using SIM.Pipelines.Install; +using SIM.Pipelines.Processors; +using SIM.Products; +using Sitecore.Diagnostics.Base; +using SIM.Sitecore9Installer; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SIM.Pipelines.Install +{ + public class Install9Args : ProcessorArgs + { + public Install9Args(Tasker tasker) + { + Assert.ArgumentNotNull(tasker, nameof(tasker)); + this.Tasker = tasker; + } + + public bool ScriptsOnly { get; set; } + public Tasker Tasker { get; } + + } +} diff --git a/src/SIM.Pipelines/Install/Run9Installation.cs b/src/SIM.Pipelines/Install/Run9Installation.cs new file mode 100644 index 00000000..380e8110 --- /dev/null +++ b/src/SIM.Pipelines/Install/Run9Installation.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using JetBrains.Annotations; +using SIM.Pipelines.Processors; + +namespace SIM.Pipelines.Install +{ + public class Run9Installation : Processor + { + protected override void Process([NotNull] ProcessorArgs args) + { + Thread.Sleep(10000); + } + + public override long EvaluateStepsCount([NotNull] ProcessorArgs args) + { + Install9Args arguments = (Install9Args)args; + return arguments.Tasker.Tasks.Count(t => t.ShouldRun); + } + + + } +} diff --git a/src/SIM.Pipelines/Install/RunSitecoreTaskProcessor.cs b/src/SIM.Pipelines/Install/RunSitecoreTaskProcessor.cs new file mode 100644 index 00000000..f144f2dd --- /dev/null +++ b/src/SIM.Pipelines/Install/RunSitecoreTaskProcessor.cs @@ -0,0 +1,35 @@ +using JetBrains.Annotations; +using SIM.Pipelines.Processors; +using Sitecore.Diagnostics.Base; +using SIM.Sitecore9Installer; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace SIM.Pipelines.Install +{ + public class RunSitecoreTaskProcessor : Processor + { + string taskName; + public RunSitecoreTaskProcessor(string TaskName) + { + Assert.ArgumentNotNullOrEmpty(TaskName, nameof(TaskName)); + this.taskName = TaskName; + } + + protected override void Process([NotNull] ProcessorArgs args) + { + Install9Args arguments = (Install9Args)args; + SitecoreTask task=arguments.Tasker.Tasks.FirstOrDefault(t => t.Name == this.taskName); + Assert.ArgumentNotNull(task, nameof(task)); + string result= task.Run(); + if (task.State == TaskState.Failed) + { + throw new AggregateException(string.Format("Failed to execute {0} task. \n{1}",task.Name,result)); + } + } + } +} diff --git a/src/SIM.Pipelines/Install/RunSitecoreTasksProcessor.cs b/src/SIM.Pipelines/Install/RunSitecoreTasksProcessor.cs new file mode 100644 index 00000000..de1a6dbc --- /dev/null +++ b/src/SIM.Pipelines/Install/RunSitecoreTasksProcessor.cs @@ -0,0 +1,40 @@ +using SIM.Pipelines.Processors; +using SIM.Sitecore9Installer; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SIM.Pipelines.Install +{ + public class RunSitecoreTasksProcessor : ProcessorHive + { + public override IEnumerable CreateProcessors(ProcessorArgs args) + { + Install9Args arguments = (Install9Args)args; + List processors = new List(); + foreach (SitecoreTask task in arguments.Tasker.Tasks) + { + if (!task.ShouldRun) + { + continue; + } + + Processor proc=null; + if (arguments.ScriptsOnly) + { + proc = new GenerateScriptProcessor(task.Name); + } + else + { + proc = new RunSitecoreTaskProcessor(task.Name); + } + proc.Title = task.Name; + processors.Add(proc); + } + + return processors; + } + } +} From d8d6808cb343f1cc6d1d244919342b111901d860 Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 13:04:56 -0500 Subject: [PATCH 007/188] install 9 wizard args --- .../Pipelines/Install9WizardArgs.cs | 41 +++++++++++++++++++ src/SIM.Tool.Base/SIM.Tool.Base.csproj | 5 +++ 2 files changed, 46 insertions(+) create mode 100644 src/SIM.Tool.Base/Pipelines/Install9WizardArgs.cs diff --git a/src/SIM.Tool.Base/Pipelines/Install9WizardArgs.cs b/src/SIM.Tool.Base/Pipelines/Install9WizardArgs.cs new file mode 100644 index 00000000..3bd0d8a3 --- /dev/null +++ b/src/SIM.Tool.Base/Pipelines/Install9WizardArgs.cs @@ -0,0 +1,41 @@ +using SIM.Adapters.SqlServer; +using SIM.Instances; +using SIM.IO; +using SIM.Pipelines; +using SIM.Pipelines.Install; +using SIM.Pipelines.Processors; +using SIM.Sitecore9Installer; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SIM.Tool.Base.Pipelines +{ + public class Install9WizardArgs : InstallWizardArgs + { + public Install9WizardArgs() : base() + { + + } + + public Install9WizardArgs(Instance instance) : base(instance) + { + + } + + public override ProcessorArgs ToProcessorArgs() + { + Install9Args args= new Install9Args(this.Takser); + args.ScriptsOnly = this.ScriptsOnly; + return args; + } + + public string SolrUrl { get; set; } + public string SorlRoot { get; set; } + public string ScriptRoot { get; set; } + public Tasker Takser { get; set; } + public bool ScriptsOnly { get; set; } + } +} diff --git a/src/SIM.Tool.Base/SIM.Tool.Base.csproj b/src/SIM.Tool.Base/SIM.Tool.Base.csproj index 13ff60d5..1ec43db8 100644 --- a/src/SIM.Tool.Base/SIM.Tool.Base.csproj +++ b/src/SIM.Tool.Base/SIM.Tool.Base.csproj @@ -76,6 +76,7 @@ + @@ -179,6 +180,10 @@ {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8} SIM.Pipelines + + {5c870ab3-89f2-4e24-ae5d-3593ec816495} + SIM.Sitecore9Installer + From daa7f7a76cc67b045496c14d95f07528837e76e9 Mon Sep 17 00:00:00 2001 From: Ivan Sheyenko Date: Fri, 1 Mar 2019 13:05:36 -0500 Subject: [PATCH 008/188] UI for 9 installation --- .../Install9InstanceButton.cs | 39 ++ src/SIM.Tool.Windows/MainWindowData.cs | 6 + src/SIM.Tool.Windows/SIM.Tool.Windows.csproj | 26 + .../Install/Instance9Details.xaml | 46 ++ .../Install/Instance9Details.xaml.cs | 604 ++++++++++++++++++ .../Install/Instance9SelectTasks.xaml | 31 + .../Install/Instance9SelectTasks.xaml.cs | 69 ++ .../Install/Instance9TweakInstallParams.xaml | 36 ++ .../Instance9TweakInstallParams.xaml.cs | 81 +++ src/SIM.Tool.Windows/WizardPipelinesConfig.cs | 12 + 10 files changed, 950 insertions(+) create mode 100644 src/SIM.Tool.Windows/MainWindowComponents/Install9InstanceButton.cs create mode 100644 src/SIM.Tool.Windows/UserControls/Install/Instance9Details.xaml create mode 100644 src/SIM.Tool.Windows/UserControls/Install/Instance9Details.xaml.cs create mode 100644 src/SIM.Tool.Windows/UserControls/Install/Instance9SelectTasks.xaml create mode 100644 src/SIM.Tool.Windows/UserControls/Install/Instance9SelectTasks.xaml.cs create mode 100644 src/SIM.Tool.Windows/UserControls/Install/Instance9TweakInstallParams.xaml create mode 100644 src/SIM.Tool.Windows/UserControls/Install/Instance9TweakInstallParams.xaml.cs diff --git a/src/SIM.Tool.Windows/MainWindowComponents/Install9InstanceButton.cs b/src/SIM.Tool.Windows/MainWindowComponents/Install9InstanceButton.cs new file mode 100644 index 00000000..a9b2153d --- /dev/null +++ b/src/SIM.Tool.Windows/MainWindowComponents/Install9InstanceButton.cs @@ -0,0 +1,39 @@ +using JetBrains.Annotations; +using SIM.Instances; +using SIM.Tool.Base.Pipelines; +using SIM.Tool.Base.Plugins; +using SIM.Tool.Base.Wizards; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace SIM.Tool.Windows.MainWindowComponents +{ + class Install9InstanceButton : IMainWindowButton + { + public bool IsEnabled([NotNull] Window mainWindow, [CanBeNull] Instance instance) + { + return true; + } + + public void OnClick([NotNull] Window mainWindow, [CanBeNull] Instance instance) + { + WizardPipelineManager.Start("install9", mainWindow, null, null, (args) => + { + MainWindowHelper.SoftlyRefreshInstances(); + + if (args == null) + { + return; + } + + var install = (InstallWizardArgs)args; + var product = install.Product; + + }, () => new Install9WizardArgs()); + } + } +} diff --git a/src/SIM.Tool.Windows/MainWindowData.cs b/src/SIM.Tool.Windows/MainWindowData.cs index aeea9f65..c6446c61 100644 --- a/src/SIM.Tool.Windows/MainWindowData.cs +++ b/src/SIM.Tool.Windows/MainWindowData.cs @@ -68,6 +68,12 @@ public static class MainWindowData Image = "/Images/$lg/upload.png, SIM.Tool.Windows", Handler = new SIM.Tool.Windows.MainWindowComponents.ImportInstanceButton() }, + new ButtonDefinition + { + Label = "Install Sitecore 9", + Image = "/Images/$lg/add_domain.png, SIM.Tool.Windows", + Handler = new SIM.Tool.Windows.MainWindowComponents.Install9InstanceButton() + } } }, new GroupDefinition diff --git a/src/SIM.Tool.Windows/SIM.Tool.Windows.csproj b/src/SIM.Tool.Windows/SIM.Tool.Windows.csproj index 1417d654..9348edef 100644 --- a/src/SIM.Tool.Windows/SIM.Tool.Windows.csproj +++ b/src/SIM.Tool.Windows/SIM.Tool.Windows.csproj @@ -156,6 +156,7 @@ + @@ -242,6 +243,15 @@ SetWebsiteBindings.xaml + + Instance9Details.xaml + + + Instance9SelectTasks.xaml + + + Instance9TweakInstallParams.xaml + InstanceRole9.xaml @@ -552,6 +562,18 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -708,6 +730,10 @@ {7A3FEDF8-DF96-4426-AA01-C2D4FD3E68C8} SIM.Pipelines + + {5c870ab3-89f2-4e24-ae5d-3593ec816495} + SIM.Sitecore9Installer + {EF380B2A-1171-4A9F-96D0-176ABA6CAD74} SIM.Tool.Base diff --git a/src/SIM.Tool.Windows/UserControls/Install/Instance9Details.xaml b/src/SIM.Tool.Windows/UserControls/Install/Instance9Details.xaml new file mode 100644 index 00000000..e0e1db06 --- /dev/null +++ b/src/SIM.Tool.Windows/UserControls/Install/Instance9Details.xaml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +