From afe2dff5c3ca9300df548d1cd955bd2c5704bab2 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 31 Jul 2018 18:59:38 -0500 Subject: [PATCH 1/5] obs: create-repo-branch.sh: New script to create OBS repos. If want to create pkgs based in new branch, this script will create all the empty repositories in OBS for each kata package. Then we can point use the rest of scripts to push changes to this new repo. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/build_from_docker.sh | 40 +---- obs-packaging/create-repo-branch.sh | 155 ++++++++++++++++++ obs-packaging/distros | 16 ++ .../kata-containers-image/build_image.sh | 4 + obs-packaging/maintainers | 3 + obs-packaging/scripts/obs-docker.sh | 39 +++++ 6 files changed, 222 insertions(+), 35 deletions(-) create mode 100755 obs-packaging/create-repo-branch.sh create mode 100644 obs-packaging/distros create mode 100644 obs-packaging/maintainers create mode 100755 obs-packaging/scripts/obs-docker.sh diff --git a/obs-packaging/build_from_docker.sh b/obs-packaging/build_from_docker.sh index 132e360..ccee270 100755 --- a/obs-packaging/build_from_docker.sh +++ b/obs-packaging/build_from_docker.sh @@ -12,49 +12,27 @@ set -o pipefail script_dir=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) script_name="$(basename "${BASH_SOURCE[0]}")" -cache_dir=${PWD}/obs-cache #where packaing repo lives packaging_repo_dir=$(cd "${script_dir}/.." && pwd) -#where results will be stored -host_datadir="${PWD}/pkgs" -obs_image="obs-kata" export USE_DOCKER=1 http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} no_proxy=${no_proxy:-} PUSH=${PUSH:-} +# shellcheck source=scripts/obs-docker.sh +source "${script_dir}/scripts/obs-docker.sh" + GO_ARCH=$(go env GOARCH) export GO_ARCH -docker_run() { - local cmd="$@" - sudo docker run \ - --rm \ - -v "${HOME}/.ssh":/root/.ssh \ - -v "${HOME}/.gitconfig":/root/.gitconfig \ - -v /etc/profile:/etc/profile \ - --env GO_ARCH="${GO_ARCH}" \ - --env http_proxy="${http_proxy}" \ - --env https_proxy="${https_proxy}" \ - --env no_proxy="${no_proxy}" \ - --env PUSH="${PUSH}" \ - --env DEBUG="${DEBUG:-}" \ - --env OBS_SUBPROJECT="${OBS_SUBPROJECT:-}" \ - -v "${HOME}/.bashrc":/root/.bashrc \ - -v "$cache_dir":/var/tmp/osbuild-packagecache/ \ - -v "$packaging_repo_dir":${packaging_repo_dir} \ - -v "$host_datadir":/var/packaging \ - -v "$HOME/.oscrc":/root/.oscrc \ - -ti "$obs_image" bash -c "${cmd}" -} usage() { msg="${1:-}" exit_code=$"${2:-0}" cat < +${script_name} EOT exit "${exit_code}" } @@ -69,16 +47,8 @@ main() { image_tarball=$(find . -name 'kata-containers-'"${branch}"'-*.tar.gz') [ -f "${image_tarball}" ] || die "image not found" popd >>/dev/null - sudo docker build \ - --build-arg http_proxy="${http_proxy}" \ - --build-arg https_proxy="${https_proxy}" \ - --build-arg GO_ARCH="${GO_ARCH}" \ - -t $obs_image "${script_dir}" - - #Create/update OBS repository for branch - #docker_run "${packaging_repo_dir}/obs-packaging/create-pkg-branch.sh ${branch}" #Build all kata packages docker_run "${packaging_repo_dir}/obs-packaging/build_all.sh ${branch}" } -main $@ +main "$@" diff --git a/obs-packaging/create-repo-branch.sh b/obs-packaging/create-repo-branch.sh new file mode 100755 index 0000000..8057e9b --- /dev/null +++ b/obs-packaging/create-repo-branch.sh @@ -0,0 +1,155 @@ +#!/bin/bash +# +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# +[ -z "${DEBUG}" ] || set -o xtrace + +set -o errexit +set -o nounset +set -o pipefail + +script_dir=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) +script_name="$(basename "${BASH_SOURCE[0]}")" + +# shellcheck source=./../scripts/lib.sh +source "${script_dir}/../scripts/lib.sh" + +# shellcheck source=scripts/obs-docker.sh +source "${script_dir}/scripts/obs-docker.sh" + +readonly home_project="home:katacontainers" +readonly template_pkg="kata-pkg-template" +arch_target=${ARCH:-$(uname -m)} + +projects=( + qemu-lite + qemu-vanilla + linux-container + kata-containers-image + proxy + shim + ksm-throttler + runtime +) + +pkg_exist() { + local project="$1" + local pkg="$2" + + docker_run osc list "${project}" | grep "${pkg}" || return 1 + return 0 + +} + +# Array of repositories. +# +# Each element is comprised of multiple parts in the form: +# +# name::project::repository +# +typeset -a repos +read_repos(){ + while read -r p; do + [[ "$p" != "#"* ]] || continue + repos+=("${p}") + echo "Adding distro: ${p}" + done < "${script_dir}/distros" +} + +# Array of maintainers +# +# Each element is comprised of multiple parts in the form: +# +# userid::role +# +typeset -a maintainers + +read_maintainers(){ + while read -r p; do + [[ "$p" != "#"* ]] || continue + maintainers+=("${p}::maintainer") + echo "Adding mantainer: ${p}" + done < "${script_dir}/maintainers" +} + +create_repos_xml_nodes() { + for entry in "${repos[@]}"; do + [ -z "$entry" ] && die "found empty entry" + local name=$(echo "$entry" | awk -F"::" '{print $1;}') + local project=$(echo "$entry" | awk -F"::" '{print $2;}') + local repository=$(echo "$entry" | awk -F"::" '{print $3;}') + [ -z "$name" ] && die "no name for entry '$entry'" + [ -z "$project" ] && die "no project for entry '$entry'" + [ -z "$repository" ] && die "no repository for entry '$entry'" + echo " " + echo " " + arch_target_obs=${arch_target} + if [ "$arch_target" == "ppc64" ]; then + arch_target_obs="ppc64le" + fi + echo " ${arch_target_obs}" + echo " " + done +} + +create_mantainers_xml_nodes() { + for entry in "${mantainers[@]}"; do + [ -z "$entry" ] && die "found empty entry" + local userid=$(echo "$entry" | awk -F"::" '{print $1;}') + local role=$(echo "$entry" | awk -F"::" '{print $2;}') + [ -z "$userid" ] && die "no userid for entry '$entry'" + [ -z "$role" ] && die "no role for entry '$entry'" + echo " " + done +} + +create_meta_xml() { + project="${1:-}" + branch="${2:-}" + [ -n "${project}" ] || die "project is empty" + [ -n "${branch}" ] || die "branch is empty" + + read_maintainers + read_repos + cat >meta_project.xml < + Branch project for Kata Containers branch ${branch} + This project is the Kata Containers branch ${branch} +$(create_mantainers_xml_nodes) +$(create_repos_xml_nodes) + +EOT +} + +usage() { + msg="${1:-}" + exit_code=$"${2:-0}" + cat < +EOT + exit "${exit_code}" +} + +main() { + local branch="${1:-}" + [ -n "${branch}" ] || usage "missing branch" "1" + project_branch="${home_project}:releases:${arch_target}:${branch}" + create_meta_xml "${project_branch}" "${branch}" + info "Creating/Updating project with name ${project_branch}" + # Update /Create project metadata. + docker_run osc meta prj "${project_branch}" -F meta_project.xml + for pkg in "${projects[@]}"; do + if ! pkg_exist "${project_branch}" "${pkg}"; then + echo "Package ${pkg} does not exit in ${project_branch}, creating ..." + docker_run osc branch "${home_project}" "${template_pkg}" "${project_branch}" "${pkg}" + fi + pkg_dir="${project_branch}/${pkg}" + [ -d "${pkg_dir}/.osc" ] || docker_run osc co "${pkg_dir}" + done +} + +main $@ diff --git a/obs-packaging/distros b/obs-packaging/distros new file mode 100644 index 0000000..3f7f33f --- /dev/null +++ b/obs-packaging/distros @@ -0,0 +1,16 @@ +# Repositories. +# +# Each element is comprised of multiple parts in the form: +# +# name::project::repository +# +CentOS_7::CentOS:CentOS-7::standard +Fedora_26::Fedora:26::standard +Fedora_27::Fedora:27::standard +Fedora_28::Fedora:28::standard +RHEL_7::RedHat:RHEL-7::standard +SLE_12_SP3::SUSE:SLE-12-SP3:GA::standard +openSUSE_Leap_42.3::openSUSE:Leap:42.3::standard +xUbuntu_16.04::Ubuntu:16.04::universe +xUbuntu_17.10::Ubuntu:17.10::universe +xUbuntu_18.04::Ubuntu:18.04::universe diff --git a/obs-packaging/kata-containers-image/build_image.sh b/obs-packaging/kata-containers-image/build_image.sh index 746c94a..41f4554 100755 --- a/obs-packaging/kata-containers-image/build_image.sh +++ b/obs-packaging/kata-containers-image/build_image.sh @@ -101,10 +101,14 @@ main() { #image information img_distro=$(get_from_kata_deps "assets.image.architecture.${arch_target}.name" "${kata_version}") + #In old branches this is not defined, use a default + img_distro=${img_distro:-clearlinux} img_os_version=$(get_from_kata_deps "assets.image.architecture.${arch_target}.version" "${kata_version}") #initrd information initrd_distro=$(get_from_kata_deps "assets.image.architecture.${arch_target}.name" "${kata_version}") + #In old branches this is not defined, use a default + initrd_distro=${initrd_distro:-alpine} initrd_os_version=$(get_from_kata_deps "assets.image.architecture.${arch_target}.version" "${kata_version}") shift "$((OPTIND - 1))" diff --git a/obs-packaging/maintainers b/obs-packaging/maintainers new file mode 100644 index 0000000..8def7b5 --- /dev/null +++ b/obs-packaging/maintainers @@ -0,0 +1,3 @@ +egernst +jcvenega +nitkon diff --git a/obs-packaging/scripts/obs-docker.sh b/obs-packaging/scripts/obs-docker.sh new file mode 100755 index 0000000..52ac0c8 --- /dev/null +++ b/obs-packaging/scripts/obs-docker.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +_obs_docker_packaging_repo_dir=$(cd $(basename "${BASH_SOURCE[0]}"/../..) && pwd) +GO_ARCH=$(go env GOARCH) + +docker_run() { + local cmd="$*" + local obs_image="obs-kata" + #where results will be stored + local host_datadir="${PWD}/pkgs" + local cache_dir=${PWD}/obs-cache + sudo docker build \ + --quiet \ + --build-arg http_proxy="${http_proxy:-}" \ + --build-arg GO_ARCH="${GO_ARCH}" \ + --build-arg https_proxy="${https_proxy:-}" \ + -t $obs_image "${_obs_docker_packaging_repo_dir}/obs-packaging" + + sudo docker run \ + --rm \ + --env http_proxy="${http_proxy:-}" \ + --env https_proxy="${https_proxy:-}" \ + --env no_proxy="${no_proxy:-}" \ + --env GO_ARCH="${GO_ARCH}" \ + --env PUSH="${PUSH:-}" \ + --env DEBUG="${DEBUG:-}" \ + --env OBS_SUBPROJECT="${OBS_SUBPROJECT:-}" \ + -v "${cache_dir}":/var/tmp/osbuild-packagecache/ \ + -v "${_obs_docker_packaging_repo_dir}":"${_obs_docker_packaging_repo_dir}" \ + -v "${host_datadir}":/var/packaging \ + -v "${HOME}/.oscrc":/root/.oscrc \ + -v "${PWD}":"${PWD}" \ + -w "${PWD}" \ + -ti "${obs_image}" bash -c "${cmd}" +} From b66368fbe0d370fa159152b26aff514c3203325f Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Mon, 20 Aug 2018 19:15:52 -0500 Subject: [PATCH 2/5] obs: factor out projects array. projects array is used in two scripts move it to obs-pkgs.sh Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/build_all.sh | 17 ++++------------- obs-packaging/create-repo-branch.sh | 14 +++----------- obs-packaging/scripts/obs-pkgs.sh | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 24 deletions(-) create mode 100755 obs-packaging/scripts/obs-pkgs.sh diff --git a/obs-packaging/build_all.sh b/obs-packaging/build_all.sh index f2fad27..5d7f313 100755 --- a/obs-packaging/build_all.sh +++ b/obs-packaging/build_all.sh @@ -12,18 +12,9 @@ set -o pipefail readonly script_name="$(basename "${BASH_SOURCE[0]}")" readonly script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -#Note:Lets update qemu and the kernel first, they take longer to build. -#Note: runtime is build at the end to get the version from all its dependencies. -projects=( - qemu-lite - qemu-vanilla - kernel - kata-containers-image - proxy - shim - ksm-throttler - runtime -) + +# shellcheck source=scripts/obs-docker.sh +source "${script_dir}/scripts/obs-pkgs.sh" OSCRC="${HOME}/.oscrc" PUSH=${PUSH:-""} @@ -64,7 +55,7 @@ eom fi pushd "${script_dir}" - for p in "${projects[@]}"; do + for p in "${OBS_PKGS_PROJECTS[@]}"; do if [[ "$GO_ARCH" != "amd64" && "$p" == "qemu-lite" ]]; then echo "Skipping packaging qemu-lite as its only for amd64 arch" continue diff --git a/obs-packaging/create-repo-branch.sh b/obs-packaging/create-repo-branch.sh index 8057e9b..6c0123d 100755 --- a/obs-packaging/create-repo-branch.sh +++ b/obs-packaging/create-repo-branch.sh @@ -23,16 +23,8 @@ readonly home_project="home:katacontainers" readonly template_pkg="kata-pkg-template" arch_target=${ARCH:-$(uname -m)} -projects=( - qemu-lite - qemu-vanilla - linux-container - kata-containers-image - proxy - shim - ksm-throttler - runtime -) +# shellcheck source=scripts/obs-docker.sh +source "${script_dir}/scripts/obs-pkgs.sh" pkg_exist() { local project="$1" @@ -142,7 +134,7 @@ main() { info "Creating/Updating project with name ${project_branch}" # Update /Create project metadata. docker_run osc meta prj "${project_branch}" -F meta_project.xml - for pkg in "${projects[@]}"; do + for pkg in "${OBS_PKGS_PROJECTS[@]}"; do if ! pkg_exist "${project_branch}" "${pkg}"; then echo "Package ${pkg} does not exit in ${project_branch}, creating ..." docker_run osc branch "${home_project}" "${template_pkg}" "${project_branch}" "${pkg}" diff --git a/obs-packaging/scripts/obs-pkgs.sh b/obs-packaging/scripts/obs-pkgs.sh new file mode 100755 index 0000000..e5c634b --- /dev/null +++ b/obs-packaging/scripts/obs-pkgs.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +#Note:Lets update qemu and the kernel first, they take longer to build. +#Note: runtime is build at the end to get the version from all its dependencies. +OBS_PKGS_PROJECTS=( + qemu-lite + qemu-vanilla + kernel + kata-containers-image + proxy + shim + ksm-throttler + runtime +) From dbe64e646138a1b842b06fb18b54a66542258c5f Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 21 Aug 2018 13:55:11 -0500 Subject: [PATCH 3/5] obs: dont checkout repo in tmpdir. When we genete packages file we want to see the resulting files. This changes to now create repos in a tmpdir. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/Makefile | 8 ++++++++ obs-packaging/build_from_docker.sh | 1 + obs-packaging/scripts/pkglib.sh | 26 ++++++++++++-------------- 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 obs-packaging/Makefile diff --git a/obs-packaging/Makefile b/obs-packaging/Makefile new file mode 100644 index 0000000..ff1192e --- /dev/null +++ b/obs-packaging/Makefile @@ -0,0 +1,8 @@ +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + + +clean: + find . -type d -name "*home:katacontainers*" -exec sudo rm -rf {} \; diff --git a/obs-packaging/build_from_docker.sh b/obs-packaging/build_from_docker.sh index ccee270..ad42f17 100755 --- a/obs-packaging/build_from_docker.sh +++ b/obs-packaging/build_from_docker.sh @@ -48,6 +48,7 @@ main() { [ -f "${image_tarball}" ] || die "image not found" popd >>/dev/null #Build all kata packages + make -f "${script_dir}/Makefile" clean docker_run "${packaging_repo_dir}/obs-packaging/build_all.sh ${branch}" } diff --git a/obs-packaging/scripts/pkglib.sh b/obs-packaging/scripts/pkglib.sh index fab67c2..e5638b9 100644 --- a/obs-packaging/scripts/pkglib.sh +++ b/obs-packaging/scripts/pkglib.sh @@ -128,7 +128,7 @@ function local_build() { [ ! -e $PACKAGING_DIR ] && mkdir $PACKAGING_DIR [ ! -e $LOG_DIR ] && mkdir $LOG_DIR - pushd $OBS_WORKDIR + pushd "${obs_repo_dir}" BUILD_ARGS=('--local-package' '--no-verify' '--noservice' '--trust-all-projects' '--keep-pkgs=/var/packaging/results') [ "$OFFLINE" == "true" ] && BUILD_ARGS+=('--offline') @@ -147,22 +147,24 @@ function local_build() { ${distro} $BUILD_ARCH *.dsc | tee ${LOG_DIR}/${distro}_${PKG_NAME}_build.log fi done + popd + } function checkout_repo() { - local REPO="${1}" - if [ -z "${OBS_WORKDIR:-}" ]; then - OBS_WORKDIR=$(mktemp -d -u -t obs-repo.XXXXXXXXXXX) || exit 1 - osc co "${REPO}" -o "${OBS_WORKDIR}" - fi - find "${OBS_WORKDIR}" -maxdepth 1 -mindepth 1 ! -name '.osc' -prune -exec echo remove {} \; -exec rm -rf {} \; + local repo="${1}" + export obs_repo_dir="${repo}" - mv "${GENERATED_FILES[@]}" "${OBS_WORKDIR}" - cp "${STATIC_FILES[@]}" "$OBS_WORKDIR" + mkdir -p "${obs_repo_dir}" + osc co "${repo}" -o "${obs_repo_dir}" + find "${obs_repo_dir}" -maxdepth 1 -mindepth 1 ! -name '.osc' -prune -exec echo remove {} \; -exec rm -rf {} \; + + mv "${GENERATED_FILES[@]}" "${obs_repo_dir}" + cp "${STATIC_FILES[@]}" "$obs_repo_dir" } function obs_push() { - pushd $OBS_WORKDIR + pushd "${obs_repo_dir}" osc addremove osc commit -m "Update ${PKG_NAME} $VERSION: ${hash_tag:0:7}" popd @@ -189,10 +191,6 @@ function cli() { PROJECT_REPO="$2" shift 2 ;; - -w | --workdir) - OBS_WORKDIR="$2" - shift 2 - ;; -v | --verbose) VERBOSE="true" shift From 1a751c52148043c4a8717f5fd40c2939bcc14249 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Wed, 22 Aug 2018 18:19:46 -0500 Subject: [PATCH 4/5] obs: docker-build: move osc file creation. We need to create the osc file before enter the container. If build_all.sh is executed without a container and osc is intalled osc will ask for setup but in the container fails do to a missing tty. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/build_all.sh | 13 ------------- obs-packaging/build_from_docker.sh | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/obs-packaging/build_all.sh b/obs-packaging/build_all.sh index 5d7f313..af46fe6 100755 --- a/obs-packaging/build_all.sh +++ b/obs-packaging/build_all.sh @@ -16,7 +16,6 @@ readonly script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # shellcheck source=scripts/obs-docker.sh source "${script_dir}/scripts/obs-pkgs.sh" -OSCRC="${HOME}/.oscrc" PUSH=${PUSH:-""} LOCAL=${LOCAL:-""} PUSH_TO_OBS="" @@ -27,8 +26,6 @@ export BUILD_DISTROS=${BUILD_DISTROS:-xUbuntu_16.04} export AUTHOR="${AUTHOR:-user}" export AUTHOR_EMAIL="${AUTHOR_EMAIL:-user@example.com}" -OBS_API="https://api.opensuse.org" - usage() { msg="${1:-}" exit_code=$"${2:-0}" @@ -43,16 +40,6 @@ EOT main() { local branch="${1:-}" [ -n "${branch}" ] || usage "missing branch" "1" - if [ -n "${OBS_USER:-}" ] && [ -n "${OBS_PASS:-}" ] && [ ! -e "${OSCRC:-}" ]; then - echo "Creating ${OSCRC} with user $OBS_USER" - cat <"${OSCRC}" -[general] -apiurl = ${OBS_API} -[${OBS_API}] -user = ${OBS_USER} -pass = ${OBS_PASS} -eom - fi pushd "${script_dir}" for p in "${OBS_PKGS_PROJECTS[@]}"; do diff --git a/obs-packaging/build_from_docker.sh b/obs-packaging/build_from_docker.sh index ad42f17..ed96822 100755 --- a/obs-packaging/build_from_docker.sh +++ b/obs-packaging/build_from_docker.sh @@ -26,6 +26,9 @@ source "${script_dir}/scripts/obs-docker.sh" GO_ARCH=$(go env GOARCH) export GO_ARCH +OSCRC="${HOME}/.oscrc" +OBS_API="https://api.opensuse.org" + usage() { msg="${1:-}" exit_code=$"${2:-0}" @@ -49,6 +52,21 @@ main() { popd >>/dev/null #Build all kata packages make -f "${script_dir}/Makefile" clean + if [ -n "${OBS_USER:-}" ] && [ -n "${OBS_PASS:-}" ] && [ ! -e "${OSCRC}" ]; then + echo "Creating ${OSCRC} with user $OBS_USER" + cat <"${OSCRC}" +[general] +apiurl = ${OBS_API} +[${OBS_API}] +user = ${OBS_USER} +pass = ${OBS_PASS} +eom + fi + + if [ ! -e "${OSCRC}" ]; then + echo "${OSCRC}, please do 'export OBS_USER=your_user ; export OBS_PASS=your_pass' to configure osc for first time." + exit 1 + fi docker_run "${packaging_repo_dir}/obs-packaging/build_all.sh ${branch}" } From 65c581ed616b32ee5668308d507503cc3637d746 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Mon, 27 Aug 2018 12:20:19 -0500 Subject: [PATCH 5/5] release: get current version before modify file. When we get changes from one version to a newer this is empty because we dont get the current version. Signed-off-by: Jose Carlos Venegas Munoz --- release/update-repository-version.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/release/update-repository-version.sh b/release/update-repository-version.sh index 599f798..a344672 100755 --- a/release/update-repository-version.sh +++ b/release/update-repository-version.sh @@ -74,10 +74,17 @@ bump_repo() { pushd "${repo}" >>/dev/null + branch="${new_version}-branch-bump" + git fetch origin "${target_branch}" + git checkout "origin/${target_branch}" -b "${branch}" + # All repos we build should have a VERSION file [ -f "VERSION" ] || die "VERSION file not found " current_version="$(cat ./VERSION | grep -v '#')" + info "Updating VERSION file" + echo "${new_version}" >VERSION + info "Creating PR message" notes_file=notes.md cat <"${notes_file}" @@ -86,12 +93,8 @@ bump_repo() { $(get_changes "$current_version") EOT + cat "${notes_file}" - info "Updating VERSION file" - echo "${new_version}" >VERSION - branch="${new_version}-branch-bump" - git fetch origin "${target_branch}" - git checkout "origin/${target_branch}" -b "${branch}" git add -u info "Creating commit with new changes" commit_msg="$(generate_commit $new_version $current_version)"