Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
allow slashes in ORGANIZATION field by using @ for sed separators ins…
Browse files Browse the repository at this point in the history
…tead of /

Change-Id: I69d8d6c6c3c21531e29deaf68e95a8bd7dad14b7
Signed-off-by: nickboldt <nboldt@redhat.com>
  • Loading branch information
nickboldt committed Oct 6, 2019
1 parent 546916a commit cd0e311
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dockerfiles/build.include
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ init() {
esac
done

IMAGE_NAME="$ORGANIZATION/$PREFIX-$NAME:$TAG"
}

build() {
Expand Down Expand Up @@ -138,7 +137,7 @@ build() {
build_image() {
printf "${BOLD}Building Docker Image ${IMAGE_NAME} from $DIR directory with tag $TAG${NC}\n"
# Replace macros in Dockerfiles
cat ${DIR}/${DOCKERFILE} | sed s/\$\{BUILD_ORGANIZATION\}/${ORGANIZATION}/ | sed s/\$\{BUILD_PREFIX\}/${PREFIX}/ | sed s/\$\{BUILD_TAG\}/${TAG}/ | sed s/\$\{BUILD_PARENT_IMAGE\}/${PARENT_IMAGE}/ | sed s/\$\{GIT_BRANCH_NAME\}/${BRANCH}/ | sed s/\$\{GIT_REF\}/"${GIT_REF}"/ > ${DIR}/.Dockerfile
cat ${DIR}/${DOCKERFILE} | sed s@\$\{BUILD_ORGANIZATION\}@${ORGANIZATION}@ | sed s/\$\{BUILD_PREFIX\}/${PREFIX}/ | sed s/\$\{BUILD_TAG\}/${TAG}/ | sed s/\$\{BUILD_PARENT_IMAGE\}/${PARENT_IMAGE}/ | sed s/\$\{GIT_BRANCH_NAME\}/${BRANCH}/ | sed s/\$\{GIT_REF\}/"${GIT_REF}"/ > ${DIR}/.Dockerfile
cd "${DIR}" && docker build -f ${DIR}/.Dockerfile -t ${IMAGE_NAME} ${BUILD_ARGS} .
rm ${DIR}/.Dockerfile
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit cd0e311

Please sign in to comment.