From 1099dbe3194e0c7992ba176b429d73dff2989ae3 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Wed, 3 Jul 2013 11:40:36 -0400 Subject: [PATCH 1/2] add(master_release): Add script for updating master's version.txt This is intended to be called after branch_release and all official builds from that new branch are complete. Then updating master's version.txt will switch things to start using that new release as the source for binary packages. Complete documentation for this whole process coming soon. :) --- master_release | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 master_release diff --git a/master_release b/master_release new file mode 100755 index 0000000000..daab3d9ac3 --- /dev/null +++ b/master_release @@ -0,0 +1,37 @@ +#!/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 + +COREOS_EPOCH=1372636800 # Mon Jul 1 00:00:00 UTC 2013 +TODAYS_VERSION=$(( (`date +%s` - ${COREOS_EPOCH}) / 86400 )) +TODAYS_VERSION=$(printf "%04d" "${TODAYS_VERSION}") + +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 From 5790b3e1827a6a17576cb294d55ef3fe8860965a Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Wed, 3 Jul 2013 12:11:49 -0400 Subject: [PATCH 2/2] fix(*_release): Calculate TODAYS_VERSION in common.sh --- branch_release | 3 --- common.sh | 6 ++++++ master_release | 4 ---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/branch_release b/branch_release index 631acfa4cf..f321eef027 100755 --- a/branch_release +++ b/branch_release @@ -7,9 +7,6 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0")) . "${SCRIPT_ROOT}/common.sh" || exit 1 -COREOS_EPOCH=1372636800 # Mon Jul 1 00:00:00 UTC 2013 -TODAYS_VERSION=$(( (`date +%s` - ${COREOS_EPOCH}) / 86400 )) - DEFINE_integer build "${TODAYS_VERSION}" \ "Branch name (aka 'build'), should be days since 2013-7-1" DEFINE_integer branch 0 "Branch revision, should be 0" diff --git a/common.sh b/common.sh index 69299f06c1..588a0254d0 100644 --- a/common.sh +++ b/common.sh @@ -315,6 +315,12 @@ fi # Full version string. COREOS_VERSION_STRING="${COREOS_BUILD}.${COREOS_BRANCH}.${COREOS_PATCH}" +# Calculate what today's build version should be, used by release +# scripts to provide a reasonable default value. The value is the number +# of days since COREOS_EPOCH, Mon Jul 1 00:00:00 UTC 2013 +readonly COREOS_EPOCH=1372636800 +TODAYS_VERSION=$(printf "%04d" $(( (`date +%s` - ${COREOS_EPOCH}) / 86400 )) ) + # Load developer's custom settings. Default location is in scripts dir, # since that's available both inside and outside the chroot. By convention, # settings from this file are variables starting with 'CHROMEOS_' diff --git a/master_release b/master_release index daab3d9ac3..038e53bcbf 100755 --- a/master_release +++ b/master_release @@ -7,10 +7,6 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0")) . "${SCRIPT_ROOT}/common.sh" || exit 1 -COREOS_EPOCH=1372636800 # Mon Jul 1 00:00:00 UTC 2013 -TODAYS_VERSION=$(( (`date +%s` - ${COREOS_EPOCH}) / 86400 )) -TODAYS_VERSION=$(printf "%04d" "${TODAYS_VERSION}") - 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."