Skip to content

Commit

Permalink
Ordering changes in create-prs. (#1410)
Browse files Browse the repository at this point in the history
Merged PR #1410.
  • Loading branch information
nat-henderson authored and modular-magician committed Feb 19, 2019
1 parent c7ebb08 commit eb619ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
25 changes: 12 additions & 13 deletions .ci/ci.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ jobs:
{% for v in vars.terraform_v.itervalues() %}
- put: {{v.short_name}}-intermediate
params:
repository: magic-modules-with-comment/build/{{ v.short_name }}
repository: magic-modules/build/{{ v.short_name }}
branch_file: branchname/original_pr_branch_name
# Every time a change runs through this pipeline, it will generate a commit with
# a different hash - the hash includes timestamps. Therefore, even if there's no
Expand All @@ -354,7 +354,7 @@ jobs:
{% endfor %}
- put: ansible-intermediate
params:
repository: magic-modules-with-comment/build/ansible
repository: magic-modules/build/ansible
branch_file: branchname/original_pr_branch_name
# See comment on terraform-intermediate
only_if_diff: true
Expand All @@ -363,23 +363,13 @@ jobs:
skip_clone: true
- put: inspec-intermediate
params:
repository: magic-modules-with-comment/build/inspec
repository: magic-modules/build/inspec
branch_file: branchname/original_pr_branch_name
# See comment on terraform-intermediate
only_if_diff: true
force: true
get_params:
skip_clone: true
# This isn't load-bearing - it's just aesthetic. It will also be a no-op the first
# time through, it works the same way as the preceding push.
- put: magic-modules
params:
repository: magic-modules-with-comment/
branch_file: branchname/original_pr_branch_name
only_if_diff: true
force: true
get_params:
skip_clone: true
- task: create-or-update-pr
file: magic-modules/.ci/magic-modules/create-pr.yml
params:
Expand All @@ -399,6 +389,15 @@ jobs:
get_params:
skip_clone: true

- put: magic-modules
params:
repository: magic-modules/
branch_file: branchname/original_pr_branch_name
only_if_diff: true
force: true
get_params:
skip_clone: true

# Once everything is done and working, post the updated information to the
# magic-modules PR.
- put: magic-modules-new-prs
Expand Down
6 changes: 3 additions & 3 deletions .ci/magic-modules/create-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if [ -n "$TERRAFORM_REPO_USER" ]; then
fi

git checkout -b "$BRANCH_NAME"
if hub pull-request -b "$TERRAFORM_REPO_USER/$PROVIDER_NAME:master" -F ./downstream_body > ./tf_pr 2> ./tf_pr_err ; then
if hub pull-request -b "$TERRAFORM_REPO_USER/$PROVIDER_NAME:master" -h "$ORIGINAL_PR_BRANCH" -F ./downstream_body > ./tf_pr 2> ./tf_pr_err ; then
DEPENDENCIES="${DEPENDENCIES}depends: $(cat ./tf_pr) ${NEWLINE}"
LABELS="${LABELS}${PROVIDER_NAME},"
else
Expand Down Expand Up @@ -96,7 +96,7 @@ if [ -n "$ANSIBLE_REPO_USER" ]; then
fi

git checkout -b "$BRANCH_NAME"
if hub pull-request -b "$ANSIBLE_REPO_USER/ansible:devel" -F ./downstream_body > ./ansible_pr 2> ./ansible_pr_err ; then
if hub pull-request -b "$ANSIBLE_REPO_USER/ansible:devel" -h "$ORIGINAL_PR_BRANCH" -F ./downstream_body > ./ansible_pr 2> ./ansible_pr_err ; then
DEPENDENCIES="${DEPENDENCIES}depends: $(cat ./ansible_pr) ${NEWLINE}"
LABELS="${LABELS}ansible,"
else
Expand All @@ -122,7 +122,7 @@ fi
fi

git checkout -b "$BRANCH_NAME"
if hub pull-request -b "$INSPEC_REPO_USER/inspec-gcp:master" -F ./downstream_body > ./inspec_pr 2> ./inspec_pr_err ; then
if hub pull-request -b "$INSPEC_REPO_USER/inspec-gcp:master" -h "$ORIGINAL_PR_BRANCH" -F ./downstream_body > ./inspec_pr 2> ./inspec_pr_err ; then
DEPENDENCIES="${DEPENDENCIES}depends: $(cat ./inspec_pr) ${NEWLINE}"
LABELS="${LABELS}inspec,"
else
Expand Down

0 comments on commit eb619ec

Please sign in to comment.