0195b8092fc96619e16095b524d8f92b49d34ab2
[ci-management.git] / shell / onap-gerrit-review-wrapper.sh
1 #!/bin/sh
2
3 # ================================================================================
4 # Copyright (c) 2022 AT&T Intellectual Property. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
18
19 set -eu
20 echo "--> onap-gerrit-review-wrapper.sh"
21
22 # Cleanup temporary directory if exist
23 rm -Rf /tmp/ogr
24
25 # Create temporary directory to clone OGR repository
26 (
27    mkdir /tmp/ogr
28    cd  /tmp/ogr
29    git clone https://github.com/TonyLHansen/onap-gerrit-review.git
30 )
31 # Add OGR/bin to PATH
32 export PATH=$PATH:/tmp/ogr/onap-gerrit-review/bin
33
34 # Execute OGR
35 onap-gerrit-review -S git pull "https://gerrit.onap.org/r/$GERRIT_PROJECT" "$GERRIT_REFSPEC"
36 # Use -E flag for non-blocking report
37 # onap-gerrit-review -S -E git pull "https://gerrit.onap.org/r/$GERRIT_PROJECT" "$GERRIT_REFSPEC"
38