_initialize_work_dirs
+docker build -f $scriptdir/docker-context/Dockerfile-dib -t dib $scriptdir/docker-context
+docker build -f $scriptdir/docker-context/Dockerfile-buildtools -t buildtools $scriptdir/docker-context
+
# Create manifest RPM
$LIBDIR/create_manifest_rpm.sh
iso_build_dir=$tmp/build
input_image=$(readlink -f ${1:-$WORKTMP/goldenimage/$GOLDEN_IMAGE_NAME})
-output_image_path=${2:-$RESULT_IMAGES_DIR/rec.iso}
+output_image_path=${2:-$RESULT_IMAGES_DIR/install.iso}
output_bootcd_path=${3:-$RESULT_IMAGES_DIR/bootcd.iso}
mkdir -p $tmp
rm -rf $iso_build_dir
mkdir -p $iso_build_dir
-reposnap_base=$(_read_build_config DEFAULT centos_reposnap_base)
+reposnap_base=$(_read_build_config DEFAULT centos_reposnap)
release_version=$PRODUCT_RELEASE_LABEL
reposnap_base_dir="${reposnap_base}/os/x86_64/"
iso_image_label=$(_read_build_config DEFAULT iso_image_label)
echo $1 | sed -re 's#([^:])//+#\1/#g'
}
-get_nexus() {
- $scriptdir/nexus3_dl.sh \
- $nexus_url \
- $(basename $nexus_reposnaps) \
- ${reposnap_base#$nexus_reposnaps/}/os/x86_64 $@
-}
-
wget_dir() {
local url=$1
echo $url | grep -q /$ || _abort "wget path '$url' must end with slash for recursive wget"
pushd $iso_build_dir
# Get files needed for generating CD image.
-if echo $reposnap_base_dir | grep -E "https?://nexus3"; then
- nexus_url=$(_read_build_config DEFAULT nexus_url)
- nexus_reposnaps=$(_read_build_config DEFAULT nexus_reposnaps)
- get_nexus "EFI/BOOT" "EFI/BOOT/fonts"
- get_nexus "images:*efiboot.img" "images/pxeboot"
- get_nexus "isolinux"
-else
- wget_dir ${cd_efi_dir}/
- wget_dir ${cd_images_dir}/
- rm -rf images/boot.iso
- sync
- wget_dir ${cd_isolinux_dir}/
-fi
+wget_dir ${cd_efi_dir}/
+wget_dir ${cd_images_dir}/
+rm -rf images/boot.iso
+sync
+wget_dir ${cd_isolinux_dir}/
chmod +w -R isolinux/ EFI/ images/
if [ -e $scriptdir/isolinux/isolinux.cfg ]; then
output_image_path=${1:-$WORKTMP/goldenimage/$GOLDEN_IMAGE_NAME}
-docker_dib_image=dib:2.0
+docker_dib_image=dib
_load_docker_image $docker_dib_image
docker run \
scriptdir="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
source $scriptdir/lib.sh
-docker_image=buildtools:2.0
+docker_image=buildtools
_load_docker_image $docker_image
function _resolve_abs_path() {
# See the License for the specific language governing permissions and
# limitations under the License.
+
+# Use newer than the CentOS stock diskimage-builder via "cloud" repo
FROM centos:7.5.1804
RUN \
- yum-config-manager --add-repo http://mirror.centos.org/centos/7/cloud/x86_64/openstack-pike/ && \
- yum-config-manager --add-repo https://trunk.rdoproject.org/centos7-pike/57/c7/57c7be250c919c04b51361d4d42e95818cfec5a5_15fc9723 && \
+ yum-config-manager --add-repo http://mirror.centos.org/centos/7/cloud/x86_64/openstack-queens/ && \
yum install --nogpgcheck -y diskimage-builder \
git \
python \
function _load_docker_image()
{
local docker_image=$1
- local docker_image_url="$(_read_build_config DEFAULT docker_images)/${docker_image}.tar"
if docker inspect ${docker_image} &> /dev/null; then
echo "Using already built ${docker_image} image"
else
echo "Loading ${docker_image} image"
+ local docker_image_url="$(_read_build_config DEFAULT docker_images)/${docker_image}.tar"
curl -L $docker_image_url | docker load
fi
}
+++ /dev/null
-#!/bin/bash
-# Copyright 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -eu
-
-NEXUS_URL=$1
-NEXUS_REPOSITORY=$2
-NEXUS_REPOSITORY_BASE_PATH=$3
-shift;shift;shift
-NEXUS_REPOSITORY_SEARCH_PATTERNS=$@
-
-_abort() {
- echo "ERROR: $@"
- exit 1
-}
-
-_search_group() {
- local params=""
- [ -n "$1" ] && params+="&group=$1"
- [ -n "${2:-}" ] && params+="&name=$2"
- curl "${NEXUS_URL}/service/rest/v1/search?repository=${NEXUS_REPOSITORY}${params}"
-}
-
-for pat in $NEXUS_REPOSITORY_SEARCH_PATTERNS; do
- search_group="/$NEXUS_REPOSITORY_BASE_PATH/$(echo $pat | cut -d':' -f1)"
- search_name=""
- if echo $pat | grep ':'; then
- search_name="$(echo $pat | cut -d':' -f2)"
- fi
- resp=$(_search_group $search_group $search_name)
- if [ "$(echo $resp | jq -r '.continuationToken')" != "null" ]; then
- _abort "Pagination not implemented"
- fi
- for url in $(echo $resp | jq -r '.items[].assets[].downloadUrl'); do
- to=${url#$NEXUS_URL/repository/$NEXUS_REPOSITORY/$NEXUS_REPOSITORY_BASE_PATH/}
- mkdir -p $(dirname $to)
- echo "Fetch $url"
- curl $url > $to
- done
-done