blob: d2c741bcee9222160e72e45e515a21d1d5011e28 [file] [log] [blame]
Fathi Boudra422bf772019-12-02 11:10:16 +02001#!/bin/bash
2#
3# Copyright (c) 2019, Arm Limited. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8# $1 = git remote human readable name
9# $2 = git remote URL
10sync_repo()
11{
12 local result
13 echo Pushing to $1...
14 git push $2 master
15 result=$?
16 if [ $result != 0 ]
17 then
18 echo Pushing to $1 FAILED!
19 else
20 echo Pushing to $1 SUCCEEDED!
21 fi
22 return $result
23}
24
25# exit if anything fails
26set -e
27
28source "$CI_ROOT/utils.sh"
29
30if [ ! -d "trusted-firmware-a" ]
31then
32 # Fresh clone
33 echo Cloning from trustedfirmware.org...
34 git clone $tf_src_repo_url
35else
36 echo Using existing repo...
37fi
38
39echo Pulling from trustedfirmware.org...
40cd trusted-firmware-a
41git remote update --prune
42git checkout master
43git merge --ff-only origin/master
44
45# stop exiting automatically
46set +e
47
48sync_repo GitHub https://$GH_USER:$GH_PASSWORD@github.com/ARM-software/arm-trusted-firmware.git
49github=$?
50sync_repo "internal Arm Gerrit" $tf_arm_gerrit_repo
51gerrit=$?
52
53if [ $github != 0 -o $gerrit != 0 ]
54then
55 exit 1
56fi