{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos/pulls/comments/88763702","pull_request_review_id":9331141,"id":88763702,"diff_hunk":"@@ -0,0 +1,112 @@\n+\"\"\"Generates a bash script for upgrading by hand \"\"\"\n+\n+import gen.installer.util as util\n+import gen.template\n+from dcos_installer.config import Config\n+from dcos_installer.constants import CONFIG_PATH\n+from pkgpanda.util import (if_exists, load_json, write_string)\n+\n+\n+node_upgrade_template = \"\"\"\n+#!/bin/bash\n+#\n+# BASH script to upgrade DC/OS on a node\n+#\n+# Metadata:\n+#   dcos image commit: {{ dcos_image_commit }}\n+#   generation date: {{ generation_date }}\n+# Copyright 2016 Mesosphere, Inc.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+set -o errexit -o nounset -o pipefail\n+\n+# Check if this is a terminal, and if colors are supported, set some basic\n+# colors for outputs\n+if [ -t 1 ]; then\n+    colors_supported=$(tput colors)\n+    if [[ $colors_supported -ge 8 ]]; then\n+    RED='\\e[1;31m'\n+    BOLD='\\e[1m'\n+    NORMAL='\\e[0m'\n+    fi\n+fi\n+\n+if [[ $EUID -ne 0 ]]; then\n+    echo \"This script must be run as root\" 1>&2\n+    exit 1\n+fi\n+\n+function check_command_exists() {\n+    COMMAND=$1\n+    DISPLAY_NAME=${2:-$COMMAND}\n+\n+    echo -e -n \"Checking if $DISPLAY_NAME is installed and in PATH: \"\n+    $( command -v $COMMAND >/dev/null 2>&1 || exit 1 )\n+    RC=$?\n+    print_status $RC\n+    (( OVERALL_RC += $RC ))\n+    return $RC\n+}\n+\n+function main() {\n+    # source the environment required to run the pkgpanda commands\n+    source /opt/mesosphere/environment.export\n+\n+    # check we get pkgpanda once we have the environment setup\n+    check_command_exists pkgpanda\n+\n+    {{ pkgpanda_fetch }}\n+\n+    {{ pkgpanda_activate }}\n+}","path":"dcos_installer/upgrades.py","position":72,"original_position":72,"commit_id":"20ba46839e4ea7f7d5dc7ba5e244ece6965f2e1b","original_commit_id":"20ba46839e4ea7f7d5dc7ba5e244ece6965f2e1b","user":{"login":"branden","id":42242,"avatar_url":"https://avatars.githubusercontent.com/u/42242?v=3","gravatar_id":"","url":"https://api.github.com/users/branden","html_url":"https://github.com/branden","followers_url":"https://api.github.com/users/branden/followers","following_url":"https://api.github.com/users/branden/following{/other_user}","gists_url":"https://api.github.com/users/branden/gists{/gist_id}","starred_url":"https://api.github.com/users/branden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branden/subscriptions","organizations_url":"https://api.github.com/users/branden/orgs","repos_url":"https://api.github.com/users/branden/repos","events_url":"https://api.github.com/users/branden/events{/privacy}","received_events_url":"https://api.github.com/users/branden/received_events","type":"User","site_admin":false},"body":"FYI that'll only happen on masters, so this script will need to do different things based on the contents of `/etc/mesosphere/roles/`.","created_at":"2016-11-19T00:20:14Z","updated_at":"2016-11-19T00:20:14Z","html_url":"https://github.com/dcos/dcos/pull/969#discussion_r88763702","pull_request_url":"https://api.github.com/repos/dcos/dcos/pulls/969","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos/pulls/comments/88763702"},"html":{"href":"https://github.com/dcos/dcos/pull/969#discussion_r88763702"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos/pulls/969"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos/pulls/969","id":94280553,"html_url":"https://github.com/dcos/dcos/pull/969","diff_url":"https://github.com/dcos/dcos/pull/969.diff","patch_url":"https://github.com/dcos/dcos/pull/969.patch","issue_url":"https://api.github.com/repos/dcos/dcos/issues/969","number":969,"state":"open","locked":false,"title":"WIP: Generate node upgrade script","user":{"login":"amitaekbote","id":4984257,"avatar_url":"https://avatars.githubusercontent.com/u/4984257?v=3","gravatar_id":"","url":"https://api.github.com/users/amitaekbote","html_url":"https://github.com/amitaekbote","followers_url":"https://api.github.com/users/amitaekbote/followers","following_url":"https://api.github.com/users/amitaekbote/following{/other_user}","gists_url":"https://api.github.com/users/amitaekbote/gists{/gist_id}","starred_url":"https://api.github.com/users/amitaekbote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitaekbote/subscriptions","organizations_url":"https://api.github.com/users/amitaekbote/orgs","repos_url":"https://api.github.com/users/amitaekbote/repos","events_url":"https://api.github.com/users/amitaekbote/events{/privacy}","received_events_url":"https://api.github.com/users/amitaekbote/received_events","type":"User","site_admin":false},"body":"High level description including:\r\n - What does this change enable\r\n - What bugs does this change fix\r\n - High-Level how things changed\r\n\r\n# Issues\r\n\r\n[DCOS-<number>](https://dcosjira.atlassian.net/browse/DCOS-<number>)\r\n...\r\n\r\n# Checklist\r\n\r\n - [ ] Included a test which will fail if code is reverted but test is not\r\n - [ ] Followed relevant code rules [Rules for Packages and Systemd](https://github.com/dcos/dcos/tree/master/docs)\r\n\r\nIf this is a component/package update, include\r\n\r\n - [ ] Change Log from last: <link>\r\n - [ ] Test Results: <link>\r\n - [ ] Code Coverage: <link>\r\n\r\n","created_at":"2016-11-18T00:24:33Z","updated_at":"2016-11-19T00:20:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b03dab4be4c8774c76a130edbabab7bcc5a79a05","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos/pulls/969/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos/pulls/969/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos/issues/969/comments","statuses_url":"https://api.github.com/repos/dcos/dcos/statuses/20ba46839e4ea7f7d5dc7ba5e244ece6965f2e1b","head":{"label":"amitaekbote:upgrade-tests","ref":"upgrade-tests","sha":"20ba46839e4ea7f7d5dc7ba5e244ece6965f2e1b","user":{"login":"amitaekbote","id":4984257,"avatar_url":"https://avatars.githubusercontent.com/u/4984257?v=3","gravatar_id":"","url":"https://api.github.com/users/amitaekbote","html_url":"https://github.com/amitaekbote","followers_url":"https://api.github.com/users/amitaekbote/followers","following_url":"https://api.github.com/users/amitaekbote/following{/other_user}","gists_url":"https://api.github.com/users/amitaekbote/gists{/gist_id}","starred_url":"https://api.github.com/users/amitaekbote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitaekbote/subscriptions","organizations_url":"https://api.github.com/users/amitaekbote/orgs","repos_url":"https://api.github.com/users/amitaekbote/repos","events_url":"https://api.github.com/users/amitaekbote/events{/privacy}","received_events_url":"https://api.github.com/users/amitaekbote/received_events","type":"User","site_admin":false},"repo":{"id":68128573,"name":"dcos","full_name":"amitaekbote/dcos","owner":{"login":"amitaekbote","id":4984257,"avatar_url":"https://avatars.githubusercontent.com/u/4984257?v=3","gravatar_id":"","url":"https://api.github.com/users/amitaekbote","html_url":"https://github.com/amitaekbote","followers_url":"https://api.github.com/users/amitaekbote/followers","following_url":"https://api.github.com/users/amitaekbote/following{/other_user}","gists_url":"https://api.github.com/users/amitaekbote/gists{/gist_id}","starred_url":"https://api.github.com/users/amitaekbote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitaekbote/subscriptions","organizations_url":"https://api.github.com/users/amitaekbote/orgs","repos_url":"https://api.github.com/users/amitaekbote/repos","events_url":"https://api.github.com/users/amitaekbote/events{/privacy}","received_events_url":"https://api.github.com/users/amitaekbote/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amitaekbote/dcos","description":"DC/OS Build and Release tools","fork":true,"url":"https://api.github.com/repos/amitaekbote/dcos","forks_url":"https://api.github.com/repos/amitaekbote/dcos/forks","keys_url":"https://api.github.com/repos/amitaekbote/dcos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amitaekbote/dcos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amitaekbote/dcos/teams","hooks_url":"https://api.github.com/repos/amitaekbote/dcos/hooks","issue_events_url":"https://api.github.com/repos/amitaekbote/dcos/issues/events{/number}","events_url":"https://api.github.com/repos/amitaekbote/dcos/events","assignees_url":"https://api.github.com/repos/amitaekbote/dcos/assignees{/user}","branches_url":"https://api.github.com/repos/amitaekbote/dcos/branches{/branch}","tags_url":"https://api.github.com/repos/amitaekbote/dcos/tags","blobs_url":"https://api.github.com/repos/amitaekbote/dcos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amitaekbote/dcos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amitaekbote/dcos/git/refs{/sha}","trees_url":"https://api.github.com/repos/amitaekbote/dcos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amitaekbote/dcos/statuses/{sha}","languages_url":"https://api.github.com/repos/amitaekbote/dcos/languages","stargazers_url":"https://api.github.com/repos/amitaekbote/dcos/stargazers","contributors_url":"https://api.github.com/repos/amitaekbote/dcos/contributors","subscribers_url":"https://api.github.com/repos/amitaekbote/dcos/subscribers","subscription_url":"https://api.github.com/repos/amitaekbote/dcos/subscription","commits_url":"https://api.github.com/repos/amitaekbote/dcos/commits{/sha}","git_commits_url":"https://api.github.com/repos/amitaekbote/dcos/git/commits{/sha}","comments_url":"https://api.github.com/repos/amitaekbote/dcos/comments{/number}","issue_comment_url":"https://api.github.com/repos/amitaekbote/dcos/issues/comments{/number}","contents_url":"https://api.github.com/repos/amitaekbote/dcos/contents/{+path}","compare_url":"https://api.github.com/repos/amitaekbote/dcos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amitaekbote/dcos/merges","archive_url":"https://api.github.com/repos/amitaekbote/dcos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amitaekbote/dcos/downloads","issues_url":"https://api.github.com/repos/amitaekbote/dcos/issues{/number}","pulls_url":"https://api.github.com/repos/amitaekbote/dcos/pulls{/number}","milestones_url":"https://api.github.com/repos/amitaekbote/dcos/milestones{/number}","notifications_url":"https://api.github.com/repos/amitaekbote/dcos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amitaekbote/dcos/labels{/name}","releases_url":"https://api.github.com/repos/amitaekbote/dcos/releases{/id}","deployments_url":"https://api.github.com/repos/amitaekbote/dcos/deployments","created_at":"2016-09-13T16:55:45Z","updated_at":"2016-09-13T16:55:46Z","pushed_at":"2016-11-18T00:38:09Z","git_url":"git://github.com/amitaekbote/dcos.git","ssh_url":"git@github.com:amitaekbote/dcos.git","clone_url":"https://github.com/amitaekbote/dcos.git","svn_url":"https://github.com/amitaekbote/dcos","homepage":"https://dcos.io","size":2136,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"237b9afc52e0dd258dce4303292d205f60d07ca0","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56184050,"name":"dcos","full_name":"dcos/dcos","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos","description":"DC/OS Build and Release tools","fork":false,"url":"https://api.github.com/repos/dcos/dcos","forks_url":"https://api.github.com/repos/dcos/dcos/forks","keys_url":"https://api.github.com/repos/dcos/dcos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos/teams","hooks_url":"https://api.github.com/repos/dcos/dcos/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos/events","assignees_url":"https://api.github.com/repos/dcos/dcos/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos/tags","blobs_url":"https://api.github.com/repos/dcos/dcos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos/subscription","commits_url":"https://api.github.com/repos/dcos/dcos/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos/merges","archive_url":"https://api.github.com/repos/dcos/dcos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos/downloads","issues_url":"https://api.github.com/repos/dcos/dcos/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos/deployments","created_at":"2016-04-13T20:31:58Z","updated_at":"2016-11-18T03:11:58Z","pushed_at":"2016-11-18T23:35:39Z","git_url":"git://github.com/dcos/dcos.git","ssh_url":"git@github.com:dcos/dcos.git","clone_url":"https://github.com/dcos/dcos.git","svn_url":"https://github.com/dcos/dcos","homepage":"https://dcos.io","size":3416,"stargazers_count":1110,"watchers_count":1110,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":183,"mirror_url":null,"open_issues_count":48,"forks":183,"open_issues":48,"watchers":1110,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos/pulls/969"},"html":{"href":"https://github.com/dcos/dcos/pull/969"},"issue":{"href":"https://api.github.com/repos/dcos/dcos/issues/969"},"comments":{"href":"https://api.github.com/repos/dcos/dcos/issues/969/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos/pulls/969/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos/pulls/969/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos/statuses/20ba46839e4ea7f7d5dc7ba5e244ece6965f2e1b"}}}}
{"actor":{"display_login":"branden"}}