Run python application tool by Jenkins

Note: Run python application tool by Jenkins

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# powershell script
#(Get-Host).Version
$Workspace=$env:Workspace
#Write-Host $env:Workspace
#Write-Host $Workspace
Write-Host "****Update file attribute to not ReadOnly for pyvenv.cfg*****"
sp $Workspace\QA\Nigthwish\TransactionValidation\pyvenv.cfg IsReadOnly $false
Write-Host "****Update content for pyvenv.cfg*****"
(Get-ItemProperty $Workspace\QA\Nigthwish\TransactionValidatio\pyvenv.cfg).IsReadOnly
$content="home = $Workspace\QA\Nigthwish\DBValidation\Python-3.7.1`ninclude-system-site-packages = false`nversion = 3.7.1"
#Write-Host "content:"$content
$filename="$Workspace\QA\Nigthwish\TransactionValidation\pyvenv.cfg"
#Write-Host "filename:"$filename
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[IO.File]::WriteAllLines($filename, $content, $Utf8NoBomEncoding)
#Get-Content $Workspace \QA\Nigthwish\TransactionValidatio\pyvenv.cfg
Write-Host "****pyvenv.cfg update is completed*****"
1
2
3
:: this is a windows command
::more %Workspace%\QA\Nigthwish\TransactionValidation\pyvenv.cfg
%Workspace%\QA\Nigthwish\TransactionValidation\Scripts\python %Workspace%\QA\Nigthwish\TransactionValidatio\src\prodDBValidation.py -plan %PLANN_NAME% -project %TESTRAIL_PROJECT%