~chris.macnaughton/ubuntu-openstack-ci/fixed-index

« back to all changes in this revision

Viewing changes to run/job-parts/osci_openstack_common.sh

  • Committer: Chris MacNaughton
  • Date: 2019-05-16 14:47:34 UTC
  • mfrom: (415.1.2 ubuntu-openstack-ci)
  • Revision ID: chris.macnaughton@canonical.com-20190516144734-trsp5ondlqcexo2g
[chris.macnaughton, r=admcleod,fnordahl] Allow us to run PRs of other repos

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
    _github_api_pr_url="https://api.github.com/repos/$_pr_repo/pulls/$_pr_num"
151
151
    _pr_label=$(curl $_github_api_pr_url | \
152
152
                    awk '/"head":/ {getline; gsub(/"|,/, ""); print $2}')
 
153
    export GITHUB_PR_REPO=$(echo $_pr_repo | cut -f2 -d/)
 
154
    export GITHUB_PR_ORG=$(echo $_pr_repo | cut -f1 -d/)
153
155
    export GITHUB_PR_LOGIN=$(echo $_pr_label | cut -f1 -d:)
154
156
    export GITHUB_PR_BRANCH=$(echo $_pr_label | cut -f2 -d: | \
155
157
                                 sed -e 's/\//\\\//')
160
162
    f_line $FUNCNAME
161
163
    f_openstack_get_zaza_github_func_test_pr
162
164
    if [ -n "$GITHUB_PR_LOGIN" -a -n "$GITHUB_PR_BRANCH" ]; then
163
 
      sed -i s/openstack-charmers\\/zaza.git/${GITHUB_PR_LOGIN}\\/zaza.git@${GITHUB_PR_BRANCH}/ ${BUILT_ASSET_DIR-$CO_DIR}/test-requirements.txt
 
165
      sed -i s/${GITHUB_PR_ORG}\\/${GITHUB_PR_REPO}.git/${GITHUB_PR_LOGIN}\\/${GITHUB_PR_REPO}.git@${GITHUB_PR_BRANCH}/ ${BUILT_ASSET_DIR-$CO_DIR}/test-requirements.txt
164
166
    fi
165
167
}
166
168