forked from golang/vscode-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#! /bin/bash | ||
set -euo pipefail | ||
|
||
# In order to sync with upstream, run merge.bash | ||
|
||
# TODO(hyangah): commands for building docker container and running tests locally with docker run. | ||
root_dir() { | ||
local script_name=$(readlink -f "${0}") | ||
local script_dir=$(dirname "${script_name}") | ||
local parent_dir=$(dirname "${script_dir}") | ||
echo "${parent_dir}" | ||
} | ||
|
||
ROOT="$(root_dir)" | ||
cd "${ROOT}" # always run from the root directory. | ||
|
||
WORKTREE="$(mktemp -d)" | ||
BRANCH="sync/merge-upstream-$(date +%Y%m%d%H%M%S)" | ||
|
||
git fetch | ||
git worktree add --track -b "${BRANCH}" "${WORKTREE}" origin/master | ||
|
||
cd "${WORKTREE}" | ||
export GIT_GOFMT_HOOK=off | ||
git merge --no-commit "origin/upstream" || echo "Ignoring conflict..." | ||
|
||
COMMIT=`git log --format=%h -n 1 "origin/upstream"` | ||
|
||
gcloud builds submit --config=build/cloud.yaml || echo "Build failed. Please address the issue..." | ||
|
||
git commit -m "sync: merge microsoft/vscode-go@${COMMIT} into master" | ||
|
||
git codereview mail -r [email protected],[email protected] HEAD | ||
cd - && git worktree remove "${WORKTREE}" |