Skip to content

Commit

Permalink
templates/maintenance.yml: use the existing container for maintenance
Browse files Browse the repository at this point in the history
Adds the `image-builder-maintenance` binary to the existing
container `quay.io/cloudservices/image-builder`, to avoid
duplicating all the necessary build jobs.
  • Loading branch information
schuellerf committed Nov 26, 2024
1 parent 3dda36b commit 1722b09
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,16 @@ check-api-spec:

.PHONY: ubi-container
ubi-container:
if [ -f .git ]; then echo "You seem to be in a git worktree - build will fail here"; exit 1; fi
podman build --pull=always -t osbuild/image-builder -f distribution/Dockerfile-ubi .

.PHONY: ubi-maintenance-container
ubi-maintenance-container:
if [ -f .git ]; then echo "You seem to be in a git worktree - build will fail here"; exit 1; fi
# backwards compatibility with old podman used in github
podman build --pull=always -t osbuild/image-builder-maintenance -f distribution/Dockerfile-ubi-maintenance . || \
podman build -t osbuild/image-builder-maintenance -f distribution/Dockerfile-ubi-maintenance .
podman build --pull=always -t osbuild/image-builder -f distribution/Dockerfile-ubi . || \
podman build -t osbuild/image-builder -f distribution/Dockerfile-ubi .

.PHONY: ubi-maintenance-container-test
ubi-maintenance-container-test: ubi-maintenance-container
ubi-maintenance-container-test: ubi-container
# just check if the container would start
# functional tests are in the target "db-tests"
podman run --rm --tty osbuild/image-builder-maintenance 2>&1 | grep "Dry run, no state will be changed"
podman run --rm --tty --entrypoint /app/image-builder-maintenance osbuild/image-builder 2>&1 | grep "Dry run, no state will be changed"

.PHONY: generate-openscap-blueprints
generate-openscap-blueprints:
Expand Down
5 changes: 0 additions & 5 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ mkdir -p "$DOCKER_CONF"
docker --config="$DOCKER_CONF" login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker --config="$DOCKER_CONF" build -f distribution/Dockerfile-ubi -t "${IMAGE_NAME}:${IMAGE_TAG}" .
docker --config="$DOCKER_CONF" push "${IMAGE_NAME}:${IMAGE_TAG}"

# Maintenance image
IMAGE_NAME="quay.io/app-sre/image-builder-maintenance"
docker --config="$DOCKER_CONF" build -f distribution/Dockerfile-ubi-maintenance -t "${IMAGE_NAME}:${IMAGE_TAG}" .
docker --config="$DOCKER_CONF" push "${IMAGE_NAME}:${IMAGE_TAG}"
1 change: 1 addition & 0 deletions distribution/Dockerfile-ubi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN mkdir /app
RUN mkdir -p "/opt/migrate/"
COPY --from=builder /opt/app-root/src/go/bin/image-builder /app/
COPY --from=builder /opt/app-root/src/go/bin/image-builder-migrate-db-tern /app/
COPY --from=builder /opt/app-root/src/go/bin/image-builder-maintenance /app/
COPY ./distributions /app/distributions
COPY ./internal/db/migrations-tern /app/migrations
COPY ./distribution/openshift-startup.sh /opt/openshift-startup.sh
Expand Down
12 changes: 0 additions & 12 deletions distribution/Dockerfile-ubi-maintenance

This file was deleted.

3 changes: 2 additions & 1 deletion templates/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ objects:
containers:
- image: "${IMAGE_NAME}:${IMAGE_TAG}"
name: image-builder-maintenance
command: ["/app/image-builder-maintenance"]
resources:
requests:
cpu: "${CPU_REQUEST}"
Expand Down Expand Up @@ -90,7 +91,7 @@ objects:
parameters:
- description: maintenance image name
name: IMAGE_NAME
value: quay.io/app-sre/image-builder-maintenance
value: quay.io/cloudservices/image-builder
required: true
- description: composer image tag
name: IMAGE_TAG
Expand Down

0 comments on commit 1722b09

Please sign in to comment.