{"action":"created","comment":{"url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/comments/58375850","id":58375850,"diff_hunk":"@@ -0,0 +1,43 @@\n+#!/bin/sh\n+#\n+# An example hook script to update the working tree, including its\n+# submodules, after receiving a push.\n+#\n+# This hook requires core.worktree to be explicitly set, and\n+# receive.denyCurrentBranch to be set to false.\n+#   git config --path core.worktree ../\n+#   git config --bool receive.denyCurrentBranch false\n+#\n+# To enable this hook, rename this file to \"post-receive\"\n+# and run `chmod +x post-receive`.\n+\n+# Read standard input or hook will fail\n+while read oldrev newrev refname\n+do\n+:\n+done\n+\n+# Unset GIT_DIR or the universe will implode\n+unset GIT_DIR\n+\n+# Set appropriate configuration to allow this to work\n+git config --path core.worktree ../\n+git config --bool receive.denyCurrentBranch false\n+\n+# Change directory to the working tree; exit on failure\n+cd `git config --get core.worktree` || exit\n+\n+# Force checkout\n+git checkout --force\n+\n+# Force update submodules\n+git submodule update --init --recursive --force\n+\n+# Install the latest version of circulation-web\n+if [ -d api/admin ]; then\n+  cd api/admin\n+  npm install","path":"base/post-receive.sample","position":39,"original_position":39,"commit_id":"ce4ffd19a88bb11a8fa6f4e793916845db6ee613","original_commit_id":"ce4ffd19a88bb11a8fa6f4e793916845db6ee613","user":{"login":"aslagle","id":3409215,"avatar_url":"https://avatars.githubusercontent.com/u/3409215?v=3","gravatar_id":"","url":"https://api.github.com/users/aslagle","html_url":"https://github.com/aslagle","followers_url":"https://api.github.com/users/aslagle/followers","following_url":"https://api.github.com/users/aslagle/following{/other_user}","gists_url":"https://api.github.com/users/aslagle/gists{/gist_id}","starred_url":"https://api.github.com/users/aslagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aslagle/subscriptions","organizations_url":"https://api.github.com/users/aslagle/orgs","repos_url":"https://api.github.com/users/aslagle/repos","events_url":"https://api.github.com/users/aslagle/events{/privacy}","received_events_url":"https://api.github.com/users/aslagle/received_events","type":"User","site_admin":false},"body":"This isn't good for production, it will install all the npm dependencies as well as the one built js file we actually need.\r\n\r\nIs it common to use git for deployment this way? It works well for python since you can deploy the source code as is, but I guess I was thinking we'd build a docker container with the python code and bundled js already in it.","created_at":"2016-04-04T13:36:28Z","updated_at":"2016-04-04T13:36:28Z","html_url":"https://github.com/NYPL-Simplified/circulation-docker/pull/4#discussion_r58375850","pull_request_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/comments/58375850"},"html":{"href":"https://github.com/NYPL-Simplified/circulation-docker/pull/4#discussion_r58375850"},"pull_request":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4","id":65009323,"html_url":"https://github.com/NYPL-Simplified/circulation-docker/pull/4","diff_url":"https://github.com/NYPL-Simplified/circulation-docker/pull/4.diff","patch_url":"https://github.com/NYPL-Simplified/circulation-docker/pull/4.patch","issue_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/4","number":4,"state":"open","locked":false,"title":"Create multiple dockerfiles, including scripts!","user":{"login":"courte","id":2766324,"avatar_url":"https://avatars.githubusercontent.com/u/2766324?v=3","gravatar_id":"","url":"https://api.github.com/users/courte","html_url":"https://github.com/courte","followers_url":"https://api.github.com/users/courte/followers","following_url":"https://api.github.com/users/courte/following{/other_user}","gists_url":"https://api.github.com/users/courte/gists{/gist_id}","starred_url":"https://api.github.com/users/courte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/courte/subscriptions","organizations_url":"https://api.github.com/users/courte/orgs","repos_url":"https://api.github.com/users/courte/repos","events_url":"https://api.github.com/users/courte/events{/privacy}","received_events_url":"https://api.github.com/users/courte/received_events","type":"User","site_admin":false},"body":"Because we wanted to use Docker for both deployment and running scripts, I split the existing Dockerfile into three different images.\r\n\r\nThe first, `base`, sets the groundwork for any Circulation Manager work. It installs the necessary libraries, pulls the circ manager from GitHub, creates the virtual environment, and downloads the nltk corpora. It also installs a `post-receive.sample` githook. While the hook won't be used by any Docker container, it means the directory could be copied down to a host machine as-is and deployed to.\r\n\r\nThe other two Dockerfiles are based on the work that `base` begins. Like the last version, `deploy` installs the necessary nginx and uWSGI files and loads the app.\r\n\r\nUnsurprisingly, `scripts` runs the Circulation Manager's many important monitors and scripts on the agreed-upon schedule. It includes `run`, which makes sure the same script doesn't run multiple times simultaneously, and `initialize` which handles the pesky ThreeM Monitor, which needs to be run the first time with a date long passed.\r\n\r\nUltimately, the `initialize` script is not a great solution. Or, rather, the way it's being run by supervisor is subpar. But it's working, sooooooooooo\r\n\r\n:sweat_smile:","created_at":"2016-04-01T21:42:57Z","updated_at":"2016-04-04T13:36:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d48ee7e00131743a452620a408d4efe4191d5cfa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4/commits","review_comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4/comments","review_comment_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/4/comments","statuses_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/statuses/ce4ffd19a88bb11a8fa6f4e793916845db6ee613","head":{"label":"NYPL-Simplified:create-multiple-dockerfiles","ref":"create-multiple-dockerfiles","sha":"ce4ffd19a88bb11a8fa6f4e793916845db6ee613","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"repo":{"id":54663144,"name":"circulation-docker","full_name":"NYPL-Simplified/circulation-docker","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NYPL-Simplified/circulation-docker","description":"","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker","forks_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/deployments","created_at":"2016-03-24T18:00:52Z","updated_at":"2016-03-24T18:01:07Z","pushed_at":"2016-04-01T21:42:57Z","git_url":"git://github.com/NYPL-Simplified/circulation-docker.git","ssh_url":"git@github.com:NYPL-Simplified/circulation-docker.git","clone_url":"https://github.com/NYPL-Simplified/circulation-docker.git","svn_url":"https://github.com/NYPL-Simplified/circulation-docker","homepage":null,"size":15,"stargazers_count":0,"watchers_count":0,"language":"Nginx","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"NYPL-Simplified:master","ref":"master","sha":"50357f3572247c6331da38b087348c6f3d5e41e7","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"repo":{"id":54663144,"name":"circulation-docker","full_name":"NYPL-Simplified/circulation-docker","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NYPL-Simplified/circulation-docker","description":"","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker","forks_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/deployments","created_at":"2016-03-24T18:00:52Z","updated_at":"2016-03-24T18:01:07Z","pushed_at":"2016-04-01T21:42:57Z","git_url":"git://github.com/NYPL-Simplified/circulation-docker.git","ssh_url":"git@github.com:NYPL-Simplified/circulation-docker.git","clone_url":"https://github.com/NYPL-Simplified/circulation-docker.git","svn_url":"https://github.com/NYPL-Simplified/circulation-docker","homepage":null,"size":15,"stargazers_count":0,"watchers_count":0,"language":"Nginx","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4"},"html":{"href":"https://github.com/NYPL-Simplified/circulation-docker/pull/4"},"issue":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/4"},"comments":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation-docker/statuses/ce4ffd19a88bb11a8fa6f4e793916845db6ee613"}}}}