Skip to content

Commit

Permalink
Merge pull request #17 from sabinio/bug_fix
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
RichieBzzzt authored Oct 23, 2017
2 parents 1d89e85 + 4f6d3f1 commit 00a3a09
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AssistDeploy.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>AssistDeploy</id>
<version>1.4.0.0</version>
<version>1.4.0.1</version>
<authors>SabinIO</authors>
<description>SSIS Deploy PowerShell Module</description>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion AssistDeploy.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
NestedModules = @()

# Version number of this module.
ModuleVersion = '1.4.0.0'
ModuleVersion = '1.4.0.1'

# ID used to uniquely identify this module
GUID = '00049e8b-6f5f-41be-8e36-31d500ee53b9'
Expand Down
9 changes: 9 additions & 0 deletions Functions/ImportJson.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ $ssisJson = Import-Json -jsonPath "C:\Users\SQLTraining\Documents\iscPublish.jso
throw $_.Exception
}
}
else{
try {
Write-Verbose "Testing the environment variables in json file have a value... " -Verbose
Test-VariablesForPublishProfile -jsonPsCustomObject $jsonTested -localVariables
}
catch {
throw $_.Exception
}
}
try {
Write-Verbose "Testing project params in project.params match the project params in the json file..." -Verbose
Test-ProjectParamsMatch -jsonObject $jsonTested -ispacPath $ispacPath
Expand Down
11 changes: 9 additions & 2 deletions Functions/PublishSsisVariables.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,15 @@ Non-mandatory params here can be used to overwrite the values stored in the publ
)
)
AND p.project_id = (
select er.project_id from CATALOG.environment_references er
where er.environment_name = @0)
SELECT er.project_id
FROM CATALOG.environment_references er
WHERE er.environment_name = @0
AND er.project_id = (
SELECT project_id
FROM CATALOG.projects proj
WHERE proj.NAME = @1
)
)
)
SELECT referenced_variable_name, CASE eevee.sensitive WHEN 0 THEN 'False' ELSE 'True' END as sensitive, eevee.description, eevee.type as data_type, eevee.value
FROM cte
Expand Down
17 changes: 16 additions & 1 deletion Functions/TestVariablesForPublishProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ function Test-VariablesForPublishProfile {
param
(
[Parameter(Position = 0, mandatory = $true)]
[PSCustomObject] $jsonPsCustomObject
[PSCustomObject] $jsonPsCustomObject,
[Parameter(Position = 0, mandatory = $false)]
[Switch] $localVariables
)
$missingVariables = @()
$ssisJson = $jsonPsCustomObject
Expand All @@ -26,4 +28,17 @@ function Test-VariablesForPublishProfile {
throw ('The following ssisEnvironmentVariable variables are not defined in the session (but are defined in the json file): {0}' -f ($missingVariables -join " `n"))
}
}
else{
Write-Verbose "Validating that each environment variable named in json file has a value." -Verbose
$keys = $($ssisJson.ssisEnvironmentVariable)
foreach ($var in $keys)
{
$varValue = $var.Value
if ($varValue.Length -eq 0)
{
$msg = "$($var.VariableName) does not have a value. Cannot use switch -localVariables where an environment variable does nto have a value. "
Throw $msg
}
}
}
}

0 comments on commit 00a3a09

Please sign in to comment.