{"action":"created","issue":{"url":"https://api.github.com/repos/openfaas/faas-cli/issues/561","repository_url":"https://api.github.com/repos/openfaas/faas-cli","labels_url":"https://api.github.com/repos/openfaas/faas-cli/issues/561/labels{/name}","comments_url":"https://api.github.com/repos/openfaas/faas-cli/issues/561/comments","events_url":"https://api.github.com/repos/openfaas/faas-cli/issues/561/events","html_url":"https://github.com/openfaas/faas-cli/pull/561","id":382732325,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMzcxMDM5","number":561,"title":"Add template store command","user":{"login":"martindekov","id":34942004,"node_id":"MDQ6VXNlcjM0OTQyMDA0","avatar_url":"https://avatars1.githubusercontent.com/u/34942004?v=4","gravatar_id":"","url":"https://api.github.com/users/martindekov","html_url":"https://github.com/martindekov","followers_url":"https://api.github.com/users/martindekov/followers","following_url":"https://api.github.com/users/martindekov/following{/other_user}","gists_url":"https://api.github.com/users/martindekov/gists{/gist_id}","starred_url":"https://api.github.com/users/martindekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindekov/subscriptions","organizations_url":"https://api.github.com/users/martindekov/orgs","repos_url":"https://api.github.com/users/martindekov/repos","events_url":"https://api.github.com/users/martindekov/events{/privacy}","received_events_url":"https://api.github.com/users/martindekov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-11-20T16:01:42Z","updated_at":"2018-11-26T16:48:52Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/openfaas/faas-cli/pulls/561","html_url":"https://github.com/openfaas/faas-cli/pull/561","diff_url":"https://github.com/openfaas/faas-cli/pull/561.diff","patch_url":"https://github.com/openfaas/faas-cli/pull/561.patch"},"body":"Moving template command as own command which has store and\r\npull commands as subcommands. Also adding store list and\r\nstore pull commands to list and pull from store\r\n\r\nSigned-off-by: Martin Dekov (VMware) <mdekov@vmware.com>\r\n\r\n<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\nAlso opened Issue in store which slaps the keys: [43](https://github.com/openfaas/store/pull/44)\r\n\r\nThis PR separates `template pull` command into separate commands and adding additional `template store list` and `template store pull` for interactions with the official templates store.\r\n\r\nThe commands are structured the following way:\r\n\r\n* `template`\r\n\r\n    * `pull`\r\n\r\n    * `store`\r\n\r\n        * `list`\r\n        \r\n        * `pull`\r\n\r\nAnd are used as before, there are the ways you can use every command now:\r\n\r\n`faas-cli template pull <URL OF REPOSITORY>`' <- (default)\r\n`faas-cli template pull <URL OF REPOSITORY> --overwrite`\r\n`faas-cli template pull <URL OF REPOSITORY> --debug`\r\n`faas-cli template store list`\r\n`faas-cli template store ls`\r\n`faas-cli template store list --verbose`\r\n`faas-cli template store list --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json`\r\nThe fields inside `<>` aka `<NAME>` is the content below the fields seen through the command above aka.\r\n```\r\nfaas-cli template store list\r\n\r\nNAME      SOURCE      DESCRIPTION\r\n...       ...         ...\r\n```\r\n\r\n`faas-cli template store pull <NAME>||<SOURCE/NAME> ...` <- (default)\r\n`faas-cli template store pull <NAME>||<SOURCE/NAME> ... --overwrite`\r\n`faas-cli template store pull <NAME>||<SOURCE/NAME> ... --debug`\r\n`faas-cli template store pull <NAME>||<SOURCE/NAME> ... --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json`\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n- [x] I have raised an issue to propose this change ([required](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md))\r\n\r\nCloses https://github.com/openfaas/faas-cli/issues/559\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your changes. -->\r\n<!--- Include details of your testing environment, and the tests you ran to -->\r\n<!--- see how your change affects other areas of the code, etc. -->\r\n\r\nManual tests:\r\n\r\n`faas-cli template store ls`\r\n```\r\n> ./faas-cli template store ls\r\n\r\nNAME                    SOURCE             DESCRIPTION\r\ncsharp                  openfaas           Official C# template\r\n...\r\nnode10-express-armhf    openfaas-incubator NodeJS 10 Express armhf template\r\n...\r\n```\r\n\r\n`faas-cli template store ls -v`\r\n```\r\n> ./faas-cli template store ls -v\r\n\r\nNAME                    LANGUAGE   PLATFORM SOURCE             DESCRIPTION\r\ncsharp                  C#         x86_64   openfaas           Official C# template\r\n...\r\nnode10-express-armhf    NodeJS     armhf    openfaas-incubator NodeJS 10 Express armhf template\r\n...\r\n```\r\n\r\n`faas-cli template store pull csharp golang-http python3-debian`\r\n```\r\n> ./faas-cli template store pull csharp golang-http python3-debian\r\nFetch templates from repository: https://github.com/openfaas/templates\r\n2018/11/26 01:47:35 Attempting to expand templates from https://github.com/openfaas/templates\r\n2018/11/26 01:47:37 Fetched 14 template(s) : [csharp dockerfile go go-armhf java8 node node-arm64 node-armhf php7 python python-armhf python3 python3-armhf ruby] from https://github.com/openfaas/templates\r\nFetch templates from repository: https://github.com/openfaas-incubator/golang-http-template\r\n2018/11/26 01:47:37 Attempting to expand templates from https://github.com/openfaas-incubator/golang-http-template\r\n2018/11/26 01:47:38 Fetched 4 template(s) : [golang-http golang-http-armhf golang-middleware golang-middleware-armhf] from https://github.com/openfaas-incubator/golang-http-template\r\nFetch templates from repository: https://github.com/openfaas-incubator/python3-debian\r\n2018/11/26 01:47:38 Attempting to expand templates from https://github.com/openfaas-incubator/python3-debian\r\n2018/11/26 01:47:40 Fetched 1 template(s) : [python3-debian] from https://github.com/openfaas-incubator/python3-debian\r\n```\r\n`faas-cli template store pull csharp what golang-http template python3-debian --overwrite`\r\n```\r\n> ./faas-cli template store pull csharp what golang-http template python3-debian --overwrite\r\nFetch templates from repository: https://github.com/openfaas/templates\r\n2018/11/26 01:48:19 Attempting to expand templates from https://github.com/openfaas/templates\r\n2018/11/26 01:48:20 Fetched 14 template(s) : [csharp dockerfile go go-armhf java8 node node-arm64 node-armhf php7 python python-armhf python3 python3-armhf ruby] from https://github.com/openfaas/templates\r\nFetch templates from repository: https://github.com/openfaas-incubator/golang-http-template\r\n2018/11/26 01:48:20 Attempting to expand templates from https://github.com/openfaas-incubator/golang-http-template\r\n2018/11/26 01:48:22 Fetched 4 template(s) : [golang-http golang-http-armhf golang-middleware golang-middleware-armhf] from https://github.com/openfaas-incubator/golang-http-template\r\nFetch templates from repository: https://github.com/openfaas-incubator/python3-debian\r\n2018/11/26 01:48:22 Attempting to expand templates from https://github.com/openfaas-incubator/python3-debian\r\n2018/11/26 01:48:23 Fetched 1 template(s) : [python3-debian] from https://github.com/openfaas-incubator/python3-debian\r\n\r\nThere is no template with name: `what` in the store.\r\n\r\nThere is no template with name: `template` in the store.\r\n\r\ncheck available options by running:\r\n\r\nfaas-cli template store pull <NAME>|<SOURCE/NAME>\r\n\r\n```\r\n`faas-cli template store pull `\r\n```\r\n> ./faas-cli template store pull \r\n\r\nNeed to specify one of the store templates check available ones by running the command:\r\n\r\nfaas-cli template store list\r\n\r\n```\r\n`faas-cli template store pull go --url=asd`\r\n```\r\n> ./faas-cli template store pull go --url=asd\r\nError while fetching templates from store: error while requesting template list: Get asd: unsupported protocol scheme \"\"\r\n```\r\n`faas-cli template store list go --url=asd`\r\n```\r\n> ./faas-cli template store list go --url=asd\r\nError while getting templates info: error while requesting template list: Get asd: unsupported protocol scheme \"\"\r\n```\r\n`faas-cli template store pull golang-http python3-debian --debug`\r\n```\r\n> ./faas-cli template store pull golang-http python3-debian --debug\r\nFetch templates from repository: https://github.com/openfaas-incubator/golang-http-template\r\n2018/11/26 01:58:01 Attempting to expand templates from https://github.com/openfaas-incubator/golang-http-template\r\nTemp files in /tmp/openFaasTemplates879867391\r\n2018/11/26 01:58:04 Cannot overwrite the following 4 template(s): [golang-http golang-http-armhf golang-middleware golang-middleware-armhf]\r\n2018/11/26 01:58:04 Fetched 0 template(s) : [] from https://github.com/openfaas-incubator/golang-http-template\r\nFetch templates from repository: https://github.com/openfaas-incubator/python3-debian\r\n2018/11/26 01:58:04 Attempting to expand templates from https://github.com/openfaas-incubator/python3-debian\r\nTemp files in /tmp/openFaasTemplates578810194\r\n2018/11/26 01:58:06 Cannot overwrite the following 1 template(s): [python3-debian]\r\n2018/11/26 01:58:06 Fetched 0 template(s) : [] from https://github.com/openfaas-incubator/python3-debian\r\n```\r\n`faas-cli template store list --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json`\r\n```\r\n> ./faas-cli template store list --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json\r\n\r\nNAME                    SOURCE             DESCRIPTION\r\ncsharp                  openfaas           Official C# template\r\n...\r\nnode10-express-armhf    openfaas-incubator NodeJS 10 Express armhf template\r\n...\r\n```\r\n\r\n`faas-cli template store list --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json -v`\r\n\r\n```\r\n> ./faas-cli template store list --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json -v\r\n\r\nNAME                    LANGUAGE   PLATFORM SOURCE             DESCRIPTION\r\ncsharp                  C#         x86_64   openfaas           Official C# template\r\n...\r\nnode10-express-armhf    NodeJS     armhf    openfaas-incubator NodeJS 10 Express armhf template\r\n...\r\n```\r\n\r\n`faas-cli template store pull csharp ruby-http python27-flask --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json --overwrite`\r\n\r\n```\r\n> ./faas-cli template store pull csharp ruby-http python27-flask --url https://raw.githubusercontent.com/martindekov/store/martindekov/unofficial_templates_json/templates.json --overwrite\r\nFetch templates from repository: https://github.com/openfaas/templates\r\n2018/11/26 02:04:28 Attempting to expand templates from https://github.com/openfaas/templates\r\n2018/11/26 02:04:30 Fetched 14 template(s) : [csharp dockerfile go go-armhf java8 node node-arm64 node-armhf php7 python python-armhf python3 python3-armhf ruby] from https://github.com/openfaas/templates\r\nFetch templates from repository: https://github.com/openfaas-incubator/ruby-http\r\n2018/11/26 02:04:30 Attempting to expand templates from https://github.com/openfaas-incubator/ruby-http\r\n2018/11/26 02:04:31 Fetched 1 template(s) : [ruby-http] from https://github.com/openfaas-incubator/ruby-http\r\nFetch templates from repository: https://github.com/openfaas-incubator/python-flask-template\r\n2018/11/26 02:04:31 Attempting to expand templates from https://github.com/openfaas-incubator/python-flask-template\r\n2018/11/26 02:04:33 Fetched 3 template(s) : [python27-flask python3-flask python3-flask-armhf] from https://github.com/openfaas-incubator/python-flask-template\r\n```\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project.\r\n- [x] My change requires a change to the documentation.\r\n- [x] I have updated the documentation accordingly.\r\n- [x] I've read the [CONTRIBUTION](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md) guide\r\n- [x] I have signed-off my commits with `git commit -s`\r\n- [ ] I have added tests to cover my changes.\r\n- [x] All new and existing tests passed.\r\n"},"comment":{"url":"https://api.github.com/repos/openfaas/faas-cli/issues/comments/441711342","html_url":"https://github.com/openfaas/faas-cli/pull/561#issuecomment-441711342","issue_url":"https://api.github.com/repos/openfaas/faas-cli/issues/561","id":441711342,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTcxMTM0Mg==","user":{"login":"martindekov","id":34942004,"node_id":"MDQ6VXNlcjM0OTQyMDA0","avatar_url":"https://avatars1.githubusercontent.com/u/34942004?v=4","gravatar_id":"","url":"https://api.github.com/users/martindekov","html_url":"https://github.com/martindekov","followers_url":"https://api.github.com/users/martindekov/followers","following_url":"https://api.github.com/users/martindekov/following{/other_user}","gists_url":"https://api.github.com/users/martindekov/gists{/gist_id}","starred_url":"https://api.github.com/users/martindekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindekov/subscriptions","organizations_url":"https://api.github.com/users/martindekov/orgs","repos_url":"https://api.github.com/users/martindekov/repos","events_url":"https://api.github.com/users/martindekov/events{/privacy}","received_events_url":"https://api.github.com/users/martindekov/received_events","type":"User","site_admin":false},"created_at":"2018-11-26T16:48:52Z","updated_at":"2018-11-26T16:48:52Z","author_association":"MEMBER","body":"Amended the change `cli-lang` -> `template`"}}
{"actor":{"display_login":"martindekov"}}