From b0a99303b7b8106789c66b90a45077a31d71937d Mon Sep 17 00:00:00 2001 From: curiousdev Date: Thu, 8 Feb 2018 15:24:21 -0700 Subject: [PATCH 1/2] Update file-system-zip-directory-contents.json Include a variable assignment for Assembly.LoadWithPartialName() so that this object is not piped into the log-output. This simplifies what information is logged. --- step-templates/file-system-zip-directory-contents.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/step-templates/file-system-zip-directory-contents.json b/step-templates/file-system-zip-directory-contents.json index cb94c80a3..ff04a5615 100644 --- a/step-templates/file-system-zip-directory-contents.json +++ b/step-templates/file-system-zip-directory-contents.json @@ -5,7 +5,7 @@ "ActionType": "Octopus.Script", "Version": 11, "Properties": { - "Octopus.Action.Script.ScriptBody": "$SourceDirectoryName = $OctopusParameters['SourceDirectoryName']\r\n$DestinationArchiveFileName = $OctopusParameters['DestinationArchiveFileName']\r\n$CompressionLevel = $OctopusParameters['CompressionLevel']\r\n$IncludeBaseDirectory = $OctopusParameters['IncludeBaseDirectory']\r\n$OverwriteDestination = $OctopusParameters['OverwriteDestination']\r\n\r\nif (!$SourceDirectoryName)\r\n{\r\n Write-Error \"No Source Directory name was specified. Please specify the name of the directory to that will be zipped.\"\r\n exit -2\r\n}\r\n\r\nif (!$DestinationArchiveFileName)\r\n{\r\n Write-Error \"No Destination Archive File name was specified. Please specify the name of the zip file to be created.\"\r\n exit -2\r\n}\r\n\r\nif (($OverwriteDestination) -and (Test-Path $DestinationArchiveFileName))\r\n{\r\n Write-Host \"$DestinationArchiveFileName already exists. Will delete it before we create a new zip file with the same name.\"\r\n Remove-Item $DestinationArchiveFileName\r\n}\r\n\r\nWrite-Host \"Creating Zip file $DestinationArchiveFileName with the contents of directory $SourceDirectoryName using compression level $CompressionLevel\"\r\n\r\n[Reflection.Assembly]::LoadWithPartialName(\"System.IO.Compression.FileSystem\")\r\n[System.IO.Compression.ZipFile]::CreateFromDirectory($SourceDirectoryName, $DestinationArchiveFileName, $CompressionLevel, $IncludeBaseDirectory)\r\n", + "Octopus.Action.Script.ScriptBody": "$SourceDirectoryName = $OctopusParameters['SourceDirectoryName']\r\n$DestinationArchiveFileName = $OctopusParameters['DestinationArchiveFileName']\r\n$CompressionLevel = $OctopusParameters['CompressionLevel']\r\n$IncludeBaseDirectory = $OctopusParameters['IncludeBaseDirectory']\r\n$OverwriteDestination = $OctopusParameters['OverwriteDestination']\r\n\r\nif (!$SourceDirectoryName)\r\n{\r\n Write-Error \"No Source Directory name was specified. Please specify the name of the directory to that will be zipped.\"\r\n exit -2\r\n}\r\n\r\nif (!$DestinationArchiveFileName)\r\n{\r\n Write-Error \"No Destination Archive File name was specified. Please specify the name of the zip file to be created.\"\r\n exit -2\r\n}\r\n\r\nif (($OverwriteDestination) -and (Test-Path $DestinationArchiveFileName))\r\n{\r\n Write-Host \"$DestinationArchiveFileName already exists. Will delete it before we create a new zip file with the same name.\"\r\n Remove-Item $DestinationArchiveFileName\r\n}\r\n\r\nWrite-Host \"Creating Zip file $DestinationArchiveFileName with the contents of directory $SourceDirectoryName using compression level $CompressionLevel\"\r\n\r\n$assembly = [Reflection.Assembly]::LoadWithPartialName(\"System.IO.Compression.FileSystem\")\r\n[System.IO.Compression.ZipFile]::CreateFromDirectory($SourceDirectoryName, $DestinationArchiveFileName, $CompressionLevel, $IncludeBaseDirectory)\r\n", "Octopus.Action.Script.Syntax": "PowerShell" }, "SensitiveProperties": {}, @@ -65,4 +65,4 @@ "Type": "ActionTemplate" }, "Category": "filesystem" -} \ No newline at end of file +} From ffbd48e99447d0164b370649c4c59c8425e58f6d Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Fri, 9 Feb 2018 09:50:54 +1000 Subject: [PATCH 2/2] Bump version and last modified details --- step-templates/file-system-zip-directory-contents.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/step-templates/file-system-zip-directory-contents.json b/step-templates/file-system-zip-directory-contents.json index ff04a5615..24137c746 100644 --- a/step-templates/file-system-zip-directory-contents.json +++ b/step-templates/file-system-zip-directory-contents.json @@ -3,7 +3,7 @@ "Name": "File System - Zip Directory Contents", "Description": "Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level, and optionally includes the base directory.\n\nRequires .NET 4.5 as it relies on the `System.IO.Compression.ZipFile` class.", "ActionType": "Octopus.Script", - "Version": 11, + "Version": 12, "Properties": { "Octopus.Action.Script.ScriptBody": "$SourceDirectoryName = $OctopusParameters['SourceDirectoryName']\r\n$DestinationArchiveFileName = $OctopusParameters['DestinationArchiveFileName']\r\n$CompressionLevel = $OctopusParameters['CompressionLevel']\r\n$IncludeBaseDirectory = $OctopusParameters['IncludeBaseDirectory']\r\n$OverwriteDestination = $OctopusParameters['OverwriteDestination']\r\n\r\nif (!$SourceDirectoryName)\r\n{\r\n Write-Error \"No Source Directory name was specified. Please specify the name of the directory to that will be zipped.\"\r\n exit -2\r\n}\r\n\r\nif (!$DestinationArchiveFileName)\r\n{\r\n Write-Error \"No Destination Archive File name was specified. Please specify the name of the zip file to be created.\"\r\n exit -2\r\n}\r\n\r\nif (($OverwriteDestination) -and (Test-Path $DestinationArchiveFileName))\r\n{\r\n Write-Host \"$DestinationArchiveFileName already exists. Will delete it before we create a new zip file with the same name.\"\r\n Remove-Item $DestinationArchiveFileName\r\n}\r\n\r\nWrite-Host \"Creating Zip file $DestinationArchiveFileName with the contents of directory $SourceDirectoryName using compression level $CompressionLevel\"\r\n\r\n$assembly = [Reflection.Assembly]::LoadWithPartialName(\"System.IO.Compression.FileSystem\")\r\n[System.IO.Compression.ZipFile]::CreateFromDirectory($SourceDirectoryName, $DestinationArchiveFileName, $CompressionLevel, $IncludeBaseDirectory)\r\n", "Octopus.Action.Script.Syntax": "PowerShell" @@ -57,10 +57,10 @@ } } ], - "LastModifiedOn": "2014-09-28T03:51:38.817+00:00", - "LastModifiedBy": "caioproiete", + "LastModifiedOn": "2018-02-08T22:24:00.817+00:00", + "LastModifiedBy": "curiousdev", "$Meta": { - "ExportedAt": "2014-09-28T03:52:02.427+00:00", + "ExportedAt": "2018-02-08T22:24:00.817+00:00", "OctopusVersion": "2.5.8.447", "Type": "ActionTemplate" },