mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 20:38:06 +00:00
Adding version as a param to dev-deploy script (#239)
This commit is contained in:
@ -1,11 +1,16 @@
|
||||
param (
|
||||
[Parameter()]
|
||||
[string] $app_dir="$PSScriptRoot",
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string] $target
|
||||
[string] $app_dir = "$PSScriptRoot",
|
||||
# Specifying func app
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string] $target,
|
||||
# Specifying version for function
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string]
|
||||
$version = "0.0.0"
|
||||
)
|
||||
|
||||
try {
|
||||
try {
|
||||
Push-Location
|
||||
Set-Location "$app_dir/../pytypes"
|
||||
python setup.py sdist bdist_wheel
|
||||
@ -14,9 +19,11 @@ try {
|
||||
Set-Location __app__
|
||||
(New-Guid).Guid | Out-File onefuzzlib/build.id -Encoding ascii
|
||||
(Get-Content -path "requirements.txt") -replace 'onefuzztypes==0.0.0', './onefuzztypes-0.0.0-py3-none-any.whl' | Out-File "requirements.txt"
|
||||
(Get-Content -path "onefuzzlib/__version__.py") -replace '__version__ = "0.0.0"', "__version__ = ""$version""" | Out-File "onefuzzlib/__version__.py" -Encoding utf8
|
||||
func azure functionapp publish $target --python
|
||||
(Get-Content -path "onefuzzlib/__version__.py") -replace "__version__ = ""$version""", '__version__ = "0.0.0"' | Out-File "onefuzzlib/__version__.py" -Encoding utf8
|
||||
(Get-Content -path "requirements.txt") -replace './onefuzztypes-0.0.0-py3-none-any.whl', 'onefuzztypes==0.0.0' | Out-File "requirements.txt"
|
||||
Remove-Item 'onefuzztypes-0.0.0-py3-none-any.whl'
|
||||
Remove-Item 'onefuzztypes-*-py3-none-any.whl'
|
||||
Get-Content 'onefuzzlib/build.id'
|
||||
}
|
||||
finally {
|
||||
|
Reference in New Issue
Block a user