diff options
author | Dan Radez <dradez@redhat.com> | 2017-05-12 12:37:33 -0400 |
---|---|---|
committer | Feng Pan <fpan@redhat.com> | 2017-05-30 16:36:11 -0400 |
commit | 8f2cffd3681baffd44ab6fb1e9d91d899053753b (patch) | |
tree | 03d9969f04a355af246fee6f1cca49d006859100 /build/functions.sh | |
parent | a622216b83fd46d3ad1fd763a367cc26323a8864 (diff) |
Moving to forks on gerrit.opnfv.org
Migrating off of github onto opnfv.org to host our forked
projects that are side loaded into our builds
apex-tripleo-heat-templates: Ic65cfeee4a55e993629f831c8c9d9addf6f3dff4
apex-puppet-tripleo: If498c41d706c8f14a5b0bbee64cb4d26cd78c2d0
apex-os-net-config: I5281a57640f388e984b061702362f9c82d08da78
Change-Id: Ieb5cf293ad06d90fce7a9467e32ac0f2d8731a0a
Signed-off-by: Dan Radez <dradez@redhat.com>
Signed-off-by: Feng Pan <fpan@redhat.com>
Diffstat (limited to 'build/functions.sh')
-rw-r--r-- | build/functions.sh | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/build/functions.sh b/build/functions.sh deleted file mode 100644 index becc0df1..00000000 --- a/build/functions.sh +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################## -# Copyright (c) 2016 Dan Radez (Red Hat) and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -clone_fork () { - # ARG 1: opnfv-tht or opnfv-puppet-tripleo - echo "Cloning $1" - - # Use apex tripleo-heat-templates fork - local ghcreds="" - local pr_num="" - local ref="stable/euphrates" - local repo="https://github.com/trozet/$1" - - if git log -1 | grep "${1}-pr:" | grep -o '[0-9]*'; then - pr_num=$(git log -1 | grep "${1}-pr:" | grep -o '[0-9]*') - fi - - if [ "$pr_num" != "" ]; then - echo "Using pull request $pr_num from $repo" - # Source credentials since we are rate limited to 60/day - if [ -f ~/.githubcreds ]; then - source ~/.githubcreds - ghcreds=" -u $GHUSERNAME:$GHACCESSTOKEN" - fi - - PR=$(curl $ghcreds https://api.github.com/repos/trozet/$1/pulls/$pr_num) - - # Do not pull from merged branches - MERGED=$(python -c "import json; print json.loads('''$PR'''.replace('\n', '').replace('\r', ''))['merged']") - if [ "$MERGED" == "False" ]; then - ref=$(python -c "import json; print json.loads('''$PR'''.replace('\n', '').replace('\r', ''))['head']['ref']") - echo "Setting GitHub Ref to: $REF" - repo=$(python -c "import json; print json.loads('''$PR'''.replace('\n', '').replace('\r', ''))['head']['repo']['clone_url']") - echo "Setting GitHub URL to: $repo" - fi - fi - - rm -rf $1 - git clone $repo -b $ref $1 -} |