mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-16 18:02:05 +02:00
Fixing cell-build to apply patch only if necessary.
Change-Id: I08dcb74d2e421e4fe12c015b5afba1bf282896be
This commit is contained in:
parent
2ff66b4cbf
commit
bf6739d050
@ -19,21 +19,20 @@ ssh -t -t $ONOS_USER@$OCN "
|
|||||||
source ~/.bash_aliases
|
source ~/.bash_aliases
|
||||||
cd \$ONOS_ROOT
|
cd \$ONOS_ROOT
|
||||||
|
|
||||||
# Make sure the remote build machine is on the same commit hash as the local one
|
|
||||||
remoteCommit=\$(git log -n 1 | head -n1 | cut -d\ -f2)
|
|
||||||
|
|
||||||
# Clean-up the workspace and stash away any changes.
|
# Clean-up the workspace and stash away any changes.
|
||||||
git clean -f
|
git clean -f
|
||||||
git stash
|
git stash
|
||||||
|
|
||||||
|
# Make sure the remote build machine is on the same commit hash as the local one
|
||||||
|
remoteCommit=\$(git log -n 1 | head -n1 | cut -d\ -f2)
|
||||||
if [ "\$remoteCommit" != "$baseCommit" ]; then
|
if [ "\$remoteCommit" != "$baseCommit" ]; then
|
||||||
git checkout master
|
git checkout master
|
||||||
git pull
|
git pull
|
||||||
git checkout $baseCommit
|
git checkout $baseCommit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply the patch
|
# Apply the patch if necessary
|
||||||
git apply /tmp/$baseCommit.patch
|
[ -s /tmp/$baseCommit.patch ] && git apply /tmp/$baseCommit.patch
|
||||||
|
|
||||||
# Run the build (neutralizing known environment mutations in SSH sessions)
|
# Run the build (neutralizing known environment mutations in SSH sessions)
|
||||||
SHLVL=1 SSH_CLIENT=0 SSH_CONNECTION=0 bazel build onos
|
SHLVL=1 SSH_CLIENT=0 SSH_CONNECTION=0 bazel build onos
|
||||||
|
Loading…
x
Reference in New Issue
Block a user