{"action":"created","issue":{"url":"https://api.github.com/repos/allegro/axion-release-plugin/issues/90","labels_url":"https://api.github.com/repos/allegro/axion-release-plugin/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/allegro/axion-release-plugin/issues/90/comments","events_url":"https://api.github.com/repos/allegro/axion-release-plugin/issues/90/events","html_url":"https://github.com/allegro/axion-release-plugin/issues/90","id":97018818,"number":90,"title":"Modifying files with pre/post during CI build","user":{"login":"imavroukakis","id":1764981,"avatar_url":"https://avatars.githubusercontent.com/u/1764981?v=3","gravatar_id":"","url":"https://api.github.com/users/imavroukakis","html_url":"https://github.com/imavroukakis","followers_url":"https://api.github.com/users/imavroukakis/followers","following_url":"https://api.github.com/users/imavroukakis/following{/other_user}","gists_url":"https://api.github.com/users/imavroukakis/gists{/gist_id}","starred_url":"https://api.github.com/users/imavroukakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imavroukakis/subscriptions","organizations_url":"https://api.github.com/users/imavroukakis/orgs","repos_url":"https://api.github.com/users/imavroukakis/repos","events_url":"https://api.github.com/users/imavroukakis/events{/privacy}","received_events_url":"https://api.github.com/users/imavroukakis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":41,"created_at":"2015-07-24T10:08:13Z","updated_at":"2015-08-20T08:17:56Z","closed_at":"2015-08-20T08:17:56Z","body":"I've hit a wall with regards to auto-incrementing certain version numbers during release. It's probably a conceptual issue but it might be worth running it past you.\r\nI have the following hooks\r\n```\r\n hooks {\r\n        pre 'fileUpdate', [file   : 'src/main/scripts/upstart/service.conf',\r\n                           pattern: { v, p -> /module_version=\"$v-SNAPSHOT\"/ }, replacement: { v, p -> \"module_version=\\\"$v\\\"\" }]\r\n        pre 'commit'\r\n        post 'fileUpdate', [file   : 'gradle.properties',\r\n                           pattern: { v, p -> /rpmRelease=$project.rpmRelease/ }, replacement: { v, p -> \"rpmRelease=${project.rpmRelease.toInteger() + 1}\" }]\r\n    }\r\n```\r\nWhat I'm trying to do is: \r\n* Amend the version in `service.conf`\r\n* Build\r\n* Release and publish\r\n* Amend the `rpmRelease` number by 1, to start the next iteration process (i.e. the next scm checkout for the CI continuous build should be a SNAPSHOT)\r\n\r\nUnfortunately, I can't figure out a way for axion to do another commit/push to GitHub as part of the `post fileUpdate` action. Is that even possible?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/allegro/axion-release-plugin/issues/comments/132930447","html_url":"https://github.com/allegro/axion-release-plugin/issues/90#issuecomment-132930447","issue_url":"https://api.github.com/repos/allegro/axion-release-plugin/issues/90","id":132930447,"user":{"login":"imavroukakis","id":1764981,"avatar_url":"https://avatars.githubusercontent.com/u/1764981?v=3","gravatar_id":"","url":"https://api.github.com/users/imavroukakis","html_url":"https://github.com/imavroukakis","followers_url":"https://api.github.com/users/imavroukakis/followers","following_url":"https://api.github.com/users/imavroukakis/following{/other_user}","gists_url":"https://api.github.com/users/imavroukakis/gists{/gist_id}","starred_url":"https://api.github.com/users/imavroukakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imavroukakis/subscriptions","organizations_url":"https://api.github.com/users/imavroukakis/orgs","repos_url":"https://api.github.com/users/imavroukakis/repos","events_url":"https://api.github.com/users/imavroukakis/events{/privacy}","received_events_url":"https://api.github.com/users/imavroukakis/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T08:17:56Z","updated_at":"2015-08-20T08:17:56Z","body":"Ok I follow. This is fine when releasing for production, however the same script is useable across several environments, including ones considered ok to receive a SNAPSHOT. So  `fileUpdate` becomes good only for"}}