Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Use Toolchain RPMS when building Golden Container #10474

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Changes from 4 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
13 changes: 11 additions & 2 deletions .pipelines/containerSourceData/scripts/BuildGoldenContainer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ set -e
# -j OUTPUT -k ./rpms.tar.gz -l ~/azurelinux/.pipelines/containerSourceData \
# -m "false" -n "false" -p development -q "false" -u "true"

while getopts ":a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:" OPTIONS; do
while getopts ":a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:" OPTIONS; do
case ${OPTIONS} in
a ) BASE_IMAGE_NAME_FULL=$OPTARG;;
b ) ACR=$OPTARG;;
Expand All @@ -82,6 +82,7 @@ while getopts ":a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:" OPTIONS; do
t ) SBOM_SCRIPT=$OPTARG;;
u ) DISTROLESS=$OPTARG;;
v ) VERSION_EXTRACT_CMD=$OPTARG;;
w ) TOOLCHAIN_RPMS_TARBALL=$OPTARG;;

\? )
echo "Error - Invalid Option: -$OPTARG" 1>&2
Expand Down Expand Up @@ -125,6 +126,7 @@ function print_inputs {
echo "SBOM_TOOL_PATH -> $SBOM_TOOL_PATH"
echo "SBOM_SCRIPT -> $SBOM_SCRIPT"
echo "DISTROLESS -> $DISTROLESS"
echo "TOOLCHAIN_RPMS_TARBALL -> $TOOLCHAIN_RPMS_TARBALL"
}

function validate_inputs {
Expand Down Expand Up @@ -168,6 +170,11 @@ function validate_inputs {
exit 1
fi

if [[ ! -f $TOOLCHAIN_RPMS_TARBALL ]]; then
echo "Error - No TOOLCHAIN_RPMS tarball found."
rikenm1 marked this conversation as resolved.
Show resolved Hide resolved
exit 1
fi

if [ ! -d "$CONTAINER_SRC_DIR" ]; then
echo "Error - Container source directory does not exist."
exit 1
Expand Down Expand Up @@ -236,7 +243,9 @@ function prepare_docker_directory {
mkdir -pv "$HOST_MOUNTED_DIR"

# Copy files into docker context directory
tar -xf "$RPMS_TARBALL" -C "$HOST_MOUNTED_DIR"/
tar -xvf "$RPMS_TARBALL" -C "$HOST_MOUNTED_DIR"/
# we look for the toolchain rpms in the same directory as the rpms tarball
tar -xvf "$TOOLCHAIN_RPMS_TARBALL" -C "$HOST_MOUNTED_DIR/RPMS"/
cp -v "$CONTAINER_SRC_DIR/azurelinuxlocal.repo" "$HOST_MOUNTED_DIR"/
}

Expand Down
Loading