Skip to content

Commit

Permalink
[Packaging] Use Mariner 2.0 GA image to build RPM (Azure#22427)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiasli authored May 13, 2022
1 parent 1015879 commit 16e370e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,10 @@ jobs:
strategy:
matrix:
1.0:
acr: cblmariner
image: cblmariner.azurecr.io/base/core
tag: 1.0
2.0:
acr: cblmariner2preview
image: mcr.microsoft.com/cbl-mariner/base/core
tag: 2.0
steps:
- task: Bash@3
Expand All @@ -701,7 +701,7 @@ jobs:
targetType: 'filePath'
filePath: scripts/release/rpm/pipeline_mariner.sh
env:
ACR: $(acr)
IMAGE: $(image)
TAG: $(tag)

- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
Expand Down
8 changes: 4 additions & 4 deletions scripts/release/rpm/mariner.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG tag=2.0
ARG acr=cblmariner2preview
ARG image=mcr.microsoft.com/cbl-mariner/base/core

FROM ${acr}.azurecr.io/base/core:${tag} AS build-env
FROM ${image}:${tag} AS build-env
ARG cli_version=dev

RUN tdnf update -y
Expand All @@ -15,10 +15,10 @@ 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 /usr/src/mariner/RPMS/x86_64/azure-cli-${cli_version}-1.x86_64.rpm /azure-cli-dev.rpm

FROM ${acr}.azurecr.io/base/core:${tag} AS execution-env
FROM ${image}:${tag} AS execution-env

RUN tdnf update -y
RUN tdnf install -y python3 python3-virtualenv
RUN tdnf install -y python3 python3-virtualenv rpm

COPY --from=build-env /azure-cli-dev.rpm ./
RUN rpm -i ./azure-cli-dev.rpm && \
Expand Down
6 changes: 3 additions & 3 deletions scripts/release/rpm/pipeline_mariner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
set -exv

: "${BUILD_STAGINGDIRECTORY:?BUILD_STAGINGDIRECTORY environment variable not set.}"
: "${ACR:?ACR environment variable not set.}"
: "${IMAGE:?IMAGE environment variable not set.}"
: "${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`

# Create a container image that includes the source code and a built RPM using this file.
docker build \
--target build-env \
--build-arg acr=${ACR} \
--build-arg image=${IMAGE} \
--build-arg tag=${TAG} \
--build-arg cli_version=${CLI_VERSION} \
-f ./scripts/release/rpm/mariner.dockerfile \
Expand All @@ -22,7 +22,7 @@ docker build \

# Continue the previous build, and create a container that has the current azure-cli build but not the source code.
docker build \
--build-arg acr=${ACR} \
--build-arg image=${IMAGE} \
--build-arg tag=${TAG} \
--build-arg cli_version=${CLI_VERSION} \
-f ./scripts/release/rpm/mariner.dockerfile \
Expand Down

0 comments on commit 16e370e

Please sign in to comment.