Skip to content

Commit 9af87f1

Browse files
committed
build/merge.bash: script to help sync nightly with upstream
Change-Id: Iae9ee80b9fbbb64cc86b432487613334cf1fb72b Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/225097 Reviewed-by: Rebecca Stambler <[email protected]>
1 parent 67fde72 commit 9af87f1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

build/merge.bash

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /bin/bash
2+
set -euo pipefail
3+
4+
# In order to sync with upstream, run merge.bash
5+
6+
# TODO(hyangah): commands for building docker container and running tests locally with docker run.
7+
root_dir() {
8+
local script_name=$(readlink -f "${0}")
9+
local script_dir=$(dirname "${script_name}")
10+
local parent_dir=$(dirname "${script_dir}")
11+
echo "${parent_dir}"
12+
}
13+
14+
ROOT="$(root_dir)"
15+
cd "${ROOT}" # always run from the root directory.
16+
17+
WORKTREE="$(mktemp -d)"
18+
BRANCH="sync/merge-upstream-$(date +%Y%m%d%H%M%S)"
19+
20+
git fetch
21+
git worktree add --track -b "${BRANCH}" "${WORKTREE}" origin/master
22+
23+
cd "${WORKTREE}"
24+
export GIT_GOFMT_HOOK=off
25+
git merge --no-commit "origin/upstream" || echo "Ignoring conflict..."
26+
27+
COMMIT=`git log --format=%h -n 1 "origin/upstream"`
28+
29+
gcloud builds submit --config=build/cloud.yaml || echo "Build failed. Please address the issue..."
30+
31+
git commit -m "sync: merge microsoft/vscode-go@${COMMIT} into master"
32+
33+
git codereview mail -r [email protected],[email protected] HEAD
34+
cd - && git worktree remove "${WORKTREE}"

0 commit comments

Comments
 (0)