{"action":"created","issue":{"url":"https://api.github.com/repos/jboss-dockerfiles/dogen/issues/116","repository_url":"https://api.github.com/repos/jboss-dockerfiles/dogen","labels_url":"https://api.github.com/repos/jboss-dockerfiles/dogen/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/jboss-dockerfiles/dogen/issues/116/comments","events_url":"https://api.github.com/repos/jboss-dockerfiles/dogen/issues/116/events","html_url":"https://github.com/jboss-dockerfiles/dogen/pull/116","id":225813551,"number":116,"title":"WIP Initial support for parametrization of descriptor files","user":{"login":"goldmann","id":43489,"avatar_url":"https://avatars1.githubusercontent.com/u/43489?v=3","gravatar_id":"","url":"https://api.github.com/users/goldmann","html_url":"https://github.com/goldmann","followers_url":"https://api.github.com/users/goldmann/followers","following_url":"https://api.github.com/users/goldmann/following{/other_user}","gists_url":"https://api.github.com/users/goldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/goldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldmann/subscriptions","organizations_url":"https://api.github.com/users/goldmann/orgs","repos_url":"https://api.github.com/users/goldmann/repos","events_url":"https://api.github.com/users/goldmann/events{/privacy}","received_events_url":"https://api.github.com/users/goldmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-02T20:36:31Z","updated_at":"2017-05-03T06:38:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jboss-dockerfiles/dogen/pulls/116","html_url":"https://github.com/jboss-dockerfiles/dogen/pull/116","diff_url":"https://github.com/jboss-dockerfiles/dogen/pull/116.diff","patch_url":"https://github.com/jboss-dockerfiles/dogen/pull/116.patch"},"body":"Related to #104.\r\n\r\nConsider following descriptor file:\r\n\r\n```\r\nversion: 1.0\r\nrelease: dev\r\nname: jboss/test\r\nfrom: {{FROM:rhel:7.3}}\r\npackages:\r\n    - make\r\nscripts:\r\n    - package: something\r\n      exec: install\r\n```\r\n\r\nIf you execute dogen with this new argument:\r\n\r\n```\r\ndogen -v --param FROM=centos:7 image.yaml target\r\n```\r\n\r\ndogen will generate this Dockerfile:\r\n\r\n```\r\n# Copyright 2017 Red Hat\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n#     http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n#\r\n# ------------------------------------------------------------------------\r\n#\r\n# This is a Dockerfile for the jboss/test:1.0 image.\r\n\r\nFROM centos:7\r\n\r\n# Environment variables\r\nENV JBOSS_IMAGE_NAME=\"jboss/test\" \\\r\n    JBOSS_IMAGE_VERSION=\"1.0\" \\\r\n    JBOSS_IMAGE_RELEASE=\"dev\" \r\n# Labels\r\nLABEL name=\"$JBOSS_IMAGE_NAME\" \\\r\n      version=\"$JBOSS_IMAGE_VERSION\" \\\r\n      release=\"$JBOSS_IMAGE_RELEASE\" \\\r\n      architecture=\"x86_64\" \\\r\n      com.redhat.component=\"jboss-test-docker\"\r\n\r\nUSER root\r\n\r\n\r\n# Install required RPMs and ensure that the packages were installed\r\nRUN yum install -y  make \\\r\n    && yum clean all && \\\r\n    rpm -q  make\r\n\r\n# Add scripts used to configure the image\r\nCOPY scripts /tmp/scripts\r\n\r\n# Custom scripts\r\nUSER \r\nRUN [ \"bash\", \"-x\", \"/tmp/scripts/something/install\" ]\r\n\r\n\r\nUSER root\r\nRUN rm -rf /tmp/scripts\r\n\r\nUSER 0\r\n```\r\n\r\nIf it is run without the `--param` switch it uses default values:\r\n\r\n```\r\n# Copyright 2017 Red Hat\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n#     http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n#\r\n# ------------------------------------------------------------------------\r\n#\r\n# This is a Dockerfile for the jboss/test:1.0 image.\r\n\r\nFROM rhel:7.3\r\n\r\n# Environment variables\r\nENV JBOSS_IMAGE_NAME=\"jboss/test\" \\\r\n    JBOSS_IMAGE_VERSION=\"1.0\" \\\r\n    JBOSS_IMAGE_RELEASE=\"dev\" \r\n# Labels\r\nLABEL name=\"$JBOSS_IMAGE_NAME\" \\\r\n      version=\"$JBOSS_IMAGE_VERSION\" \\\r\n      release=\"$JBOSS_IMAGE_RELEASE\" \\\r\n      architecture=\"x86_64\" \\\r\n      com.redhat.component=\"jboss-test-docker\"\r\n\r\nUSER root\r\n\r\n\r\n# Install required RPMs and ensure that the packages were installed\r\nRUN yum install -y  make \\\r\n    && yum clean all && \\\r\n    rpm -q  make\r\n\r\n# Add scripts used to configure the image\r\nCOPY scripts /tmp/scripts\r\n\r\n# Custom scripts\r\nUSER \r\nRUN [ \"bash\", \"-x\", \"/tmp/scripts/something/install\" ]\r\n\r\n\r\nUSER root\r\nRUN rm -rf /tmp/scripts\r\n\r\nUSER 0\r\n```"},"comment":{"url":"https://api.github.com/repos/jboss-dockerfiles/dogen/issues/comments/298833553","html_url":"https://github.com/jboss-dockerfiles/dogen/pull/116#issuecomment-298833553","issue_url":"https://api.github.com/repos/jboss-dockerfiles/dogen/issues/116","id":298833553,"user":{"login":"l-d-j","id":568838,"avatar_url":"https://avatars3.githubusercontent.com/u/568838?v=3","gravatar_id":"","url":"https://api.github.com/users/l-d-j","html_url":"https://github.com/l-d-j","followers_url":"https://api.github.com/users/l-d-j/followers","following_url":"https://api.github.com/users/l-d-j/following{/other_user}","gists_url":"https://api.github.com/users/l-d-j/gists{/gist_id}","starred_url":"https://api.github.com/users/l-d-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-d-j/subscriptions","organizations_url":"https://api.github.com/users/l-d-j/orgs","repos_url":"https://api.github.com/users/l-d-j/repos","events_url":"https://api.github.com/users/l-d-j/events{/privacy}","received_events_url":"https://api.github.com/users/l-d-j/received_events","type":"User","site_admin":false},"created_at":"2017-05-03T06:38:36Z","updated_at":"2017-05-03T06:38:36Z","body":"This seems weird to me dogen is based on jinja templates - so why second layer of parametrization?\r\nCorrect me if I get it wrong, but to be able to introduce new parameter I need to edit the template (it needs to know there is variable)? \r\nIf I need small changes there are already include mechanisms in jinja2 and project can maintain there complexities in their templates, putting it to upstream dogen seems very weird.  \r\nIf we go with this and we will introduce a new parameter to template we should release a new version of dogen? This will probably generate more work than it saves.\r\n"}}
{"actor":{"display_login":"l-d-j"}}