Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor package promotion workflow from parallel to sequential #143

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions actions/workflows/bwc_pkg_promote_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ tasks:
promote_all:
next:
- do:
# These tasks do not properly join to process_completion when run in
# parallel, so we run them sequentially
# Due to bug /~https://github.com/StackStorm/orquesta/issues/112,
# these tasks do not properly join to process_completion when run
# in parallel, so we run them sequential.
- promote_bwc_enterprise
promote_bwc_enterprise:
action: st2ci.st2_pkg_promote_enterprise
Expand Down
65 changes: 26 additions & 39 deletions actions/workflows/st2_pkg_promote_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ tasks:
- when: <% succeeded() %>
do:
- promote_all


promote_all:
next:
- do:
# Due to bug /~https://github.com/StackStorm/orquesta/issues/112,
# these tasks do not properly join to process_completion when run
# in parallel, so we run them sequential.
- promote_st2
- promote_st2chatops
- promote_st2mistral
- promote_st2web
- promote_st2flow
promote_st2:
action: st2ci.st2_pkg_promote
input:
Expand All @@ -70,13 +71,10 @@ tasks:
version: <% ctx().version %>
next:
- when: <% succeeded() %>
publish:
- promoted_st2: <% ctx().version + '-' + result().output.revision %>
do:
- process_completion
publish: promoted_st2=<% ctx().version + '-' + result().output.revision %>
do: promote_st2chatops
- when: <% failed() %>
do:
- process_completion
do: promote_st2chatops
promote_st2chatops:
action: st2ci.st2_pkg_promote
input:
Expand All @@ -86,13 +84,10 @@ tasks:
version: <% ctx().version %>
next:
- when: <% succeeded() %>
publish:
- promoted_st2chatops: <% ctx().version + '-' + result().output.revision %>
do:
- process_completion
publish: promoted_st2chatops=<% ctx().version + '-' + result().output.revision %>
do: promote_st2mistral
- when: <% failed() %>
do:
- process_completion
do: promote_st2mistral
promote_st2mistral:
action: st2ci.st2_pkg_promote
input:
Expand All @@ -102,13 +97,10 @@ tasks:
version: <% ctx().version %>
next:
- when: <% succeeded() %>
publish:
- promoted_st2mistral: <% ctx().version + '-' + result().output.revision %>
do:
- process_completion
publish: promoted_st2mistral=<% ctx().version + '-' + result().output.revision %>
do: promote_st2web
- when: <% failed() %>
do:
- process_completion
do: promote_st2web
promote_st2web:
action: st2ci.st2_pkg_promote
input:
Expand All @@ -118,13 +110,10 @@ tasks:
version: <% ctx().version %>
next:
- when: <% succeeded() %>
publish:
- promoted_st2web: <% ctx().version + '-' + result().output.revision %>
do:
- process_completion
publish: promoted_st2web=<% ctx().version + '-' + result().output.revision %>
do: promote_st2flow
- when: <% failed() %>
do:
- process_completion
do: promote_st2flow
promote_st2flow:
action: st2ci.st2_pkg_promote_enterprise
input:
Expand All @@ -134,23 +123,21 @@ tasks:
version: <% ctx().version %>
next:
- when: <% succeeded() %>
publish:
- promoted_st2flow: <% ctx().version + '-' + result().output.revision %>
do:
- process_completion
publish: promoted_st2flow=<% ctx().version + '-' + result().output.revision %>
do: process_completion
- when: <% failed() %>
do:
- process_completion
do: process_completion


process_completion:
action: core.noop
join: all
next:
- when: <% succeeded() and (not ctx().promoted_st2 or not ctx().promoted_st2chatops or not ctx().promoted_st2mistral or not ctx().promoted_st2web or not ctx().promoted_st2flow) %>
do:
- set_notify_failure
do: set_notify_failure
- when: <% succeeded() and (ctx().promoted_st2 and ctx().promoted_st2chatops and ctx().promoted_st2mistral and ctx().promoted_st2web and ctx().promoted_st2flow) %>
do:
- set_notify_success
do: set_notify_success


set_notify_failure:
action: core.noop
next:
Expand Down