Update scripts to work on Nordix Master 20/220/2
authorliamfallon <liam.fallon@est.tech>
Thu, 20 Dec 2018 13:30:53 +0000 (13:30 +0000)
committerliamfallon <liam.fallon@est.tech>
Tue, 15 Jan 2019 15:43:25 +0000 (15:43 +0000)
The upstreaming process has been updated to work towards the Nordix
master in order to avoid merge conflicts when multiple
versions of reviews are updated.

Change-Id: I77e83fbf2696ad146516962b3a89ad3a6e49d1f2
Signed-off-by: liamfallon <liam.fallon@est.tech>
onap-reviews/heis-clone.sh
onap-reviews/heis-nordix2onap.sh [deleted file]
onap-reviews/heis-pull-review.sh
onap-reviews/heis-push2nordix.sh

index 3c8fba975d8d3b27601765b97b0fb2772f35e6b3..3cb856ffc55d122d81975f2a939e294b4d154109 100755 (executable)
 #   it as an entry to the .git/config configuration file of the repository
 #
 
-if [ $# -ne 4 ]
+if [ $# -ne 3 ]
 then
-  echo "usage $0 nordix-gerrit-userid onap-gerrit-userid repository-path local-repository"
+  echo "usage $0 nordix-gerrit-userid repository-path local-repository"
   echo "   example: $0 seancitizen janjansson policy/core core "
   exit 1
 fi
 
-git clone ssh://$1@gerrit.nordix.org:29418/$3 $4
+git clone ssh://$1@gerrit.nordix.org:29418/$2 $3
 
-scp -p -P 29418 $1@gerrit.nordix.org:hooks/commit-msg $4/.git/hooks
+scp -p -P 29418 $1@gerrit.nordix.org:hooks/commit-msg $3/.git/hooks
 
-echo '[remote "upstream"]' >> $4/.git/config
-echo "  url = ssh://$2@gerrit.onap.org:29418/$3.git" >> $4/.git/config
-echo "  fetch = +refs/heads/*:refs/remotes/upstream/*" >> $4/.git/config
+cd $3
+git co master
diff --git a/onap-reviews/heis-nordix2onap.sh b/onap-reviews/heis-nordix2onap.sh
deleted file mode 100755 (executable)
index cd48349..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#! /bin/bash
-
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2018 The Nordix Foundation. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-#
-# This script transfers a review with a given change id from the Nordix gerrit repository
-# to the ONAP gerrit repository. The script:
-# - switches to the master branch
-# - resets the master branch to be at the latest merged version of the master branch on the
-#   Nordix gerrit repository
-# - pulls the given review onto the master branch
-# - pushes the review upstream onto the master branch of the ONAP repository
-# - resets the master branch again
-# - checks out the nordix-dev branch
-#
-
-if [ $# -ne 1 ]
-then
-  echo "usage $0 commit-id"
-  exit 1
-fi
-
-commit_check=`git log | grep "^commit $1"`
-if [ "" == "$commit_check" ]
-then
-  echo "commit with commit id $1 not found"
-  exit 2
-fi
-
-git checkout master
-git fetch origin
-git reset --hard origin/master
-
-git pull origin $1
-
-git push upstream HEAD:refs/for/master
-retVal=$?
-if [ $retVal -eq 0 ]
-then
-  echo "push upstream to ONAP succeeded"
-else
-  echo "push upstream to ONAP failed"
-fi
-
-git fetch origin
-git reset --hard origin/master
-
-git checkout nordix-dev
index 3d3391cea0ba3cb8ea57902569149a14be074988..1d805388490c41f28a5918ba6b1bdbf13b174924 100755 (executable)
@@ -32,7 +32,7 @@ then
   exit 1
 fi
 
-git checkout nordix-dev
+git checkout master
 git fetch origin
 git reset --hard origin/master
 
index f30b74c1d9e2cb962e3748d515226a4d0e7a16d3..b3b59e297e8ce702f7acf9386bb00b9b86fd89c1 100755 (executable)
@@ -29,7 +29,7 @@ then
   exit 1
 fi
 
-git push origin HEAD:refs/for/nordix-dev
+git push origin HEAD:refs/for/master
 
 retVal=$?
 if [ $retVal -eq 0 ]