Skip to content

Commit

Permalink
[Packaging] Build MSI/Homebrew packages with dependecies resolved fro…
Browse files Browse the repository at this point in the history
…m requirements.txt (#13353)
  • Loading branch information
fengzhou-msft authored May 12, 2020
1 parent 0fc82ed commit 827774b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 32 deletions.
12 changes: 2 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,6 @@ jobs:
TargetPath: '$(Build.ArtifactStagingDirectory)/metadata'
artifactName: metadata


- task: DownloadPipelineArtifact@1
displayName: 'Download PyPI Packages'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi

- bash: |
#!/bin/bash
Expand All @@ -528,11 +521,11 @@ jobs:
HOMEBREW_UPSTREAM_URL=`curl -Ls -o /dev/null -w %{url_effective} https://api.github.com/repos/Azure/azure-cli/tarball/$BUILD_SOURCEVERSION`
docker_files=$(cd $BUILD_SOURCESDIRECTORY/scripts/release/homebrew/docker; pwd)
pypi_files=$(cd $BUILD_ARTIFACTSTAGINGDIRECTORY/pypi; pwd)
src_files=$(cd $BUILD_SOURCESDIRECTORY/src; pwd)
echo "Generating formula in docker container ... "
docker run -v $docker_files:/mnt/scripts \
-v $pypi_files:/mnt/pypi \
-v $src_files:/mnt/src \
-e CLI_VERSION=$CLI_VERSION \
-e HOMEBREW_UPSTREAM_URL=$HOMEBREW_UPSTREAM_URL \
--name azurecli \
Expand All @@ -541,7 +534,6 @@ jobs:
# clean up
rm -rf $BUILD_ARTIFACTSTAGINGDIRECTORY/metadata
rm -rf $BUILD_ARTIFACTSTAGINGDIRECTORY/pypi
docker cp azurecli:azure-cli.rb $BUILD_ARTIFACTSTAGINGDIRECTORY/azure-cli.rb
docker rm --force azurecli
Expand Down
15 changes: 3 additions & 12 deletions build_scripts/windows/scripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,17 @@ set PYTHON_EXE=%PYTHON_DIR%\python.exe

robocopy %PYTHON_DIR% %BUILDING_DIR% /s /NFL /NDL

:: Build & install all the packages with bdist_wheel
%BUILDING_DIR%\python.exe -m pip install wheel
echo Building CLI packages...
set CLI_SRC=%REPO_ROOT%\src
%BUILDING_DIR%\python.exe -m pip install --no-warn-script-location --force-reinstall pycparser==2.18
for %%a in (%CLI_SRC%\azure-cli %CLI_SRC%\azure-cli-core %CLI_SRC%\azure-cli-nspkg %CLI_SRC%\azure-cli-telemetry) do (
pushd %%a
%BUILDING_DIR%\python.exe setup.py bdist_wheel -d %TEMP_SCRATCH_FOLDER%
%BUILDING_DIR%\python.exe -m pip install --no-warn-script-location --no-cache-dir --no-deps .
popd
)
echo Built CLI packages successfully.
%BUILDING_DIR%\python.exe -m pip install -r %CLI_SRC%\azure-cli\requirements.py3.windows.txt

if %errorlevel% neq 0 goto ERROR

set ALL_MODULES=
for %%i in (%TEMP_SCRATCH_FOLDER%\*.whl) do (
set ALL_MODULES=!ALL_MODULES! %%i
)
echo All modules: %ALL_MODULES%
%BUILDING_DIR%\python.exe -m pip install --no-warn-script-location --force-reinstall pycparser==2.18
%BUILDING_DIR%\python.exe -m pip install --no-warn-script-location --no-cache-dir %ALL_MODULES%
%BUILDING_DIR%\python.exe -m pip install --no-warn-script-location --force-reinstall --upgrade azure-nspkg azure-mgmt-nspkg
%BUILDING_DIR%\python.exe -m pip install --no-warn-script-location --force-reinstall urllib3==1.24.2

Expand Down
3 changes: 2 additions & 1 deletion scripts/release/homebrew/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ root=$(cd $(dirname $0); pwd)
pip install wheel
pip install -U pip
pip install -r $root/requirements.txt
pip install azure-cli==$CLI_VERSION -f /mnt/pypi
find /mnt/src/ -name setup.py -type f | xargs -I {} dirname {} | grep -v azure-cli-testsdk | xargs pip install --no-deps
pip install -r /mnt/src/azure-cli/requirements.py3.Darwin.txt

pip list

Expand Down
5 changes: 2 additions & 3 deletions scripts/release/homebrew/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ HOMEBREW_UPSTREAM_URL=`cat $BUILD_STAGINGDIRECTORY/github/upstream_url`
TAR_NAME=azure-cli-$CLI_VERSION.tar.gz

docker_files=$(cd $BUILD_SOURCESDIRECTORY/scripts/release/homebrew/docker; pwd)
pypi_files=$(cd $SYSTEM_ARTIFACTSDIRECTORY/pypi; pwd)
src_files=$(cd $BUILD_SOURCESDIRECTORY/src; pwd)

echo "Generating formula in docker container ... "
docker run -v $docker_files:/mnt/scripts \
-v $pypi_files:/mnt/pypi \
-v $src_files:/mnt/src \
-e CLI_VERSION=$CLI_VERSION \
-e HOMEBREW_UPSTREAM_URL=$HOMEBREW_UPSTREAM_URL \
--name azurecli \
Expand All @@ -22,7 +22,6 @@ docker run -v $docker_files:/mnt/scripts \

# clean up
rm -rf $BUILD_STAGINGDIRECTORY/metadata
rm -rf $BUILD_STAGINGDIRECTORY/pypi

docker cp azurecli:azure-cli.rb $BUILD_STAGINGDIRECTORY/azure-cli.rb
docker rm --force azurecli
4 changes: 2 additions & 2 deletions src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ azure-storage-blob==1.5.0
azure-storage-common==1.4.2
bcrypt==3.1.7
certifi==2019.6.16
cffi==1.12.3
cffi==1.14.0
chardet==3.0.4
colorama==0.4.1
ConfigArgParse==0.14.0
Expand Down Expand Up @@ -118,7 +118,7 @@ pytz==2019.1
requests==2.22.0
requests-oauthlib==1.2.0
scp==0.13.2
six==1.12.0
six==1.14.0
sshtunnel==0.1.5
tabulate==0.8.3
urllib3==1.25.3
Expand Down
4 changes: 2 additions & 2 deletions src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ azure-storage-blob==1.5.0
azure-storage-common==1.4.2
bcrypt==3.1.7
certifi==2019.6.16
cffi==1.12.3
cffi==1.14.0
chardet==3.0.4
colorama==0.4.1
ConfigArgParse==0.14.0
Expand Down Expand Up @@ -119,7 +119,7 @@ pytz==2019.1
requests==2.22.0
requests-oauthlib==1.2.0
scp==0.13.2
six==1.12.0
six==1.14.0
sshtunnel==0.1.5
tabulate==0.8.3
urllib3==1.25.3
Expand Down
4 changes: 2 additions & 2 deletions src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ azure-storage-blob==1.5.0
azure-storage-common==1.4.2
bcrypt==3.1.7
certifi==2019.6.16
cffi==1.12.3
cffi==1.14.0
chardet==3.0.4
colorama==0.4.1
cryptography==2.8
Expand Down Expand Up @@ -119,7 +119,7 @@ pywin32==225
requests==2.22.0
requests-oauthlib==1.2.0
scp==0.13.2
six==1.12.0
six==1.14.0
sshtunnel==0.1.5
tabulate==0.8.3
urllib3==1.25.3
Expand Down

0 comments on commit 827774b

Please # to comment.