{"action":"created","comment":{"url":"https://api.github.com/repos/iocage/libiocage/pulls/comments/204257853","pull_request_review_id":139304169,"id":204257853,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDI1Nzg1Mw==","diff_hunk":"@@ -0,0 +1,194 @@\n+# Copyright (c) 2014-2018, iocage\n+# All rights reserved.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted providing that the following conditions\n+# are met:\n+# 1. Redistributions of source code must retain the above copyright\n+#    notice, this list of conditions and the following disclaimer.\n+# 2. Redistributions in binary form must reproduce the above copyright\n+#    notice, this list of conditions and the following disclaimer in the\n+#    documentation and/or other materials provided with the distribution.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n+# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\n+# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+# POSSIBILITY OF SUCH DAMAGE.\n+\"\"\"iocage provisioner for ix-plugins.\"\"\"\n+import typing\n+import os.path\n+import json\n+import urllib.error\n+import urllib.request\n+import libzfs\n+\n+import git","path":"iocage/lib/Provisioning/ix.py","position":32,"original_position":32,"commit_id":"aab1ede7d2e1d2d29855109a9b63c7d8e7bfd463","original_commit_id":"c82a31b95db7bc63a19ea968111fb8677d11d5f7","user":{"login":"gronke","id":473924,"node_id":"MDQ6VXNlcjQ3MzkyNA==","avatar_url":"https://avatars3.githubusercontent.com/u/473924?v=4","gravatar_id":"","url":"https://api.github.com/users/gronke","html_url":"https://github.com/gronke","followers_url":"https://api.github.com/users/gronke/followers","following_url":"https://api.github.com/users/gronke/following{/other_user}","gists_url":"https://api.github.com/users/gronke/gists{/gist_id}","starred_url":"https://api.github.com/users/gronke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gronke/subscriptions","organizations_url":"https://api.github.com/users/gronke/orgs","repos_url":"https://api.github.com/users/gronke/repos","events_url":"https://api.github.com/users/gronke/events{/privacy}","received_events_url":"https://api.github.com/users/gronke/received_events","type":"User","site_admin":false},"body":"In theory an ix-iocage-plugin repository may not only contain the post_install.sh file but also assets that it ships with. Using gitpython seems the most convenient way to achieve this.","created_at":"2018-07-22T22:49:29Z","updated_at":"2018-07-22T22:49:29Z","html_url":"https://github.com/iocage/libiocage/pull/426#discussion_r204257853","pull_request_url":"https://api.github.com/repos/iocage/libiocage/pulls/426","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/iocage/libiocage/pulls/comments/204257853"},"html":{"href":"https://github.com/iocage/libiocage/pull/426#discussion_r204257853"},"pull_request":{"href":"https://api.github.com/repos/iocage/libiocage/pulls/426"}},"in_reply_to_id":204253202},"pull_request":{"url":"https://api.github.com/repos/iocage/libiocage/pulls/426","id":199896415,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5ODk2NDE1","html_url":"https://github.com/iocage/libiocage/pull/426","diff_url":"https://github.com/iocage/libiocage/pull/426.diff","patch_url":"https://github.com/iocage/libiocage/pull/426.patch","issue_url":"https://api.github.com/repos/iocage/libiocage/issues/426","number":426,"state":"open","locked":false,"title":"Feature: Provisioning (ix-iocage-plugin)","user":{"login":"gronke","id":473924,"node_id":"MDQ6VXNlcjQ3MzkyNA==","avatar_url":"https://avatars3.githubusercontent.com/u/473924?v=4","gravatar_id":"","url":"https://api.github.com/users/gronke","html_url":"https://github.com/gronke","followers_url":"https://api.github.com/users/gronke/followers","following_url":"https://api.github.com/users/gronke/following{/other_user}","gists_url":"https://api.github.com/users/gronke/gists{/gist_id}","starred_url":"https://api.github.com/users/gronke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gronke/subscriptions","organizations_url":"https://api.github.com/users/gronke/orgs","repos_url":"https://api.github.com/users/gronke/repos","events_url":"https://api.github.com/users/gronke/events{/privacy}","received_events_url":"https://api.github.com/users/gronke/received_events","type":"User","site_admin":false},"body":"closes #1 \r\n\r\n- introduces nested jail config properties\r\n- embeds provisioning methods:\r\n  - `ix` for ix-iocage-plugins\r\n  -  ~~`ansible` as runner for ansible playbooks stored in a remote git repository~~ will be implemented in another PR\r\n\r\n### ix-iocage-plugin install stages\r\n\r\nWhen a jail is configured with `provisioning.method=ix`, the following will happen when running the provisioning command with `provisioning.source=jenkins`:\r\n\r\n1. Download https://github.com/freenas/iocage-ix-plugins/blob/master/jenkins.json\r\n2. Read `artifacts` from jenkins.json\r\n3. Clone artifacts repo URL to a child dataset of the jail\r\n4. Start jail with artifacts mounted\r\n5. Install list of `pkgs` in jenkinsk.json within the jail\r\n6. Run `post_install.sh` from the artifacts folder if it exists\r\n\r\n### CLI Syntax\r\n\r\n```sh\r\nioc create plextemplate \\\r\n    provisioning.method=ix \\\r\n    provisioning.source=plexmediaserver \\\r\n    template=yes\r\n\r\n# run provisioner\r\nioc provision plextemplate\r\n\r\n# create jail from the provisioned template\r\nioc create -t plextemplate plexjail\r\n\r\n# configure network and run plexjail\r\n# ...\r\n```\r\n\r\n**Update**: Providing a temporary network connecting is no longer required. The ix-iocage-plugin now installs packages via [iocage.lib.Pkg](https://github.com/iocage/libiocage/blob/master/iocage/lib/Pkg.py) which does not require internet connections within a jail. \r\n","created_at":"2018-07-07T13:10:33Z","updated_at":"2018-07-22T22:49:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7dcea12115ff28120c3e236f03abe884d5e9c6a1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":675567414,"node_id":"MDU6TGFiZWw2NzU1Njc0MTQ=","url":"https://api.github.com/repos/iocage/libiocage/labels/new%20feature","name":"new feature","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/iocage/libiocage/pulls/426/commits","review_comments_url":"https://api.github.com/repos/iocage/libiocage/pulls/426/comments","review_comment_url":"https://api.github.com/repos/iocage/libiocage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iocage/libiocage/issues/426/comments","statuses_url":"https://api.github.com/repos/iocage/libiocage/statuses/aab1ede7d2e1d2d29855109a9b63c7d8e7bfd463","head":{"label":"iocage:feature/provisioning","ref":"feature/provisioning","sha":"aab1ede7d2e1d2d29855109a9b63c7d8e7bfd463","user":{"login":"iocage","id":11825280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODI1Mjgw","avatar_url":"https://avatars1.githubusercontent.com/u/11825280?v=4","gravatar_id":"","url":"https://api.github.com/users/iocage","html_url":"https://github.com/iocage","followers_url":"https://api.github.com/users/iocage/followers","following_url":"https://api.github.com/users/iocage/following{/other_user}","gists_url":"https://api.github.com/users/iocage/gists{/gist_id}","starred_url":"https://api.github.com/users/iocage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iocage/subscriptions","organizations_url":"https://api.github.com/users/iocage/orgs","repos_url":"https://api.github.com/users/iocage/repos","events_url":"https://api.github.com/users/iocage/events{/privacy}","received_events_url":"https://api.github.com/users/iocage/received_events","type":"Organization","site_admin":false},"repo":{"id":100014477,"node_id":"MDEwOlJlcG9zaXRvcnkxMDAwMTQ0Nzc=","name":"libiocage","full_name":"iocage/libiocage","owner":{"login":"iocage","id":11825280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODI1Mjgw","avatar_url":"https://avatars1.githubusercontent.com/u/11825280?v=4","gravatar_id":"","url":"https://api.github.com/users/iocage","html_url":"https://github.com/iocage","followers_url":"https://api.github.com/users/iocage/followers","following_url":"https://api.github.com/users/iocage/following{/other_user}","gists_url":"https://api.github.com/users/iocage/gists{/gist_id}","starred_url":"https://api.github.com/users/iocage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iocage/subscriptions","organizations_url":"https://api.github.com/users/iocage/orgs","repos_url":"https://api.github.com/users/iocage/repos","events_url":"https://api.github.com/users/iocage/events{/privacy}","received_events_url":"https://api.github.com/users/iocage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iocage/libiocage","description":"A Python library to manage jails with iocage","fork":false,"url":"https://api.github.com/repos/iocage/libiocage","forks_url":"https://api.github.com/repos/iocage/libiocage/forks","keys_url":"https://api.github.com/repos/iocage/libiocage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iocage/libiocage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iocage/libiocage/teams","hooks_url":"https://api.github.com/repos/iocage/libiocage/hooks","issue_events_url":"https://api.github.com/repos/iocage/libiocage/issues/events{/number}","events_url":"https://api.github.com/repos/iocage/libiocage/events","assignees_url":"https://api.github.com/repos/iocage/libiocage/assignees{/user}","branches_url":"https://api.github.com/repos/iocage/libiocage/branches{/branch}","tags_url":"https://api.github.com/repos/iocage/libiocage/tags","blobs_url":"https://api.github.com/repos/iocage/libiocage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iocage/libiocage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iocage/libiocage/git/refs{/sha}","trees_url":"https://api.github.com/repos/iocage/libiocage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iocage/libiocage/statuses/{sha}","languages_url":"https://api.github.com/repos/iocage/libiocage/languages","stargazers_url":"https://api.github.com/repos/iocage/libiocage/stargazers","contributors_url":"https://api.github.com/repos/iocage/libiocage/contributors","subscribers_url":"https://api.github.com/repos/iocage/libiocage/subscribers","subscription_url":"https://api.github.com/repos/iocage/libiocage/subscription","commits_url":"https://api.github.com/repos/iocage/libiocage/commits{/sha}","git_commits_url":"https://api.github.com/repos/iocage/libiocage/git/commits{/sha}","comments_url":"https://api.github.com/repos/iocage/libiocage/comments{/number}","issue_comment_url":"https://api.github.com/repos/iocage/libiocage/issues/comments{/number}","contents_url":"https://api.github.com/repos/iocage/libiocage/contents/{+path}","compare_url":"https://api.github.com/repos/iocage/libiocage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iocage/libiocage/merges","archive_url":"https://api.github.com/repos/iocage/libiocage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iocage/libiocage/downloads","issues_url":"https://api.github.com/repos/iocage/libiocage/issues{/number}","pulls_url":"https://api.github.com/repos/iocage/libiocage/pulls{/number}","milestones_url":"https://api.github.com/repos/iocage/libiocage/milestones{/number}","notifications_url":"https://api.github.com/repos/iocage/libiocage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iocage/libiocage/labels{/name}","releases_url":"https://api.github.com/repos/iocage/libiocage/releases{/id}","deployments_url":"https://api.github.com/repos/iocage/libiocage/deployments","created_at":"2017-08-11T09:15:22Z","updated_at":"2018-07-22T16:41:54Z","pushed_at":"2018-07-22T22:45:34Z","git_url":"git://github.com/iocage/libiocage.git","ssh_url":"git@github.com:iocage/libiocage.git","clone_url":"https://github.com/iocage/libiocage.git","svn_url":"https://github.com/iocage/libiocage","homepage":"","size":1426,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":8,"open_issues":43,"watchers":22,"default_branch":"master"}},"base":{"label":"iocage:master","ref":"master","sha":"5da613507271fe7c61035d9a0bd06704c9b8a9df","user":{"login":"iocage","id":11825280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODI1Mjgw","avatar_url":"https://avatars1.githubusercontent.com/u/11825280?v=4","gravatar_id":"","url":"https://api.github.com/users/iocage","html_url":"https://github.com/iocage","followers_url":"https://api.github.com/users/iocage/followers","following_url":"https://api.github.com/users/iocage/following{/other_user}","gists_url":"https://api.github.com/users/iocage/gists{/gist_id}","starred_url":"https://api.github.com/users/iocage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iocage/subscriptions","organizations_url":"https://api.github.com/users/iocage/orgs","repos_url":"https://api.github.com/users/iocage/repos","events_url":"https://api.github.com/users/iocage/events{/privacy}","received_events_url":"https://api.github.com/users/iocage/received_events","type":"Organization","site_admin":false},"repo":{"id":100014477,"node_id":"MDEwOlJlcG9zaXRvcnkxMDAwMTQ0Nzc=","name":"libiocage","full_name":"iocage/libiocage","owner":{"login":"iocage","id":11825280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODI1Mjgw","avatar_url":"https://avatars1.githubusercontent.com/u/11825280?v=4","gravatar_id":"","url":"https://api.github.com/users/iocage","html_url":"https://github.com/iocage","followers_url":"https://api.github.com/users/iocage/followers","following_url":"https://api.github.com/users/iocage/following{/other_user}","gists_url":"https://api.github.com/users/iocage/gists{/gist_id}","starred_url":"https://api.github.com/users/iocage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iocage/subscriptions","organizations_url":"https://api.github.com/users/iocage/orgs","repos_url":"https://api.github.com/users/iocage/repos","events_url":"https://api.github.com/users/iocage/events{/privacy}","received_events_url":"https://api.github.com/users/iocage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iocage/libiocage","description":"A Python library to manage jails with iocage","fork":false,"url":"https://api.github.com/repos/iocage/libiocage","forks_url":"https://api.github.com/repos/iocage/libiocage/forks","keys_url":"https://api.github.com/repos/iocage/libiocage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iocage/libiocage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iocage/libiocage/teams","hooks_url":"https://api.github.com/repos/iocage/libiocage/hooks","issue_events_url":"https://api.github.com/repos/iocage/libiocage/issues/events{/number}","events_url":"https://api.github.com/repos/iocage/libiocage/events","assignees_url":"https://api.github.com/repos/iocage/libiocage/assignees{/user}","branches_url":"https://api.github.com/repos/iocage/libiocage/branches{/branch}","tags_url":"https://api.github.com/repos/iocage/libiocage/tags","blobs_url":"https://api.github.com/repos/iocage/libiocage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iocage/libiocage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iocage/libiocage/git/refs{/sha}","trees_url":"https://api.github.com/repos/iocage/libiocage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iocage/libiocage/statuses/{sha}","languages_url":"https://api.github.com/repos/iocage/libiocage/languages","stargazers_url":"https://api.github.com/repos/iocage/libiocage/stargazers","contributors_url":"https://api.github.com/repos/iocage/libiocage/contributors","subscribers_url":"https://api.github.com/repos/iocage/libiocage/subscribers","subscription_url":"https://api.github.com/repos/iocage/libiocage/subscription","commits_url":"https://api.github.com/repos/iocage/libiocage/commits{/sha}","git_commits_url":"https://api.github.com/repos/iocage/libiocage/git/commits{/sha}","comments_url":"https://api.github.com/repos/iocage/libiocage/comments{/number}","issue_comment_url":"https://api.github.com/repos/iocage/libiocage/issues/comments{/number}","contents_url":"https://api.github.com/repos/iocage/libiocage/contents/{+path}","compare_url":"https://api.github.com/repos/iocage/libiocage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iocage/libiocage/merges","archive_url":"https://api.github.com/repos/iocage/libiocage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iocage/libiocage/downloads","issues_url":"https://api.github.com/repos/iocage/libiocage/issues{/number}","pulls_url":"https://api.github.com/repos/iocage/libiocage/pulls{/number}","milestones_url":"https://api.github.com/repos/iocage/libiocage/milestones{/number}","notifications_url":"https://api.github.com/repos/iocage/libiocage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iocage/libiocage/labels{/name}","releases_url":"https://api.github.com/repos/iocage/libiocage/releases{/id}","deployments_url":"https://api.github.com/repos/iocage/libiocage/deployments","created_at":"2017-08-11T09:15:22Z","updated_at":"2018-07-22T16:41:54Z","pushed_at":"2018-07-22T22:45:34Z","git_url":"git://github.com/iocage/libiocage.git","ssh_url":"git@github.com:iocage/libiocage.git","clone_url":"https://github.com/iocage/libiocage.git","svn_url":"https://github.com/iocage/libiocage","homepage":"","size":1426,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":8,"open_issues":43,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iocage/libiocage/pulls/426"},"html":{"href":"https://github.com/iocage/libiocage/pull/426"},"issue":{"href":"https://api.github.com/repos/iocage/libiocage/issues/426"},"comments":{"href":"https://api.github.com/repos/iocage/libiocage/issues/426/comments"},"review_comments":{"href":"https://api.github.com/repos/iocage/libiocage/pulls/426/comments"},"review_comment":{"href":"https://api.github.com/repos/iocage/libiocage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iocage/libiocage/pulls/426/commits"},"statuses":{"href":"https://api.github.com/repos/iocage/libiocage/statuses/aab1ede7d2e1d2d29855109a9b63c7d8e7bfd463"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"gronke"}}