-
-
Notifications
You must be signed in to change notification settings - Fork 31
mirror-nixos-branch: create a "deployment" on GitHub on new releases #11
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
Conversation
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.
Btw I tested this by:
1. Deleting all the other code around it
2. Hardcoding rev and channelName
3. Running nix-build on a patched default.nix, where I deleted the custom
nix / complications
4. Running the result/bin/script
It did work and it should work but I haven't tested it in context, I'm not
sure how I could.
…On Sun, Mar 5, 2017 at 10:09 PM Graham Christensen ***@***.***> wrote:
cc @edolstra <https://github.com/edolstra> @domenkozar
<https://github.com/domenkozar>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAErrGJ45C5w8q4wsyZL3gaHqz47jIdOks5ri3kGgaJpZM4MTrBd>
.
|
I like this. |
bump @edolstra |
@edolstra this would be lovely :) |
I don't know anything about Github deployments. What does this do exactly? |
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. |
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' | ||
} | ||
); |
There was a problem hiding this comment.
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?
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.