diff --git a/.gitignore b/.gitignore index bb4f4038..dd3ebbc2 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,15 @@ msvs/lua/lua/x64/ msvs/x64/ msvs/ipch msvs/RedisServer.opensdf +!msvs/RedisWaInst/bin/* +!msvs/RedisWaInst/bin/Inst4WA/* +!msvs/RedisWaInst/bin/RedisPkgBin/* +msvs/RedisWAInst/src/RedisDeployCmdlets/bin/ +msvs/RedisWAInst/src/RedisDeployCmdlets/obj/ +msvs/RedisWAInst/src/RedisInstBin/ +msvs/RedisWAInst/src/RedisInstWA/app.config +msvs/RedisWAInst/src/RedisInstWA/bin/ +msvs/RedisWAInst/src/RedisInstWA/obj/ +msvs/RedisWAInst/src/RedisServer/bin/ +msvs/RedisWAInst/src/RedisServer/obj/ + diff --git a/msvs/RedisWAInst/README.md b/msvs/RedisWAInst/README.md index a53bf67d..c178c035 100644 --- a/msvs/RedisWAInst/README.md +++ b/msvs/RedisWAInst/README.md @@ -10,10 +10,10 @@ Deploying Redis to Windows Azure RedisInstWA command line ------------------------ -RedisInst4WA –Source <path to redis exe or URL to ZIP> -Config <path to cscfg file folder> -RedisConf <path to redis.conf file folder> -Domain <Azure domain> -Subscription <Azure subscription> [--Pass <other parameters>] +RedisInst4WA –Source <path to redis exe or URL to ZIP> -Config <path to cscfg file folder> -RedisConf <path to redis.conf file folder> -Domain <Azure domain> -Subscription <Azure subscription> [-X64] [--Pass <other parameters>] If deploying to the Azure emulator, then use –Emu in place of –Domain and –Subscription. -Note that the Source may be to local Redis exe files, or may reference a GitHub zip file. +Note that the Source may be to local Redis exe files, or may reference a GitHub zip file. If using a zip file, the 32 bit binaries are used by default. To use the 64 bit binaries include the optional -X64 parameter. For example: -Source https://github.com/MSOpenTech/redis/archive/2.4.zip will download the zip file for the latest code for branch 2.4. @@ -26,7 +26,7 @@ After downloading files, you may have to unblock the DLLs to enable them to be u ### Pass-through parameters * StorageAccountName – default DomainName + ‘stg’ * DeploymentName – default DomainName + ‘deploy’ -* Region – default ‘North Central US’ +* Region – default ‘West US’ * DeploymentOption – default ‘Production’ * PublishSettingsFilePath – default is any file in –Config folder with publishsettings extension. diff --git a/msvs/RedisWAInst/bin/Inst4WA/DeployCmdlets4WA.dll b/msvs/RedisWAInst/bin/Inst4WA/DeployCmdlets4WA.dll index 70e42ed5..6b850ef2 100644 Binary files a/msvs/RedisWAInst/bin/Inst4WA/DeployCmdlets4WA.dll and b/msvs/RedisWAInst/bin/Inst4WA/DeployCmdlets4WA.dll differ diff --git a/msvs/RedisWAInst/bin/Inst4WA/Inst4WA.exe b/msvs/RedisWAInst/bin/Inst4WA/Inst4WA.exe new file mode 100644 index 00000000..b0adafb3 Binary files /dev/null and b/msvs/RedisWAInst/bin/Inst4WA/Inst4WA.exe differ diff --git a/msvs/RedisWAInst/bin/RedisDeployCmdlets.dll b/msvs/RedisWAInst/bin/RedisDeployCmdlets.dll index 8db8fc20..a8c991b7 100644 Binary files a/msvs/RedisWAInst/bin/RedisDeployCmdlets.dll and b/msvs/RedisWAInst/bin/RedisDeployCmdlets.dll differ diff --git a/msvs/RedisWAInst/bin/RedisInstWA.exe b/msvs/RedisWAInst/bin/RedisInstWA.exe new file mode 100644 index 00000000..13fb3009 Binary files /dev/null and b/msvs/RedisWAInst/bin/RedisInstWA.exe differ diff --git a/msvs/RedisWAInst/bin/RedisPkgBin/RedisServer.dll b/msvs/RedisWAInst/bin/RedisPkgBin/RedisServer.dll index d4209ed9..c6413332 100644 Binary files a/msvs/RedisWAInst/bin/RedisPkgBin/RedisServer.dll and b/msvs/RedisWAInst/bin/RedisPkgBin/RedisServer.dll differ diff --git a/msvs/RedisWAInst/src/RedisDeployCmdlets/RedisDeployCmdlets.csproj b/msvs/RedisWAInst/src/RedisDeployCmdlets/RedisDeployCmdlets.csproj index 77925c48..a156305d 100644 --- a/msvs/RedisWAInst/src/RedisDeployCmdlets/RedisDeployCmdlets.csproj +++ b/msvs/RedisWAInst/src/RedisDeployCmdlets/RedisDeployCmdlets.csproj @@ -10,13 +10,17 @@ Properties RedisDeployCmdlets RedisDeployCmdlets - v3.5 + v4.0 512 - - SAK - SAK - SAK - SAK + Client + + + + + + + + true @@ -49,19 +53,8 @@ - - True - True - Resources.resx - - - - ResXFileCodeGenerator - Resources.Designer.cs - - Always diff --git a/msvs/RedisWAInst/src/RedisInstWA/ExtractZip.cs b/msvs/RedisWAInst/src/RedisInstWA/ExtractZip.cs index 63c206c1..5e6ad1ba 100644 --- a/msvs/RedisWAInst/src/RedisInstWA/ExtractZip.cs +++ b/msvs/RedisWAInst/src/RedisInstWA/ExtractZip.cs @@ -42,13 +42,13 @@ namespace RedisInstWA down.Download(uri, path); } - public string FindBinZip(string path) + public string FindBinZip(string path, string binzip) { IEnumerable subdirs = Directory.EnumerateDirectories(path); if (subdirs != null && subdirs.Count() > 0) { string subpath = Path.Combine(path, subdirs.First()); - string binpath = Path.Combine(subpath, @"msvs\bin\release\redisbin.zip"); + string binpath = Path.Combine(subpath, @"msvs\bin\release\", binzip); if (File.Exists(binpath)) { return binpath; @@ -66,7 +66,7 @@ namespace RedisInstWA outdir.CopyHere(inzip.Items(), 0); // 4 for no progress dialog, 16 for Yes to all } - public int DownloadAndExtract(string zipurl, string workPath, string binfolder) + public int DownloadAndExtract(string zipurl, string workPath, string binfolder, bool isX64) { string zippath = Path.Combine(workPath, "zipfile"); if (!FolderHelper.MakeFolderReset(zippath)) @@ -87,11 +87,12 @@ namespace RedisInstWA // unzip the downloaded file ExtractFilesFromZip(zipfile, zippath); - string embeddedzip = FindBinZip(zippath); + string binzip = isX64 ? "redisbin64.zip" : "redisbin.zip"; + string embeddedzip = FindBinZip(zippath, binzip); if (embeddedzip == null) { // binaries zip not found - Console.WriteLine("Did not find redisbin.zip in downloaded zip file"); + Console.WriteLine("Did not find {0} in downloaded zip file", binzip); return 2; } string binpath = Path.Combine(workPath, binfolder); diff --git a/msvs/RedisWAInst/src/RedisInstWA/InstWaXml.cs b/msvs/RedisWAInst/src/RedisInstWA/InstWaXml.cs index ab12c258..cfee99b2 100644 --- a/msvs/RedisWAInst/src/RedisInstWA/InstWaXml.cs +++ b/msvs/RedisWAInst/src/RedisInstWA/InstWaXml.cs @@ -99,7 +99,7 @@ namespace RedisInstWA - + "; @@ -166,7 +166,7 @@ namespace RedisInstWA // Master role install // {0} is index for role - should be 0 private const string instXmlMasterRoleStep = -@" +@" @@ -190,7 +190,7 @@ namespace RedisInstWA // Slave role install // {0} is index for role private const string instXmlSlaveRoleStep = -@" +@" diff --git a/msvs/RedisWAInst/src/RedisInstWA/Program.cs b/msvs/RedisWAInst/src/RedisInstWA/Program.cs index 047b36ef..6bc5be5c 100644 --- a/msvs/RedisWAInst/src/RedisInstWA/Program.cs +++ b/msvs/RedisWAInst/src/RedisInstWA/Program.cs @@ -44,6 +44,7 @@ namespace RedisInstWA static string Domain; static string Subscription; static string passThough; + static bool IsX64; // Values from environment or configuration static string WorkPath; @@ -136,6 +137,7 @@ namespace RedisInstWA bool isRedisConf = false; bool isEmuOrAzure = false; passThough = ""; + IsX64 = false; for (int i = 0; i < args.Length; i++) { @@ -311,6 +313,10 @@ namespace RedisInstWA } break; } + else if (args[i].StartsWith("-X64", StringComparison.InvariantCultureIgnoreCase)) + { + IsX64 = true; + } else { Console.WriteLine("Unknown option specified " + args[i]); @@ -364,7 +370,7 @@ namespace RedisInstWA if (!IsLocal) { ExtractZip exz = new ExtractZip(); - int rc = exz.DownloadAndExtract(GitUrl, workPath, BinariesSubDir); + int rc = exz.DownloadAndExtract(GitUrl, workPath, BinariesSubDir, IsX64); isCopied = rc == 0; } else @@ -441,8 +447,8 @@ namespace RedisInstWA string args = "-XmlConfigPath " + @"""" + Path.Combine(WorkPath, "XmlConfig.xml") + @""""; if (!IsEmul) { - // append DomainName and Subscription - args = args + " -DomainName " + Domain + " -Subscription " + Subscription; + // append DomainName and Subscription, enclosing values in quotes + args = args + " -DomainName " + @"""" + Domain + @"""" + " -Subscription " + @"""" + Subscription + @""""; } // append passthrough args args = args + passThough; @@ -486,6 +492,7 @@ namespace RedisInstWA "-Source : URL to download redis. For example:\r\n" + " 'https://github.com/MSOpenTech/redis/archive/2.4.zip'\r\n" + "-Source : local path to folder with redis exe files\r\n" + + "-X64: Use this to deploy 64bit binaries. If omitted then 32bit binaries are used\r\n" + "-Config : local path to folder with .csdef file\r\n" + "-RedisConf : local path to folder with redis.conf file\r\n" + "-Emu: Use this if deploying to emulator\r\n" + diff --git a/msvs/RedisWAInst/src/RedisInstWA/RedisInstWA.csproj b/msvs/RedisWAInst/src/RedisInstWA/RedisInstWA.csproj index 1408f208..6bacd146 100644 --- a/msvs/RedisWAInst/src/RedisInstWA/RedisInstWA.csproj +++ b/msvs/RedisWAInst/src/RedisInstWA/RedisInstWA.csproj @@ -13,10 +13,14 @@ v4.0 Client 512 - SAK - SAK - SAK - SAK + + + + + + + + x86 @@ -67,6 +71,9 @@ True + + + XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.exe" "$(SolutionDir)RedisInstBin" diff --git a/msvs/RedisWAInst/src/RedisServer/RedisServer.csproj b/msvs/RedisWAInst/src/RedisServer/RedisServer.csproj index 9c48694c..bc31ceec 100644 --- a/msvs/RedisWAInst/src/RedisServer/RedisServer.csproj +++ b/msvs/RedisWAInst/src/RedisServer/RedisServer.csproj @@ -28,10 +28,16 @@ false false true - SAK - SAK - SAK - SAK + + + + + + + + + + true diff --git a/msvs/RedisWAInst/src/RedisWAInst.sln b/msvs/RedisWAInst/src/RedisWAInst.sln index ef51300b..972f0d41 100644 --- a/msvs/RedisWAInst/src/RedisWAInst.sln +++ b/msvs/RedisWAInst/src/RedisWAInst.sln @@ -8,21 +8,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedisInstWA", "RedisInstWA\RedisInstWA.csproj", "{C8A325BB-0BF9-4A53-941E-3A84C2B27124}" EndProject Global - GlobalSection(TeamFoundationVersionControl) = preSolution - SccNumberOfProjects = 4 - SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} - SccTeamFoundationServer = https://tfs1.interop.msftlabs.com/tfs/interop%20team%20projects - SccProjectUniqueName0 = RedisDeployCmdlets\\RedisDeployCmdlets.csproj - SccProjectName0 = RedisDeployCmdlets - SccLocalPath0 = RedisDeployCmdlets - SccProjectUniqueName1 = RedisServer\\RedisServer.csproj - SccProjectName1 = RedisServer - SccLocalPath1 = RedisServer - SccProjectUniqueName2 = RedisInstWA\\RedisInstWA.csproj - SccProjectName2 = RedisInstWA - SccLocalPath2 = RedisInstWA - SccLocalPath3 = . - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms