Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/release/rpm/Dockerfile.centos
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM centos:${tag} AS build-env
ARG cli_version=dev

RUN yum update -y
RUN yum install -y wget rpm-build gcc libffi-devel python-devel openssl-devel make bash coreutils diffutils patch dos2unix python2-virtualenv
RUN yum install -y wget rpm-build gcc libffi-devel python3-devel openssl-devel make bash coreutils diffutils patch dos2unix python3-virtualenv

WORKDIR /azure-cli

Expand All @@ -17,7 +17,7 @@ RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \
FROM centos:${tag} AS execution-env

RUN yum update -y
RUN yum install -y python python-virtualenv
RUN yum install -y python3 python3-virtualenv

COPY --from=build-env /azure-cli-dev.rpm ./
RUN rpm -i ./azure-cli-dev.rpm && \
Expand Down
10 changes: 3 additions & 7 deletions scripts/release/rpm/azure-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
%define dist .el%{?rhel}
%endif

%if 0%{?rhel} && 0%{?rhel} < 8
%define python_cmd python
%else
%define python_cmd python3
%endif
%define python_cmd python3

%define name azure-cli
%define release 1%{?dist}
Expand All @@ -25,7 +21,7 @@ Version: %{version}
Release: %{release}
Url: https://docs.microsoft.com/cli/azure/install-azure-cli
BuildArch: x86_64
Requires: %{python_cmd}, %{python_cmd}-virtualenv
Requires: %{python_cmd}

BuildRequires: gcc, libffi-devel, openssl-devel, perl
BuildRequires: %{python_cmd}-devel
Expand All @@ -39,7 +35,7 @@ A great cloud needs great tools; we're excited to introduce Azure CLI,
%prep
%install
# Create a fully instantiated virtual environment, ready to use the CLI.
%{python_cmd} -m virtualenv --python %{python_cmd} %{buildroot}%{cli_lib_dir}
%{python_cmd} -m venv %{buildroot}%{cli_lib_dir}
source %{buildroot}%{cli_lib_dir}/bin/activate

source %{repo_path}/scripts/install_full.sh
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/rpm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

yum check-update
yum install -y gcc rpm-build rpm-level rpmlint make bash corutils diffutils \
path rpmdevtools python libffi-devel python-devel openssl-devel \
path rpmdevtools python libffi-devel python3-devel openssl-devel \
wget

set -ev

export REPO_PATH=`cd $(dirname $0); cd ../../../; pwd`
rpmbuild -v -bb --clean $REPO_PATH/scripts/release/rpm/azure-cli.spec && cp /root/rpmbuild/RPMS/x86_64/* /mnt/output
rpmbuild -v -bb --clean $REPO_PATH/scripts/release/rpm/azure-cli.spec && cp /root/rpmbuild/RPMS/x86_64/* /mnt/output