Skip to content

Commit

Permalink
Add SetPackageVersion function
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Dec 4, 2020
1 parent d2f14ed commit 5ad4464
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ function Update-python-CIConfig($pkgs, $ciRepo, $locationInDocRepo, $monikerId=$
Set-Content -Path $pkgJsonLoc -Value $jsonContent
}

function GetExistingPackageVersions ($PackageName, $GroupId=$null)
{
function GetExistingPackageVersions ($PackageName, $GroupId=$null) {
try
{
$existingVersion = Invoke-RestMethod -Method GET -Uri "https://pypi.python.org/pypi/${PackageName}/json"
Expand All @@ -192,4 +191,9 @@ function GetExistingPackageVersions ($PackageName, $GroupId=$null)
LogError "Failed to retieve package versions. `n$_"
return $null
}
}
}

function SetPackageVersion ($PackageName, $Version, $ServiceName) {
pip install -r "$EngDir/versioning/requirements.txt"
python "$EngDir/versioning/version_set.py" --package-name $PackageName --new-version $Version --service $ServiceName
}

0 comments on commit 5ad4464

Please sign in to comment.