mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-18 04:38:09 +00:00
Adding version as a param to dev-deploy script (#239)
This commit is contained in:
@ -1,8 +1,13 @@
|
|||||||
param (
|
param (
|
||||||
[Parameter()]
|
[Parameter()]
|
||||||
[string] $app_dir="$PSScriptRoot",
|
[string] $app_dir = "$PSScriptRoot",
|
||||||
[Parameter(Mandatory=$true)]
|
# Specifying func app
|
||||||
[string] $target
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string] $target,
|
||||||
|
# Specifying version for function
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[string]
|
||||||
|
$version = "0.0.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -14,9 +19,11 @@ try {
|
|||||||
Set-Location __app__
|
Set-Location __app__
|
||||||
(New-Guid).Guid | Out-File onefuzzlib/build.id -Encoding ascii
|
(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 "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
|
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"
|
(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'
|
Get-Content 'onefuzzlib/build.id'
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
Reference in New Issue
Block a user