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

Pass BUILDSYS_NAME to rpm2img so we use requested image name prefix #1312

Merged
merged 1 commit into from
Feb 9, 2021
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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ ARG VERSION_ID
ARG BUILD_ID
ARG NOCACHE
ARG VARIANT
ARG IMAGE_NAME
ARG IMAGE_FORMAT
ENV VARIANT=${VARIANT} VERSION_ID=${VERSION_ID} BUILD_ID=${BUILD_ID} IMAGE_FORMAT=${IMAGE_FORMAT}
ENV VARIANT=${VARIANT} VERSION_ID=${VERSION_ID} BUILD_ID=${BUILD_ID} IMAGE_NAME=${IMAGE_NAME} IMAGE_FORMAT=${IMAGE_FORMAT}
WORKDIR /root

USER root
Expand Down
3 changes: 3 additions & 0 deletions tools/buildsys/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ impl VariantBuilder {
let version_image = getenv("BUILDSYS_VERSION_IMAGE")?;
let version_build = getenv("BUILDSYS_VERSION_BUILD")?;
let output_dir: PathBuf = getenv("BUILDSYS_OUTPUT_DIR")?.into();
let image_name = getenv("BUILDSYS_NAME")?;
let image_format = match image_format {
Some(ImageFormat::Raw) | None => String::from("raw"),
Some(ImageFormat::Vmdk) => String::from("vmdk"),
Expand All @@ -108,12 +109,14 @@ impl VariantBuilder {
--build-arg VARIANT={variant} \
--build-arg VERSION_ID={version_image} \
--build-arg BUILD_ID={version_build} \
--build-arg IMAGE_NAME={image_name} \
--build-arg IMAGE_FORMAT={image_format}",
packages = packages,
arch = arch,
variant = variant,
version_image = version_image,
version_build = version_build,
image_name = image_name,
image_format = image_format,
);
let tag = format!(
Expand Down
2 changes: 1 addition & 1 deletion tools/rpm2img
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ esac

mkdir -p "${OUTPUT_DIR}"

FILENAME_PREFIX="bottlerocket-${VARIANT}-${ARCH}-${VERSION_ID}-${BUILD_ID}"
FILENAME_PREFIX="${IMAGE_NAME}-${VARIANT}-${ARCH}-${VERSION_ID}-${BUILD_ID}"
Copy link

Choose a reason for hiding this comment

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

👍


DISK_IMAGE_BASENAME="${FILENAME_PREFIX}"
DATA_IMAGE_BASENAME="${FILENAME_PREFIX}-data"
Expand Down