Skip to content

Instantly share code, notes, and snippets.

@yassermzh
Last active June 2, 2020 19:37
Show Gist options
  • Save yassermzh/fed5f1e232d8b425b2cabf59f7317c87 to your computer and use it in GitHub Desktop.
Save yassermzh/fed5f1e232d8b425b2cabf59f7317c87 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'workflow',
initial: 'idle',
parallel: true,
states: {
jira: {
id: "jira",
initial: "todo",
states: {
todo: {
on: { '': 'ready_for_development' },
},
ready_for_development: {
on: { ASSIGN: "in_progress" },
},
in_progress: {
on: { CREATE_PR: 'pr_review' },
},
pr_review: { on: { APPROVE_PR: 'pr_reviewed'}},
pr_reviewed: { on: {MERGE_TO_DEVELOPMENT: 'ready_for_testing' }},
ready_for_testing: { on: { TESTING: 'qa'}},
qa: { on: { TEST_PASS: 'ready_to_merge' }},
ready_to_merge: { on: { release: 'done'}},
done: {}
},
},
github: {
id: "github",
initial: "idle",
states: {
idle: { on: {ASSIGN: 'coding'}},
coding: { on: { CREATE_PR: 'waiting_for_review' }},
waiting_for_review: { on: {APPROVE_PR: 'waiting_to_merge'}},
waiting_to_merge: { on: {MERGE_TO_DEVELOPMENT: 'development'}},
development: {on: {MERGE_TO_STAGING: 'staging' }},
staging: { on :{MERGE_TO_MASTER: 'master' }
},
master: { on: {'': 'idle'}}
}
},
circleci: {
id: 'circleci',
initial: 'idle',
states: {
idle: { on: {
CREATE_PR: 'build',
}},
build: { on: { '': 'test' }},
test: { on: { '': 'upload_browserstack' }},
upload_browserstack: { on: {'' : 'done' }},
done: { on: {'': 'idle' }},
},
},
appcenter: {
id: 'appcenter',
initial: 'idle',
states: {
idle: { on: { MERGE_TO_STAGING: 'build',
MERGE_TO_MASTER: 'build',
} },
build: { on: { '': 'idle'} },
}
},
google_play: {
id: "google_play",
initial: "idle",
states: {
idle: { on: {MERGE_TO_STAGING: 'alpha'}},
alpha: { on: {MERGE_TO_MASTER: 'beta'}},
beta: { on: { RELEASE: 'production'}},
production: { on: {'': 'idle'}},
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment