diff options
author | Tomáš Levora <t.levora@partner.samsung.com> | 2019-01-29 14:25:04 +0100 |
---|---|---|
committer | Tomáš Levora <t.levora@partner.samsung.com> | 2019-02-07 14:41:23 +0100 |
commit | ade405a53f37d03866556bd87daf7a7af740fb74 (patch) | |
tree | 00072f3854818cc6f1b5b33100b93d506d98d22d /build/creating_data | |
parent | c2a14cfae6d19c3c6c09394ca710f1871a48983d (diff) |
Create offline data lists to cover Casablanca
Adding casablanca related data lists and changing the lists naming rule
Modifying related download scripts accordingly
Adding parameters for project version to download scripts to be able to
use version specific lists
Removing download-oom.sh as it should be done in helm charts
preparation and patching steps
Moving additional build related stuff to build directory
Adding missing tags
Issue-ID: OOM-1615
Change-Id: Ic5902f646a1f0f40ba615562f8d9b1a43cf8480b
Signed-off-by: Tomáš Levora <t.levora@partner.samsung.com>
Diffstat (limited to 'build/creating_data')
-rwxr-xr-x | build/creating_data/download-bin-tools.sh | 41 | ||||
-rwxr-xr-x | build/creating_data/download-git-repos.sh | 42 | ||||
-rwxr-xr-x | build/creating_data/download-oom.sh | 37 |
3 files changed, 58 insertions, 62 deletions
diff --git a/build/creating_data/download-bin-tools.sh b/build/creating_data/download-bin-tools.sh index a0087517..3213ea56 100755 --- a/build/creating_data/download-bin-tools.sh +++ b/build/creating_data/download-bin-tools.sh @@ -16,15 +16,31 @@ # # COPYRIGHT NOTICE ENDS HERE -outdir="$1" -if [[ -z "$outdir" ]]; then - echo "Missing arg outdir" +usage () { + echo "Usage:" + echo -e "./$(basename $0) <project version> [destination directory]\n" + echo "Examples:" + echo " ./$(basename $0) onap_2.0.0 ./git-repo" +} + +if [ "${1}" == "-h" ] || [ -z "${1}" ] || [ -z "${2}"]; then + usage exit 1 +else + TAG="${1}" + OUTDIR="${2}" fi +if [ "${TAG}" == onap_2.0.0 ]; then + KUBECTL_VERSION=1.8.10 + HELM_VERSION=2.8.2 +elif [ "${TAG}" == onap_3.0.0 ]; then + KUBECTL_VERSION=1.11.2 + HELM_VERSION=2.9.1 +fi -mkdir -p "$outdir" -cd "$outdir" +mkdir -p "$OUTDIR" +cd "$OUTDIR" download() { url="$1" @@ -34,15 +50,12 @@ download() { curl --retry 5 -y 10 -Y 10 --location "$url" -o "$file" } -download "https://storage.googleapis.com/kubernetes-release/release/v1.8.10/bin/linux/amd64/kubectl" - -download "https://storage.googleapis.com/kubernetes-helm/helm-v2.8.2-linux-amd64.tar.gz" -tar -xf ./helm-v2.8.2-linux-amd64.tar.gz linux-amd64/helm -O > helm -rm ./helm-v2.8.2-linux-amd64.tar.gz +download "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" -download "https://github.com/rancher/cli/releases/download/v0.6.7/rancher-linux-amd64-v0.6.7.tar.gz" -tar -xf ./rancher-linux-amd64-v0.6.7.tar.gz ./rancher-v0.6.7/rancher -O > rancher -rm ./rancher-linux-amd64-v0.6.7.tar.gz +download "https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz" +tar -xf ./helm-v${HELM_VERSION}-linux-amd64.tar.gz linux-amd64/helm -O > helm +rm -f ./helm-v${HELM_VERSION}-linux-amd64.tar.gz +chmod a+x ./helm ./kubectl -chmod a+x ./helm ./kubectl ./rancher +exit 0 diff --git a/build/creating_data/download-git-repos.sh b/build/creating_data/download-git-repos.sh index 9d651d93..bb4a79f1 100755 --- a/build/creating_data/download-git-repos.sh +++ b/build/creating_data/download-git-repos.sh @@ -1,3 +1,4 @@ +#! /usr/bin/env bash # COPYRIGHT NOTICE STARTS HERE # # Copyright 2018 © Samsung Electronics Co., Ltd. @@ -16,21 +17,40 @@ # # COPYRIGHT NOTICE ENDS HERE -lists_dir="$1" +# fail fast +set -e -if [[ -z "$lists_dir" ]]; then - echo "Missing argument for lists_dir" +usage () { + echo "Usage:" + echo -e "./$(basename $0) <repository list> [destination directory]\n" + echo "Examples:" + echo " ./$(basename $0) onap_3.0.0 ./git-repo" +} + +LIST="${1}" + +if [[ -z "${LIST}" ]]; then + echo "Missing argument for repository list" exit 1 fi -outdir="$2" -if [[ -z "$outdir" ]]; then - outdir="./git-repo" +OUTDIR="${2}" +if [[ -z "${OUTDIR}" ]]; then + OUTDIR="./git-repo" fi -mkdir -p "$outdir" -cd "$outdir" -# NOTE: will be better to use sh extension? -sh $lists_dir/git_manual_list -sh $lists_dir/git_repos_list +mkdir -p "${OUTDIR}" +cd "${OUTDIR}" + + +while IFS=" " read -r REPO BRANCH remainder +do + if [[ -z "${BRANCH}" ]]; then + git clone https://${REPO} --bare ${REPO} + else + git clone -b ${BRANCH} --single-branch https://${REPO} --bare ${REPO} + fi +done < <(awk '$1 ~ /^[^;#]/' ${LIST}) + +exit 0 diff --git a/build/creating_data/download-oom.sh b/build/creating_data/download-oom.sh deleted file mode 100755 index 010eeec1..00000000 --- a/build/creating_data/download-oom.sh +++ /dev/null @@ -1,37 +0,0 @@ -# COPYRIGHT NOTICE STARTS HERE -# -# Copyright 2018 © Samsung Electronics Co., Ltd. -# -# 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. -# -# COPYRIGHT NOTICE ENDS HERE - -outdir="$1" -if [[ -z "$outdir" ]]; then - echo "Missing output dir" - exit 1 -fi -patch_file="$2" -if [[ -z "$patch_file" ]]; then - echo "Missing patch file" - exit 1 -fi - -cd "$outdir" -git clone https://github.com/onap/oom.git -cd oom -echo "Checkout base commit which will be patched" -git checkout -b patched_beijing bf47d706fc8b94fd1232960e90329a9a532c6a7b - -patch -p1 < "$patch_file" - |