From f50d40498db376889c5e5f20567ca31d6fe6ce66 Mon Sep 17 00:00:00 2001 From: Aishwarya Bhandari <37918412+aishwaryabh@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:08:20 -0800 Subject: [PATCH] Fix linux package pipeline (#4192) * getting linux pacakging to work * adding as env variable * addign sudo * script update * remove sudo from python script * changing cdn link --- eng/ci/linux-build.yml | 1 + eng/ci/templates/official/jobs/linux-package.yml | 14 +++++++++----- publish-scripts/driver.py | 2 +- publish-scripts/shared/helper.py | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/eng/ci/linux-build.yml b/eng/ci/linux-build.yml index 8c23a52a7..6d5343e8b 100644 --- a/eng/ci/linux-build.yml +++ b/eng/ci/linux-build.yml @@ -6,6 +6,7 @@ trigger: branches: include: - v4.x + - feature/oop-host resources: repositories: diff --git a/eng/ci/templates/official/jobs/linux-package.yml b/eng/ci/templates/official/jobs/linux-package.yml index fc35ee500..e45f47eb0 100644 --- a/eng/ci/templates/official/jobs/linux-package.yml +++ b/eng/ci/templates/official/jobs/linux-package.yml @@ -1,6 +1,6 @@ jobs: - job: LinuxPackage - condition: ne(variables['LinuxPackageBuildTag'], '') + condition: and(ne(variables['LinuxPackageBuildTag'], ''), ne(variables['ConsolidatedBuildId'], '')) timeoutInMinutes: "120" pool: name: 1es-pool-azfunc @@ -16,16 +16,20 @@ jobs: cd publish-scripts python3 -m venv publish-env source publish-env/bin/activate + pip install -r requirements.txt - apt-get install fakeroot + pip install wget + + sudo apt-get install fakeroot major_version=$(echo "$linuxBuildNumber" | cut -d'.' -f1) - python driver.py "$linuxBuildNumber" "$major_version" - python driver.py "$linuxBuildNumber" + python driver.py "$linuxBuildNumber" "$consolidatedBuildId" "$major_version" + python driver.py "$linuxBuildNumber" "$consolidatedBuildId" export DEB_PACKAGE="$(readlink -f artifact/*$RELEASE_VERSION*)" echo "${DEB_PACKAGE}" bashEnvValue: '~/.profile' # Set value for BASH_ENV environment variable env: - linuxBuildNumber: $(LinuxPackageBuildTag) + linuxBuildNumber: $(LinuxPackageBuildTag) + consolidatedBuildId: $(ConsolidatedBuildId) - pwsh: | echo $env:LinuxPackageAccountName $majorVersion = [math]::Floor([double]$env:LinuxPackageBuildTag.Split(".")[0]) diff --git a/publish-scripts/driver.py b/publish-scripts/driver.py index 8590b4a51..128cb3431 100644 --- a/publish-scripts/driver.py +++ b/publish-scripts/driver.py @@ -13,7 +13,7 @@ def main(*args): print(f"args: {args} {len(args)}") if (len(args) >= 4): - packageNamePostfix = "-" + args[2] + packageNamePostfix = "-" + args[3] constants.PACKAGENAME = constants.PACKAGENAME + packageNamePostfix print(f"constants.PACKAGENAME: {constants.PACKAGENAME}") diff --git a/publish-scripts/shared/helper.py b/publish-scripts/shared/helper.py index c3cacfc4f..0ec47d2de 100644 --- a/publish-scripts/shared/helper.py +++ b/publish-scripts/shared/helper.py @@ -58,7 +58,7 @@ def linuxOutput(buildFolder): # ubuntu dropped 64, fedora supports both fileName = f"Azure.Functions.Cli.linux-x64.{constants.VERSION}.zip" - url = f'https://functionscdn.azureedge.net/public/{constants.VERSION}/{fileName}' + url = f'https://functionscdn.azureedge.net/public/4.0.{constants.CONSOLIDATED_BUILD_ID}/{fileName}' # download the zip # output to local folder