Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mirror-nixos-branch: create a "deployment" on GitHub on new releases #11

Closed
wants to merge 1 commit into from

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Mar 6, 2017

The environment is the channel name, an example of deployments can be
found at https://api.github.com/repos/grahamc/garbage/deployments

Specify GITHUB_OAUTH_TOKEN with a GitHub Personal Access Token which
has ONLY repo_deployment permissions.

Closes #10

We'd want this code to run once per new revision, which is why I put it where I did.

Configuration updated here: NixOS/infra#24

You'd need to add that .github/token file.

The environment is the channel name, an example of deployments can be
found at https://api.github.com/repos/grahamc/garbage/deployments

Specify GITHUB_OAUTH_TOKEN with a GitHub Personal Access Token which
has ONLY repo_deployment permissions.
grahamc added a commit to grahamc/nixos-org-configurations that referenced this pull request Mar 6, 2017
@grahamc
Copy link
Member Author

grahamc commented Mar 6, 2017

cc @edolstra @domenkozar

@grahamc
Copy link
Member Author

grahamc commented Mar 6, 2017 via email

@domenkozar
Copy link
Member

I like this.

@grahamc
Copy link
Member Author

grahamc commented Mar 7, 2017

bump @edolstra

@domenkozar
Copy link
Member

@edolstra this would be lovely :)

@edolstra
Copy link
Member

I don't know anything about Github deployments. What does this do exactly?

@grahamc
Copy link
Member Author

grahamc commented Mar 20, 2017

For nixpkgs, people can query the list of deployments for the repository and know each time each channel was updated. It is just for record keeping.

The deployments URL would look like this:

[
  {
    "url": "https://api.github.com/repos/nixos/nixpkgs/deployments/...",
    "id": 28824381,
    "sha": "7d440a94b541d7cd3f2fb51c2e8a8d085c732d55",
    "ref": "7d440a94b541d7cd3f2fb51c2e8a8d085c732d55",
    "task": "deploy",
    "payload": {

    },
    "environment": "release-16.09",
    "description": null,
    "creator": {
      "login": "grahamc",
      "id": 76716,
      "avatar_url": "https://avatars0.githubusercontent.com/u/76716?v=3",
      "gravatar_id": "",
      "url": "https://api.github.com/users/grahamc",
      "html_url": "https://github.com/grahamc",
      "followers_url": "https://api.github.com/users/grahamc/followers",
      "following_url": "https://api.github.com/users/grahamc/following{/other_user}",
      "gists_url": "https://api.github.com/users/grahamc/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/grahamc/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/grahamc/subscriptions",
      "organizations_url": "https://api.github.com/users/grahamc/orgs",
      "repos_url": "https://api.github.com/users/grahamc/repos",
      "events_url": "https://api.github.com/users/grahamc/events{/privacy}",
      "received_events_url": "https://api.github.com/users/grahamc/received_events",
      "type": "User",
      "site_admin": false
    },
    "created_at": "2017-03-06T00:40:09Z",
    "updated_at": "2017-03-06T00:40:09Z",
    "statuses_url": "https://api.github.com/repos/nixos/nixpkgs/deployments/.../statuses",
    "repository_url": "https://api.github.com/repos/nixos/nixpkgs"
  },
]

A deployment on GitHub can be used to trigger actual actions on a server (via webhooks), but in this case is just used as a marker. No actions will take place: in order for actual actions to run we would need to add more webhooks to the repository, and set up daemons on the servers.

@domenkozar
Copy link
Member

domenkozar commented Mar 20, 2017

So this doesn't point to the cloudfront url for the channel update. This would then only be useful to list channel updates on github and parse all the channel information from cloudfront.

{
'state' => 'success'
}
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that the deployment is created before the release is uploaded to Cloudfront?

What happens if the script gets interrupted? Will the next run create a duplicate deployment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants