{"action":"created","issue":{"url":"https://api.github.com/repos/timkelty/shipit-shared/issues/32","labels_url":"https://api.github.com/repos/timkelty/shipit-shared/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/timkelty/shipit-shared/issues/32/comments","events_url":"https://api.github.com/repos/timkelty/shipit-shared/issues/32/events","html_url":"https://github.com/timkelty/shipit-shared/issues/32","id":108776212,"number":32,"title":"Nothing is triggered","user":{"login":"tlartaud","id":494234,"avatar_url":"https://avatars.githubusercontent.com/u/494234?v=3","gravatar_id":"","url":"https://api.github.com/users/tlartaud","html_url":"https://github.com/tlartaud","followers_url":"https://api.github.com/users/tlartaud/followers","following_url":"https://api.github.com/users/tlartaud/following{/other_user}","gists_url":"https://api.github.com/users/tlartaud/gists{/gist_id}","starred_url":"https://api.github.com/users/tlartaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlartaud/subscriptions","organizations_url":"https://api.github.com/users/tlartaud/orgs","repos_url":"https://api.github.com/users/tlartaud/repos","events_url":"https://api.github.com/users/tlartaud/events{/privacy}","received_events_url":"https://api.github.com/users/tlartaud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-09-29T01:10:14Z","updated_at":"2015-09-30T14:50:13Z","closed_at":null,"body":"Hi there,\r\n\r\nI was wondering myself if for some months, your node finally works.\r\nApparently not, absolutely nothing is triggered/executed from your task while deploying with shipit.\r\n\r\nThe problem simply comes from there\r\n```\r\n// Trigger on deploy by default\r\n  shipit.on('start', function() {\r\n    shipit.config.shared = shipit.config.shared || {};\r\n    var event = shipit.config.shared.triggerEvent;\r\n    event = event !== undefined ? event : 'updated';\r\n\r\n    if (event) {\r\n      shipit.on(event, function() {\r\n        shipit.start('shared');\r\n      });\r\n    }\r\n  });\r\n```\r\n\r\nSee the comments to see why it will never work like this\r\n```\r\n// Trigger on deploy by default\r\n// 1 . Where do that 'start' event comes from ? orchestrator ? Not sure you can call it like that.\r\n// I can't see that event on shipit-deploy doc. https://github.com/shipitjs/shipit-deploy\r\n// consider using the 'deploy' event instead ?\r\n  shipit.on('start', function() {\r\n\r\n    // 2 . Let's see thats this task will never run (script will not fail)\r\n   // add this line, and run a deploy, the script should normally stop, and show a red line.\r\n   gruntOrShipit.fail.fatal('this task will never be run ....');\r\n\r\n   // 3 . At this point, on this unexistent 'start' event, and even on the 'deploy' event,\r\n   // shipit.config is not yet set by shipit-deploy, so, we could replace the following line\r\n   // with this one. it's equivalent. \r\n   // shipit.config.shared = {}\r\n    shipit.config.shared = shipit.config.shared || {};\r\n\r\n    // 4 . Once again, at this point, on this event, shipit.config.shared will always be undefined,\r\n    // because shipit.config.shared = {}\r\n    var event = shipit.config.shared.triggerEvent;\r\n\r\n    // 5 . At this point, event will always be undefined even if we set triggerEvent in our shipit-shared file. Then you change it to 'update' it so simulate a default in case event is undefined, but unfortunaly, event will always be undefined.\r\n    event = event !== undefined ? event : 'updated';\r\n\r\n    // 6 . At this point, your are always doing :\r\n    // if ('updated') { .. }\r\n    if (event) {\r\n      shipit.on(event, function() {\r\n        shipit.start('shared');\r\n      });\r\n    }\r\n  });\r\n```\r\n\r\nFunny."},"comment":{"url":"https://api.github.com/repos/timkelty/shipit-shared/issues/comments/144435274","html_url":"https://github.com/timkelty/shipit-shared/issues/32#issuecomment-144435274","issue_url":"https://api.github.com/repos/timkelty/shipit-shared/issues/32","id":144435274,"user":{"login":"timkelty","id":18329,"avatar_url":"https://avatars.githubusercontent.com/u/18329?v=3","gravatar_id":"","url":"https://api.github.com/users/timkelty","html_url":"https://github.com/timkelty","followers_url":"https://api.github.com/users/timkelty/followers","following_url":"https://api.github.com/users/timkelty/following{/other_user}","gists_url":"https://api.github.com/users/timkelty/gists{/gist_id}","starred_url":"https://api.github.com/users/timkelty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timkelty/subscriptions","organizations_url":"https://api.github.com/users/timkelty/orgs","repos_url":"https://api.github.com/users/timkelty/repos","events_url":"https://api.github.com/users/timkelty/events{/privacy}","received_events_url":"https://api.github.com/users/timkelty/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T14:50:13Z","updated_at":"2015-09-30T14:50:13Z","body":"@tlartaud see my comment explaining things here: https://github.com/shipitjs/grunt-shipit/issues/58#issuecomment-144434568\r\n\r\nSo, for the time being, if you changed `shipit.on('start')` to `shipit.on('deploy')` AND add  `require('shipit-shared')(grunt.shipit);` to your config, it should work as expected.\r\n\r\nA bit janky - but it will clean up once we get some PRs merged."}}