2
2
3
3
echo " Syncing openvscode-server with upstream"
4
4
5
+ upstream_url=" https://github.com/microsoft/vscode.git"
6
+ upstream_branch=${1:- " upstream/main" }
7
+ local_branch=${2:- " next" }
8
+ only_sync=${3:- " false" }
9
+ base_commit_msg=" code web server initial commit"
10
+
5
11
exit_script () {
6
12
reason=$1
7
13
echo " Update script ended unsucessfully"
19
25
LINUX_EXTRA_ARGS=" --disable-dev-shm-usage --use-gl=swiftshader"
20
26
fi
21
27
22
- cd $ROOT
23
-
24
- local_branch=" web-server"
25
- upstream_url=" https://github.com/microsoft/vscode.git"
26
- upstream_branch=" upstream/main"
27
- base_commit_msg=" code web server initial commit"
28
-
29
28
# Checks is there's an upstream remote repository and if not
30
29
# set it to $upstream_url
31
30
check_upstream () {
32
31
git remote -v | grep --quiet upstream
33
32
if [[ $? -ne 0 ]]; then
34
33
echo " Upstream repository not configured"
35
34
echo " Setting upstream URL to ${upstream_url} "
36
- git remote add upstream $upstream_url > /dev/null
35
+ git remote add upstream $upstream_url
37
36
fi
38
37
}
39
38
@@ -48,11 +47,11 @@ get_base_commit() {
48
47
49
48
# Fetch updates from upstream and rebase
50
49
sync () {
51
- echo " Fetching upstream..."
52
- git fetch upstream > /dev/null
53
- git checkout --quiet $local_branch > /dev/null
54
- echo " Rebasing $local_branch branch over $upstream_branch branch from upstream"
55
- git rebase --quiet -- onto=$upstream_branch $( get_base_commit) ^ $local_branch
50
+ echo " Shallow fetching upstream..."
51
+ git fetch upstream
52
+ git checkout $local_branch
53
+ echo " Rebasing $local_branch branch onto $upstream_branch from upstream"
54
+ git rebase --onto=$upstream_branch $( get_base_commit) ^ $local_branch
56
55
if [[ $? -ne 0 ]]; then
57
56
echo " There are merge conflicts doing the rebase. Reverting changes"
58
57
git rebase --abort
@@ -61,17 +60,30 @@ sync() {
61
60
echo " $local_branch sucessfully updated"
62
61
}
63
62
63
+ cd $ROOT
64
+
64
65
# Sync
65
66
check_upstream
66
67
sync
67
68
69
+ if [[ " $only_sync " == " true" ]]; then
70
+ exit 0
71
+ fi
72
+
68
73
# Clean and build
69
74
# git clean -dfx
70
75
yarn && yarn server:init
76
+ if [[ $? -ne 0 ]]; then
77
+ exit_script " There are some errors during compilation"
78
+ fi
71
79
72
80
# Configuration
73
81
export NODE_ENV=development
74
82
export VSCODE_DEV=1
75
83
export VSCODE_CLI=1
76
84
77
- yarn smoketest --web --headless --electronArgs=$LINUX_EXTRA_ARGS
85
+ # Run smoke tests
86
+ yarn smoketest --web --headless --verbose --electronArgs=$LINUX_EXTRA_ARGS
87
+ if [[ $? -ne 0 ]]; then
88
+ exit_script " Some smoke test are failing"
89
+ fi
0 commit comments