Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,10 @@ jobs:
image: ubi8
tag: 8.4
artifact: rpm-ubi8
Red Hat Universal Base Image 9:
image: ubi9
tag: 9.0.0-1604
artifact: rpm-ubi9
Fedora35:
image: fedora
tag: 35
Expand Down Expand Up @@ -684,6 +688,13 @@ jobs:
python_package: python39
python_cmd: python3.9
pip_cmd: pip3.9
Red Hat Universal Base Image 9:
artifact: rpm-ubi9
distro: el9
image: registry.access.redhat.com/ubi9/ubi:9.0.0-1604
python_package: python3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use python3.9 to be explicit?

python_cmd: python3
pip_cmd: pip3
Fedora35:
artifact: rpm-fedora35
distro: fc35
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/rpm/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ set -exv

: "${BUILD_STAGINGDIRECTORY:?BUILD_STAGINGDIRECTORY environment variable not set.}"

# IMAGE should be one of 'centos7', 'ubi8' or 'fedora'
# IMAGE should be one of 'centos7', 'ubi8', 'ubi9' or 'fedora'
: "${IMAGE:?IMAGE environment variable not set.}"
# TAG should be 'centos7', '8.4' or Fedora version number
# TAG should be RHEL image tag or Fedora version number
: "${TAG:?TAG environment variable not set.}"

CLI_VERSION=`cat src/azure-cli/azure/cli/__main__.py | grep __version__ | sed s/' '//g | sed s/'__version__='// | sed s/\"//g`
Expand Down
26 changes: 26 additions & 0 deletions scripts/release/rpm/ubi9.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Red Hat Universal Base Image 9: https://catalog.redhat.com/software/containers/ubi9/ubi/615bcf606feffc5384e8452e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse ubi8.dockerfile?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll make devel package be an arg.

In RHEL9, the valid names are python3.9-devel and python3-devel, but in RHEL8, python3.9-devel does not exists and python3-devel is for python3.6.


ARG tag=9.0.0-1604

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use wider version like 9.0 to avoid bumping the version frequently.


FROM registry.access.redhat.com/ubi9/ubi:${tag} AS build-env
ARG cli_version=dev

RUN yum update -y
RUN yum install -y wget rpm-build gcc libffi-devel python3-devel openssl-devel make bash diffutils patch dos2unix perl

WORKDIR /azure-cli

COPY . .

# RHEL 9's 'python3' is Python 3.9.
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/9.0_release_notes/index#enhancement_dynamic-programming-languages-web-and-database-servers
RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \
REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=python3 PYTHON_CMD=python3 \
rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \
cp /root/rpmbuild/RPMS/x86_64/azure-cli-${cli_version}-1.*.x86_64.rpm /azure-cli-dev.rpm

FROM registry.access.redhat.com/ubi9/ubi:${tag} AS execution-env

COPY --from=build-env /azure-cli-dev.rpm ./
RUN rpm -i ./azure-cli-dev.rpm && \
az --version