mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 14:06:58 +02:00
34 lines
1.1 KiB
Bash
Executable File
34 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright (c) 2013 The CoreOS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
|
|
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
|
|
|
DEFINE_string master "master" "Manifest master branch to update."
|
|
DEFINE_string branch "build-${TODAYS_VERSION}" \
|
|
"Manifest branch, tag, or other ref to get version from."
|
|
DEFINE_boolean push ${FLAGS_FALSE} "Push to public manifest repository."
|
|
DEFINE_string remote "origin" "Remote name or URL to push to."
|
|
|
|
# Parse flags
|
|
FLAGS "$@" || exit 1
|
|
eval set -- "${FLAGS_ARGV}"
|
|
switch_to_strict_mode
|
|
|
|
info "Running repo init -b ${FLAGS_master}"
|
|
repo init -b "${FLAGS_master}"
|
|
|
|
info "Updating version.txt from ${FLAGS_branch}"
|
|
cd "${GCLIENT_ROOT}/.repo/manifests"
|
|
git checkout "${FLAGS_branch}" version.txt
|
|
git add version.txt
|
|
git commit -m "bump(version): Update version from ${FLAGS_branch}"
|
|
|
|
if [[ ${FLAGS_push} -eq ${FLAGS_TRUE} ]]; then
|
|
info "Pushing to ${FLAGS_remote} ${FLAGS_master}"
|
|
git push "${FLAGS_remote}" "HEAD:refs/heads/${FLAGS_master}"
|
|
fi
|