diff --git a/goal_tools/python3_first/jobs.py b/goal_tools/python3_first/jobs.py index 6ccc295..1738024 100755 --- a/goal_tools/python3_first/jobs.py +++ b/goal_tools/python3_first/jobs.py @@ -514,7 +514,7 @@ class JobsUpdate(command.Command): else: LOG.warning('Could not find {} in {}'.format( repo, project_filename)) - return 1 + return 2 # Remove the items that need to stay in project-config. find_templates_to_extract(entry['project'], zuul_templates, zuul_jobs) @@ -535,7 +535,7 @@ class JobsUpdate(command.Command): if not in_tree_project.get('project'): LOG.info('no settings to write') - return 1 + return 2 if not in_tree_settings: in_tree_settings.append(in_tree_project) @@ -837,7 +837,7 @@ class JobsSwitchDocs(command.Command): if not changed: LOG.info('No updates needed for %s', repo) - return 1 + return 2 LOG.info('# {} switch docs jobs'.format(repo)) yaml = projectconfig_ruamellib.YAML() @@ -912,7 +912,7 @@ class JobsAddPy36(command.Command): if not changed: LOG.info('No updates needed for %s', repo) - return 1 + return 2 LOG.info('# {} add py36 jobs'.format(repo)) yaml = projectconfig_ruamellib.YAML() @@ -966,7 +966,7 @@ class JobsAddLibForwardTestingPy3(command.Command): if not changed: LOG.info('No updates needed for %s', repo) - return 1 + return 2 LOG.info('# {} add lib-forward-testing-python3 jobs'.format(repo)) yaml = projectconfig_ruamellib.YAML() diff --git a/tools/python3-first/do_repo.sh b/tools/python3-first/do_repo.sh index e5e9ebe..213b5aa 100755 --- a/tools/python3-first/do_repo.sh +++ b/tools/python3-first/do_repo.sh @@ -81,17 +81,23 @@ else if ! git -C "$repo" checkout -q origin/$branch ; then echo "Could not check out origin/$branch in $repo" - exit 1 + exit 2 fi git -C "$repo" checkout -b $new_branch fi -if ! python3-first -v --debug jobs update "$repo"; then +python3-first -v --debug jobs update "$repo" +RC=$? +if [ $RC -eq 2 ]; then echo "No changes" exit 1 fi +if [ $RC -ne 0 ]; then + echo "FAIL" + exit $RC +fi if ! git -C "$repo" diff --ignore-all-space; then echo "No changes other than whitespace" diff --git a/tools/python3-first/do_team.sh b/tools/python3-first/do_team.sh index 6e1fb53..ac1b94d 100755 --- a/tools/python3-first/do_team.sh +++ b/tools/python3-first/do_team.sh @@ -39,6 +39,11 @@ task_id=$(grep -e "$team" $bindir/taskids.txt | awk '{print $1}') echo "Story: $story_id" echo "Task : $task_id" +if [ -z "$task_id" ]; then + echo "Could not find task for $team" + exit 1 +fi + echo echo "=== Updating extra project settings ===" echo @@ -53,7 +58,9 @@ echo echo "=== Cloning $team repositories ===" echo -python3-first repos clone "$out_dir" "$team" +set -e + +python3-first -v --debug repos clone "$out_dir" "$team" $bindir/process_team.sh "$out_dir" "$team" master $task_id $bindir/update_doc_job.sh "$out_dir" "$team" $task_id diff --git a/tools/python3-first/process_team.sh b/tools/python3-first/process_team.sh index 87074d4..5cf5992 100755 --- a/tools/python3-first/process_team.sh +++ b/tools/python3-first/process_team.sh @@ -51,8 +51,15 @@ for repo in $(ls -d $workdir/*/*); do # it exists. Having it empty is fine. touch $workdir/$(basename $branch) - if $bindir/do_repo.sh "$repo" "$branch" "$task"; then + $bindir/do_repo.sh "$repo" "$branch" "$task" + RC=$? + if [ $RC -eq 0 ]; then tracking="$(basename $(dirname $repo))/$(basename $repo)" echo "$tracking" >> $workdir/$(basename $branch) + elif [ $RC -ne 2 ]; then + echo "FAIL" + exit $RC fi done + +exit 0 diff --git a/tools/python3-first/update_doc_job.sh b/tools/python3-first/update_doc_job.sh index 7ca24a7..a16a905 100755 --- a/tools/python3-first/update_doc_job.sh +++ b/tools/python3-first/update_doc_job.sh @@ -29,6 +29,8 @@ if [ -z "$task" ]; then exit 1 fi +set -e + enable_tox commit_message="switch documentation job to new PTI