From f2855b852ba10c6962c32dd283687169da8d3b42 Mon Sep 17 00:00:00 2001 From: Feng Zhou <55177366+fengzhou-msft@users.noreply.github.com> Date: Thu, 21 Nov 2019 09:56:55 +0800 Subject: [PATCH] Revert el8 package build (#11325) --- scripts/release/rpm/Dockerfile.centos | 2 +- scripts/release/rpm/Dockerfile.centos8 | 24 ------------------------ scripts/release/rpm/azure-cli.spec | 2 +- scripts/release/rpm/pipeline.sh | 23 ----------------------- src/azure-cli/HISTORY.rst | 1 + 5 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 scripts/release/rpm/Dockerfile.centos8 diff --git a/scripts/release/rpm/Dockerfile.centos b/scripts/release/rpm/Dockerfile.centos index 1c7b89431a3..a3ca29f1324 100644 --- a/scripts/release/rpm/Dockerfile.centos +++ b/scripts/release/rpm/Dockerfile.centos @@ -12,7 +12,7 @@ COPY . . RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \ REPO_PATH=$(pwd) CLI_VERSION=$cli_version rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \ - cp /root/rpmbuild/RPMS/x86_64/azure-cli-${cli_version}-1.el7.x86_64.rpm /azure-cli-dev.rpm + cp /root/rpmbuild/RPMS/x86_64/azure-cli-${cli_version}-1.*.x86_64.rpm /azure-cli-dev.rpm FROM centos:${tag} AS execution-env diff --git a/scripts/release/rpm/Dockerfile.centos8 b/scripts/release/rpm/Dockerfile.centos8 deleted file mode 100644 index 536269b31e8..00000000000 --- a/scripts/release/rpm/Dockerfile.centos8 +++ /dev/null @@ -1,24 +0,0 @@ -ARG tag=centos8 - -FROM centos:${tag} AS build-env -ARG cli_version=dev - -RUN dnf update -y -RUN dnf install --allowerasing -y wget rpm-build gcc libffi-devel python3-devel openssl-devel make bash coreutils diffutils patch dos2unix python3-virtualenv perl - -WORKDIR /azure-cli - -COPY . . - -RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \ - REPO_PATH=$(pwd) CLI_VERSION=$cli_version rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \ - cp /root/rpmbuild/RPMS/x86_64/azure-cli-${cli_version}-1.el8.x86_64.rpm /azure-cli-dev.rpm - -FROM centos:${tag} AS execution-env - -RUN dnf update -y -RUN dnf install -y python3 python3-virtualenv - -COPY --from=build-env /azure-cli-dev.rpm ./ -RUN rpm -i ./azure-cli-dev.rpm && \ - az --version diff --git a/scripts/release/rpm/azure-cli.spec b/scripts/release/rpm/azure-cli.spec index ff4a733e5a5..c7f2634c2fb 100644 --- a/scripts/release/rpm/azure-cli.spec +++ b/scripts/release/rpm/azure-cli.spec @@ -48,7 +48,7 @@ for d in %{buildroot}%{cli_lib_dir}/bin/*; do perl -p -i -e "s#%{buildroot}##g" # Create executable mkdir -p %{buildroot}%{_bindir} python_version=$(ls %{buildroot}%{cli_lib_dir}/lib/ | head -n 1) -printf "#!/usr/bin/env bash\nPYTHONPATH=%{cli_lib_dir}/lib/${python_version}/site-packages ${python_version} -sm azure.cli \"\$@\"" > %{buildroot}%{_bindir}/az +printf "#!/usr/bin/env bash\nPYTHONPATH=%{cli_lib_dir}/lib/${python_version}/site-packages %{python_cmd} -sm azure.cli \"\$@\"" > %{buildroot}%{_bindir}/az rm %{buildroot}%{cli_lib_dir}/bin/python* %{buildroot}%{cli_lib_dir}/bin/pip* # Set up tab completion diff --git a/scripts/release/rpm/pipeline.sh b/scripts/release/rpm/pipeline.sh index 73375c19803..36d44b06d5c 100755 --- a/scripts/release/rpm/pipeline.sh +++ b/scripts/release/rpm/pipeline.sh @@ -29,27 +29,6 @@ docker run \ cat /root/rpmbuild/RPMS/x86_64/azure-cli-${CLI_VERSION}-1.el7.x86_64.rpm \ > ${BUILD_STAGINGDIRECTORY}/azure-cli-${CLI_VERSION}-1.el7.x86_64.rpm -# Create a container image that includes the source code and a built RPM using this file for el8. -docker build \ - --target build-env \ - --build-arg cli_version=${CLI_VERSION} \ - -f ./scripts/release/rpm/Dockerfile.centos8 \ - -t microsoft/azure-cli:centos8-builder \ - . - -# Continue the previous build, and create a container that has the current azure-cli build but not the source code for el8. -docker build \ - --build-arg cli_version=${CLI_VERSION} \ - -f ./scripts/release/rpm/Dockerfile.centos8 \ - -t microsoft/azure-cli:centos8 \ - . - -# Extract the built RPM so that it can be distributed independently for el8. -docker run \ - microsoft/azure-cli:centos8-builder \ - cat /root/rpmbuild/RPMS/x86_64/azure-cli-${CLI_VERSION}-1.el8.x86_64.rpm \ - > ${BUILD_STAGINGDIRECTORY}/azure-cli-${CLI_VERSION}-1.el8.x86_64.rpm - # Save these too a staging directory so that later build phases can choose to save them as Artifacts or publish them to # a registry. # @@ -57,6 +36,4 @@ docker run \ mkdir -p ${BUILD_STAGINGDIRECTORY}/docker docker save microsoft/azure-cli:centos7-builder | gzip > ${BUILD_STAGINGDIRECTORY}/docker/microsoft_azure-cli_centos7-builder.tar.gz & docker save microsoft/azure-cli:centos7 | gzip > ${BUILD_STAGINGDIRECTORY}/docker/microsoft_azure-cli_centos7.tar.gz & -docker save microsoft/azure-cli:centos8-builder | gzip > ${BUILD_STAGINGDIRECTORY}/docker/microsoft_azure-cli_centos8-builder.tar.gz & -docker save microsoft/azure-cli:centos8 | gzip > ${BUILD_STAGINGDIRECTORY}/docker/microsoft_azure-cli_centos8.tar.gz & wait diff --git a/src/azure-cli/HISTORY.rst b/src/azure-cli/HISTORY.rst index 3fa873744a7..0dadb8b98af 100644 --- a/src/azure-cli/HISTORY.rst +++ b/src/azure-cli/HISTORY.rst @@ -58,6 +58,7 @@ Release History **Packaging** * Rewrite the az wrapper in python +* Use Python 3 for RPM package **Profile**