-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
81 lines (74 loc) · 3.53 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
'use strict';
var conf = require('fs').readFileSync(__dirname + '/config.json');
process.__config = JSON.parse(conf.toString());
require('colors');
const syncEpics = require('./actions/syncEpics');
const syncStories = require('./actions/syncStories');
const syncStatus = require('./actions/syncStatus');
const syncBugs = require('./actions/syncBugs');
let comp = process.argv[2];
if (!comp) {
console.log('Choose component!'.red);
process.exit();
}
console.log(('Working with ' + comp).green);
const current = process.__config.projects[comp];
sync(current.trello, current.jira)
.then((e) => console.log('\n\nBe happy!'.green), (e) => console.log(e))
.catch((e) => { console.log(JSON.strigify(e)); })
function sync(trelloBoard, jiraProject) {
console.log('\n1. Syncing Labels to Epics.'.cyan);
return syncEpics(trelloBoard, jiraProject)
.then(() => {
console.log('\n2. Syncing Cards to Stories.'.cyan);
return syncStories(trelloBoard, jiraProject);
})
.then(() => {
console.log('\n3. Syncing Bugs to Cards.'.cyan);
return syncBugs(trelloBoard, jiraProject);
})
.then(() => {
console.log('\n4. Syncing Stories in Backlog.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Bugs', 'Backlog'], 'Backlog', 'Story added to the backlog.');
})
.then(() => {
console.log('\n5. Syncing Stories in Up Next.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Up Next'], 'To Do', 'Story added to the sprint.');
})
.then(() => {
console.log('\n6. Syncing Stories in In Progress.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['In Progress', 'Blocked'], 'In Progress', 'Progress started.');
})
.then(() => {
console.log('\n6. Syncing Stories in Ready to Merge.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Ready to Merge'], 'Waiting On Build', 'Dev done, pull requests created, waiting to be merged into develop branch.');
})
.then(() => {
console.log('\n7. Syncing Stories in Deployed to dev.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Deployed to Dev'], 'Deployed to Dev', 'Feature branch merged into dev. Deployed in dev environment.');
})
.then(() => {
console.log('\n8. Syncing Stories in Ready for QA.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Ready for QA'], 'Ready for QA', 'Dev approved, ready to be deployed in QA env.');
})
.then(() => {
console.log('\n9. Syncing Stories in Deployed in QA.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Deployed to QA'], 'Deployed to QA', 'Deployed in QA environment, ready for testing.');
})
.then(() => {
console.log('\n10. Syncing Stories in Ready for Release.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Ready to Release'], 'Ready For Staging', 'Work finished, ready for release management.');
})
.then(() => {
console.log('\n11. Syncing Stories in Deployed to Stage.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Deployed to Stage'], 'Deployed to Staging', 'Release deployed to staging.');
})
.then(() => {
console.log('\n12. Syncing Stories in Ready for Production.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Ready for Production'], 'Resolved', 'Release approved in Staging, ready to production deploy.');
})
.then(() => {
console.log('\n13. Syncing Stories in Deployed to Production.'.cyan);
return syncStatus(trelloBoard, jiraProject, ['Deployed to Production'], 'Closed', 'Release deployed in production!.');
});
}