forked from ManageIQ/manageiq-pods
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ManageIQ#959 from bdunne/add_hotfix_build_script
Add a new hotfix image build script (cherry picked from commit ddb752f) (cherry picked from commit 0c90723)
- Loading branch information
Showing
4 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
TAG=latest | ||
|
||
ARCH=`uname -m` | ||
|
||
while getopts "t:c:d:r:hblnops" opt; do | ||
case $opt in | ||
b) REBUILD_RPM="true" ;; | ||
c) CONTAINER_PREFIX=$OPTARG ;; | ||
d) BASE_DIR=$OPTARG ;; | ||
l) LOCAL_RPM="true" ;; | ||
n) NO_CACHE="true" ;; | ||
o) NO_OPERATOR="true" ;; | ||
p) PUSH="true" ;; | ||
r) REPO=$OPTARG ;; | ||
s) RELEASE_BUILD="true" ;; | ||
t) TAG=$OPTARG ;; | ||
h) echo "Usage: $0 [-hblnops] [-c CONTAINER_PREFIX] [-d BASE_DIR] [-r IMAGE_REPOSITORY] [-t IMAGE_TAG]"; exit 1 | ||
esac | ||
done | ||
|
||
BASE_DIR=${BASE_DIR:-$PWD} | ||
CONTAINER_PREFIX=${CONTAINER_PREFIX:-manageiq} | ||
IMAGE_DIR="$BASE_DIR/images" | ||
OPERATOR_DIR="$BASE_DIR/manageiq-operator" | ||
REPO=${REPO:-docker.io/manageiq} | ||
|
||
CONTAINER_COMMAND="$(which podman &>/dev/null && echo "podman" || echo "docker")" | ||
|
||
set -e | ||
|
||
pushd $IMAGE_DIR | ||
cmd="$CONTAINER_COMMAND build" | ||
|
||
hotfix_images="manageiq-base manageiq-base-worker manageiq-orchestrator manageiq-webserver-worker manageiq-ui-worker" | ||
for image in $hotfix_images; do | ||
cmd="$CONTAINER_COMMAND build" | ||
|
||
if [ "$CONTAINER_COMMAND" == "podman" ]; then | ||
cmd+=" --format docker" | ||
fi | ||
|
||
cmd+=" --tag $REPO/$image:$TAG \ | ||
--build-arg CONTAINER_PREFIX=$CONTAINER_PREFIX \ | ||
--build-arg FROM_REPO=$REPO \ | ||
--build-arg FROM_TAG=$TAG \ | ||
--pull \ | ||
manageiq-hotfix" | ||
|
||
echo "Building hotfix for $image: $cmd" | ||
$cmd | ||
done | ||
popd | ||
|
||
if [ -n "$PUSH" ]; then | ||
push_images="manageiq-base manageiq-base-worker manageiq-orchestrator manageiq-webserver-worker manageiq-ui-worker" | ||
|
||
for image in $push_images; do | ||
cmd="$CONTAINER_COMMAND push $REPO/$image:$TAG" | ||
|
||
if [ "$CONTAINER_COMMAND" == "podman" ]; then | ||
cmd+=" --format docker" | ||
fi | ||
|
||
echo "Pushing: $cmd" | ||
$cmd | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ARG CONTAINER_PREFIX=manageiq | ||
ARG FROM_REPO=manageiq | ||
ARG FROM_TAG=latest | ||
|
||
FROM ${FROM_REPO}/${CONTAINER_PREFIX}-base:${FROM_TAG} | ||
|
||
COPY rpms/* /tmp/rpms/ | ||
|
||
RUN /create_local_yum_repo.sh && \ | ||
dnf -y --repo=local-rpm update && \ | ||
chgrp -R 0 $APP_ROOT && \ | ||
chmod -R g=u $APP_ROOT && \ | ||
source /etc/default/evm && \ | ||
/usr/bin/generate_rpm_manifest.sh && \ | ||
clean_dnf_rpm |
Empty file.