{"action":"created","issue":{"url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/27","labels_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/27/comments","events_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/27/events","html_url":"https://github.com/aws/amazon-ecs-agent/pull/27","id":59531359,"number":27,"title":"Initial implementation of basic versioning","user":{"login":"euank","id":2147649,"avatar_url":"https://avatars.githubusercontent.com/u/2147649?v=3","gravatar_id":"","url":"https://api.github.com/users/euank","html_url":"https://github.com/euank","followers_url":"https://api.github.com/users/euank/followers","following_url":"https://api.github.com/users/euank/following{/other_user}","gists_url":"https://api.github.com/users/euank/gists{/gist_id}","starred_url":"https://api.github.com/users/euank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/euank/subscriptions","organizations_url":"https://api.github.com/users/euank/orgs","repos_url":"https://api.github.com/users/euank/repos","events_url":"https://api.github.com/users/euank/events{/privacy}","received_events_url":"https://api.github.com/users/euank/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-02T19:16:09Z","updated_at":"2015-03-02T22:04:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/27","html_url":"https://github.com/aws/amazon-ecs-agent/pull/27","diff_url":"https://github.com/aws/amazon-ecs-agent/pull/27.diff","patch_url":"https://github.com/aws/amazon-ecs-agent/pull/27.patch"},"body":"This embeds the version file within the built binaries and adds a -version flag and metadata field that expose the version.\r\n\r\nThe version (e.g. 0.0.3) is committed / version controlled, but the commit hash is not. The cleanliness is always assumed 'dirty' when it is not built using the 'release' target in the makefile.\r\n\r\nCurrent usage:\r\n\r\nAfter running `make && make release`:\r\n```\r\n$ docker run -v /var/run/docker.sock:/var/run/docker.sock amazon/amazon-ecs-agent:latest -version\r\nAmazon ECS Agent:\r\n\tVersion: 0.0.3\r\n\tCommit: 4bdc7fc\r\n\tDockerVersion: 1.5.0\r\n$ docker run -v /var/run/docker.sock:/var/run/docker.sock amazon/amazon-ecs-agent:make -version\r\nAmazon ECS Agent:\r\n\tVersion: 0.0.3\r\n\tCommit: 4bdc7fc\r\n\tDirty: true\r\n\tDockerVersion: 1.5.0\r\n```\r\n\r\nThe metadata outputs on an instance for the release and regular builds are: `\"Version\": \"Amazon ECS Agent - v0.0.3 (4c1f734)\"` and `\"Version\": \"Amazon ECS Agent - v0.0.3 (*4c1f734)\"` respectively (note the * indicating unclean)\r\n\r\n@samuelkarp, @dangrd, thoughts on this approach?"},"comment":{"url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/comments/76836372","html_url":"https://github.com/aws/amazon-ecs-agent/pull/27#issuecomment-76836372","issue_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/27","id":76836372,"user":{"login":"euank","id":2147649,"avatar_url":"https://avatars.githubusercontent.com/u/2147649?v=3","gravatar_id":"","url":"https://api.github.com/users/euank","html_url":"https://github.com/euank","followers_url":"https://api.github.com/users/euank/followers","following_url":"https://api.github.com/users/euank/following{/other_user}","gists_url":"https://api.github.com/users/euank/gists{/gist_id}","starred_url":"https://api.github.com/users/euank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/euank/subscriptions","organizations_url":"https://api.github.com/users/euank/orgs","repos_url":"https://api.github.com/users/euank/repos","events_url":"https://api.github.com/users/euank/events{/privacy}","received_events_url":"https://api.github.com/users/euank/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T22:04:40Z","updated_at":"2015-03-02T22:04:40Z","body":"@samuelkarp good call. I moved it and the String function into a non-generated file. Eventually I do want to inject a 'TaskEngine' where the engine has a versionstring method. Injecting a dockerclient seems like a break of that abstraction."}}