{"action":"created","comment":{"url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/comments/146110431","pull_request_review_id":71012354,"id":146110431,"diff_hunk":"@@ -0,0 +1,74 @@\n+# 10. Release and deployment process for Azure Functions\n+\n+Date: 2017-10-20\n+\n+## Status\n+\n+Accepted\n+\n+## Context\n+\n+The Digital Citizenship APIs are based on the Azure Functions framework (a _serverless_ application framework). \n+\n+During the initial development of the APIs, we relied on the [continuous deployment feature](https://docs.microsoft.com/en-us/azure/azure-functions/functions-continuous-deployment), configured to deploy the API code from the `master` branch of the [digital-citizenship-functions](https://github.com/teamdigitale/digital-citizenship-functions) repository.\n+\n+This release process served us well during the initial development phase, but it has several drawbacks:\n+\n+1. there's no approval process that triggers the deployment of the `master` branch into production\n+1. the build phase happens on the production hosts\n+1. we cannot control the actual deployment process (the build and the re-load of the code happens automatically on the production hosts)\n+1. Rolling back is cumbersome as it requires reverting commits on the `master` branch.\n+\n+## Decision\n+\n+We decide to structure the release and deployment process in the following steps:\n+\n+### 1 - Automated tests\n+\n+On commit to the `master` branch, the CI system checks out the commit and runs the automated tests.\n+\n+### 2 - Build of release artifacts\n+\n+On tests passing successfully, a [CI workflow](https://circleci.com/docs/2.0/workflows/) triggers the build process that generates artifacts needed for release (e.g. packs dependencies, compiles Typescript into Javascript, etc...).\n+\n+The generated artifact get stored in a `build` directory (e.g. a single javascript file generated by [Azure Functions Pack](https://github.com/Azure/azure-functions-pack)).\n+\n+### 3 - Version bump and tags\n+\n+On successful build, the patch version gets incremented (e.g. in `package.json`) and it gets committed along with the generated artifacts. \n+\n+After commit, two git tags get created:\n+\n+* a `SNAPSHOT-x.x.x` tag using the bumped version\n+* a `SNAPSHOT-LATEST` tag (this tag gets updated to the current commit)  \n+\n+Everything gets pushed to the upstream repository.\n+\n+### 4 - Promotion\n+\n+On the CI workflow, a [promotion step](https://circleci.com/docs/2.0/workflows/#holding-a-workflow-for-a-manual-approval) awaits for approval.\n+\n+When the promotion gets triggered, two git tags get created:\n+\n+* a `RELEASE-x.x.x` tag using the current version\n+* a `RELEASE-LATEST` tag (this tag gets updated to the current commit)","path":"docs/architecture/decisions/0010-release-and-deployment-process-for-azure-functions.md","position":54,"original_position":54,"commit_id":"d66ac2467e8d72ee1a25c721b66f8b3e4a058a6d","original_commit_id":"d66ac2467e8d72ee1a25c721b66f8b3e4a058a6d","user":{"login":"cloudify","id":48206,"avatar_url":"https://avatars2.githubusercontent.com/u/48206?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudify","html_url":"https://github.com/cloudify","followers_url":"https://api.github.com/users/cloudify/followers","following_url":"https://api.github.com/users/cloudify/following{/other_user}","gists_url":"https://api.github.com/users/cloudify/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify/subscriptions","organizations_url":"https://api.github.com/users/cloudify/orgs","repos_url":"https://api.github.com/users/cloudify/repos","events_url":"https://api.github.com/users/cloudify/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify/received_events","type":"User","site_admin":false},"body":"ufffff branches are a little more difficult to manage in this way, need to reset the branch to the commit, not very clean, but let's see if we can manage to make it work","created_at":"2017-10-21T17:16:59Z","updated_at":"2017-10-21T17:16:59Z","html_url":"https://github.com/teamdigitale/digital-citizenship/pull/15#discussion_r146110431","pull_request_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/comments/146110431"},"html":{"href":"https://github.com/teamdigitale/digital-citizenship/pull/15#discussion_r146110431"},"pull_request":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15"}},"in_reply_to_id":146108959},"pull_request":{"url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15","id":147768887,"html_url":"https://github.com/teamdigitale/digital-citizenship/pull/15","diff_url":"https://github.com/teamdigitale/digital-citizenship/pull/15.diff","patch_url":"https://github.com/teamdigitale/digital-citizenship/pull/15.patch","issue_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/15","number":15,"state":"open","locked":false,"title":"[#151370067] Adds ADR 10 on release and reployment process of Azure Functions","user":{"login":"cloudify","id":48206,"avatar_url":"https://avatars2.githubusercontent.com/u/48206?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudify","html_url":"https://github.com/cloudify","followers_url":"https://api.github.com/users/cloudify/followers","following_url":"https://api.github.com/users/cloudify/following{/other_user}","gists_url":"https://api.github.com/users/cloudify/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify/subscriptions","organizations_url":"https://api.github.com/users/cloudify/orgs","repos_url":"https://api.github.com/users/cloudify/repos","events_url":"https://api.github.com/users/cloudify/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-20T10:33:56Z","updated_at":"2017-10-21T17:16:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b78c7cd56dc7e8b6c86c7dc57786fb8e5206842","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15/commits","review_comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15/comments","review_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/15/comments","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/statuses/d66ac2467e8d72ee1a25c721b66f8b3e4a058a6d","head":{"label":"teamdigitale:adr-functions-deployment","ref":"adr-functions-deployment","sha":"d66ac2467e8d72ee1a25c721b66f8b3e4a058a6d","user":{"login":"teamdigitale","id":25081492,"avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":92495628,"name":"digital-citizenship","full_name":"teamdigitale/digital-citizenship","owner":{"login":"teamdigitale","id":25081492,"avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamdigitale/digital-citizenship","description":"Work in progress","fork":false,"url":"https://api.github.com/repos/teamdigitale/digital-citizenship","forks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/forks","keys_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/teams","hooks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/events","assignees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/tags","blobs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/subscription","commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/merges","archive_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/downloads","issues_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/deployments","created_at":"2017-05-26T09:36:17Z","updated_at":"2017-10-19T16:29:29Z","pushed_at":"2017-10-21T13:25:43Z","git_url":"git://github.com/teamdigitale/digital-citizenship.git","ssh_url":"git@github.com:teamdigitale/digital-citizenship.git","clone_url":"https://github.com/teamdigitale/digital-citizenship.git","svn_url":"https://github.com/teamdigitale/digital-citizenship","homepage":null,"size":1550,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"teamdigitale:master","ref":"master","sha":"833d173199ffabc7e6656f20c86338f98f8b3676","user":{"login":"teamdigitale","id":25081492,"avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":92495628,"name":"digital-citizenship","full_name":"teamdigitale/digital-citizenship","owner":{"login":"teamdigitale","id":25081492,"avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamdigitale/digital-citizenship","description":"Work in progress","fork":false,"url":"https://api.github.com/repos/teamdigitale/digital-citizenship","forks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/forks","keys_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/teams","hooks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/events","assignees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/tags","blobs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/subscription","commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/merges","archive_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/downloads","issues_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship/deployments","created_at":"2017-05-26T09:36:17Z","updated_at":"2017-10-19T16:29:29Z","pushed_at":"2017-10-21T13:25:43Z","git_url":"git://github.com/teamdigitale/digital-citizenship.git","ssh_url":"git@github.com:teamdigitale/digital-citizenship.git","clone_url":"https://github.com/teamdigitale/digital-citizenship.git","svn_url":"https://github.com/teamdigitale/digital-citizenship","homepage":null,"size":1550,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15"},"html":{"href":"https://github.com/teamdigitale/digital-citizenship/pull/15"},"issue":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/15"},"comments":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship/statuses/d66ac2467e8d72ee1a25c721b66f8b3e4a058a6d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"cloudify"}}