Merge lp:~chris.macnaughton/ubuntu-openstack-ci/direct-git into lp:ubuntu-openstack-ci

Proposed by Chris MacNaughton
Status: Merged
Merged at revision: 411
Proposed branch: lp:~chris.macnaughton/ubuntu-openstack-ci/direct-git
Merge into: lp:ubuntu-openstack-ci
Diff against target: 62 lines (+28/-2)
2 files modified
run/job-parts/build_func_test.sh (+4/-0)
run/job-parts/osci_gerrit_common.sh (+24/-2)
To merge this branch: bzr merge lp:~chris.macnaughton/ubuntu-openstack-ci/direct-git
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+360914@code.launchpad.net
To post a comment you must log in.
412. By Chris MacNaughton

Add optional TEST_PATH to func runner

413. By Chris MacNaughton

Replace variable check with a default substitution for GIT_BRANCH

Revision history for this message
Liam Young (gnuoy) wrote :

LGTM, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'run/job-parts/build_func_test.sh'
--- run/job-parts/build_func_test.sh 2018-12-13 20:55:35 +0000
+++ run/job-parts/build_func_test.sh 2018-12-14 08:00:44 +0000
@@ -19,6 +19,10 @@
19f_env_set_network_env_vars19f_env_set_network_env_vars
20cd ${BUILT_ASSET_DIR-$CO_DIR}20cd ${BUILT_ASSET_DIR-$CO_DIR}
2121
22if [[ -n $TEST_PATH ]]; then
23 cd $TEST_PATH
24fi
25
22: ${TOX_SEARCH:="func27|func"}26: ${TOX_SEARCH:="func27|func"}
23target=$(awk "BEGIN {FS=\":\"} /^\[testenv:("$TOX_SEARCH")\]/ {gsub(/\]/,\"\"); print \$2}" tox.ini)27target=$(awk "BEGIN {FS=\":\"} /^\[testenv:("$TOX_SEARCH")\]/ {gsub(/\]/,\"\"); print \$2}" tox.ini)
2428
2529
=== modified file 'run/job-parts/osci_gerrit_common.sh'
--- run/job-parts/osci_gerrit_common.sh 2018-12-13 20:55:35 +0000
+++ run/job-parts/osci_gerrit_common.sh 2018-12-14 08:00:44 +0000
@@ -39,7 +39,9 @@
39 fi39 fi
4040
41 # Detect repo approach and fetch/clone/branch the asset41 # Detect repo approach and fetch/clone/branch the asset
42 if [[ ! -z "$GERRIT_REFSPEC" ]] && [[ "$GERRIT_CHANGE_NUMBER" != "-1" ]]; then42 if [[ ! -z "$GIT_REPO" ]]; then
43 f_git_checkout_direct
44 elif [[ ! -z "$GERRIT_REFSPEC" ]] && [[ "$GERRIT_CHANGE_NUMBER" != "-1" ]]; then
43 f_gerrit_git_fetch_refspec45 f_gerrit_git_fetch_refspec
44 elif [[ ! -z "$BASE_NAME" ]] && [[ -z "$BRANCH" ]]; then46 elif [[ ! -z "$BASE_NAME" ]] && [[ -z "$BRANCH" ]]; then
45 f_git_clone_by_base_name47 f_git_clone_by_base_name
@@ -52,11 +54,31 @@
52}54}
5355
5456
57function f_git_checkout_direct() {
58 # Git clone based on GIT_REPO and optional GIT_BRANCH (default to master)
59 f_line $FUNCNAME
60
61 export GIT_BRANCH=${GIT_BRANCH:-"master"}
62
63 f_set_co_dir
64
65 if [[ -d $CO_DIR ]]; then
66 echo " - Removing existing checkout @ $CO_DIR"
67 rm -rf ${CO_DIR:?}
68 fi
69
70 mkdir -p $CO_DIR
71 echo " + Cloning $GIT_REPO --> $CO_DIR"
72 git clone $GIT_REPO $CO_DIR -b $GIT_BRANCH --depth 1
73 f_git_announce_info
74}
75
76
55function f_git_clone_by_base_name(){77function f_git_clone_by_base_name(){
56# Git clone based on BASE_NAME and optional GIT_BRANCH (default to master)78# Git clone based on BASE_NAME and optional GIT_BRANCH (default to master)
57 f_line $FUNCNAME79 f_line $FUNCNAME
5880
59 [[ -z "$GIT_BRANCH" ]] && export GIT_BRANCH="master"81 export GIT_BRANCH=${GIT_BRANCH:-"master"}
6082
61 if [[ -z "$BASE_NAME" ]]; then83 if [[ -z "$BASE_NAME" ]]; then
62 echo " ! Missing the required GIT env vars."84 echo " ! Missing the required GIT env vars."

Subscribers

People subscribed via source and target branches