Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions step-templates/file-system-zip-directory-contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"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[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": {},
Expand Down Expand Up @@ -57,12 +57,12 @@
}
}
],
"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"
},
"Category": "filesystem"
}
}