{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-builders/issues/12","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-builders","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-builders/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-builders/issues/12/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-builders/issues/12/events","html_url":"https://github.com/GoogleCloudPlatform/cloud-builders/issues/12","id":213880702,"number":12,"title":"variable substitution with unexpected tokenizations","user":{"login":"skippy","id":3746,"avatar_url":"https://avatars1.githubusercontent.com/u/3746?v=3","gravatar_id":"","url":"https://api.github.com/users/skippy","html_url":"https://github.com/skippy","followers_url":"https://api.github.com/users/skippy/followers","following_url":"https://api.github.com/users/skippy/following{/other_user}","gists_url":"https://api.github.com/users/skippy/gists{/gist_id}","starred_url":"https://api.github.com/users/skippy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skippy/subscriptions","organizations_url":"https://api.github.com/users/skippy/orgs","repos_url":"https://api.github.com/users/skippy/repos","events_url":"https://api.github.com/users/skippy/events{/privacy}","received_events_url":"https://api.github.com/users/skippy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-13T20:01:05Z","updated_at":"2017-03-14T00:13:34Z","closed_at":null,"body":"hey folks,\r\n\r\nif I use the following step in my `cloudbuilder.yaml`, where I use '_' as the delimiter, the behavior is unexpected (and I would argue, incorrect)\r\n\r\n### unexpected behavior\r\n\r\n```yaml\r\n- name: 'gcr.io/cloud-builders/docker'\r\n  dir: 'app'\r\n  args: ['build', '-t', 'gcr.io/$PROJECT_ID/app.web:$BRANCH_NAME_$COMMIT_SHA', '-t', 'gcr.io/$PROJECT_ID/app.web:$BRANCH_NAME_latest', '.']\r\n  id:   'build'\r\n```\r\nwhen the build is triggered, it runs the following command (as shown by the CLI and gui under build details): \r\n```\r\nbuild -t gcr.io/my-project/app.web:598ccb22d52633474fa92a4290b627634749472e -t gcr.io/my-project/app.web:latest .\r\n```\r\nNotice how the `$BRANCH_NAME` does not exist, nor the `_` delimiter?\r\n\r\n### correct behavior\r\nif I use a `-` instead of an `_` as a delimiter, I get the expected behavior:\r\n```yaml\r\n- name: 'gcr.io/cloud-builders/docker'\r\n  dir: 'app'\r\n  args: ['build', '-t', 'gcr.io/$PROJECT_ID/app.web:$BRANCH_NAME_$COMMIT_SHA', '-t', 'gcr.io/$PROJECT_ID/app.web:$BRANCH_NAME_latest', '.']\r\n  id:   'build'\r\n```\r\ntriggers the following build, correctly: \r\n```\r\nbuild -t gcr.io/my-project/app.test-branch-ef5776bd22bd72d6599a7f9ece6e78523c597553 -t gcr.io/my-project/app.web:test-branch-latest .\r\n```\r\n\r\n### Summary\r\nTokenization of variables seems to be too greedy.  The expected behavior is it should only substitute the token, not anything else.  \r\n\r\nlet me know if you want additional information"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-builders/issues/comments/286283099","html_url":"https://github.com/GoogleCloudPlatform/cloud-builders/issues/12#issuecomment-286283099","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-builders/issues/12","id":286283099,"user":{"login":"skippy","id":3746,"avatar_url":"https://avatars1.githubusercontent.com/u/3746?v=3","gravatar_id":"","url":"https://api.github.com/users/skippy","html_url":"https://github.com/skippy","followers_url":"https://api.github.com/users/skippy/followers","following_url":"https://api.github.com/users/skippy/following{/other_user}","gists_url":"https://api.github.com/users/skippy/gists{/gist_id}","starred_url":"https://api.github.com/users/skippy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skippy/subscriptions","organizations_url":"https://api.github.com/users/skippy/orgs","repos_url":"https://api.github.com/users/skippy/repos","events_url":"https://api.github.com/users/skippy/events{/privacy}","received_events_url":"https://api.github.com/users/skippy/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T00:13:34Z","updated_at":"2017-03-14T00:13:34Z","body":"hey @Philmod \r\n\r\nthat works as expected!"}}
{"actor":{"display_login":"skippy"}}