-
-
Notifications
You must be signed in to change notification settings - Fork 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
Github-as-code #6
Comments
In order to manage this, I'll have first to make a complete backup of all repositories (cloning them all, shouldn't be difficult), but also their settings, which I've never done and will have to search how to. Does anyone has already done something similar? @timja maybe? |
No I haven't but also wouldn't worry too much. Shouldn't be anything too special, it can always be re-created. |
FTR, backup of a repo, with an `admin:org` PAT:# Start the migration (one repo, without lock, for testing purpose, should be locked for a real backup!), you'll get the migration id in return
curl -H "Authorization: token $GITHUB_ACCESS_TOKEN" -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/jenkins-infra/migrations -d '{"repositories":["kubernetes-management"]}'
# Check the state of the migration
curl -H "Authorization: token $GITHUB_ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/jenkins-infra/migrations/<migration-id>
# When the migration state is "exported", retrive the backup with this command returning a download link
curl -H "Authorization: token $GITHUB_ACCESS_TOKEN"-H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/jenkins-infra/migrations/<migration-id>/archive
# Wait 7 days for automatic deletion or delete the archive directly
curl -H "Authorization: token $GITHUB_ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/jenkins-infra/migrations/<migration-id>/archive -X DELETE Result for this repo: ./attachments/52eeab2e-2475-4e72-8b0c-9efc58246991/image.png ./attachments_000001.json ./issue_comments_000001.json ./issue_events_000001.json ./issues_000001.json ./organizations_000001.json ./repositories/jenkins-infra/helpdesk.git/HEAD ./repositories/jenkins-infra/helpdesk.git/branches ./repositories/jenkins-infra/helpdesk.git/config ./repositories/jenkins-infra/helpdesk.git/description ./repositories/jenkins-infra/helpdesk.git/hooks/applypatch-msg.sample ./repositories/jenkins-infra/helpdesk.git/hooks/commit-msg.sample ./repositories/jenkins-infra/helpdesk.git/hooks/fsmonitor-watchman.sample ./repositories/jenkins-infra/helpdesk.git/hooks/post-update.sample ./repositories/jenkins-infra/helpdesk.git/hooks/pre-applypatch.sample ./repositories/jenkins-infra/helpdesk.git/hooks/pre-commit.sample ./repositories/jenkins-infra/helpdesk.git/hooks/pre-merge-commit.sample ./repositories/jenkins-infra/helpdesk.git/hooks/pre-push.sample ./repositories/jenkins-infra/helpdesk.git/hooks/pre-rebase.sample ./repositories/jenkins-infra/helpdesk.git/hooks/pre-receive.sample ./repositories/jenkins-infra/helpdesk.git/hooks/prepare-commit-msg.sample ./repositories/jenkins-infra/helpdesk.git/hooks/push-to-checkout.sample ./repositories/jenkins-infra/helpdesk.git/hooks/update.sample ./repositories/jenkins-infra/helpdesk.git/info/exclude ./repositories/jenkins-infra/helpdesk.git/logs/HEAD ./repositories/jenkins-infra/helpdesk.git/objects/info ./repositories/jenkins-infra/helpdesk.git/objects/pack/pack-0594aac5377047a9198e387bb7ef9dafe0ddb2d6.idx ./repositories/jenkins-infra/helpdesk.git/objects/pack/pack-0594aac5377047a9198e387bb7ef9dafe0ddb2d6.pack ./repositories/jenkins-infra/helpdesk.git/packed-refs ./repositories/jenkins-infra/helpdesk.git/refs/heads ./repositories/jenkins-infra/helpdesk.git/refs/tags ./repositories_000001.json ./repository_files/7823979/1.pcap.zip ./repository_files_000001.json ./schema.json ./teams_000001.json ./users_000001.json |
Have you seen: https://github.com/github/safe-settings ? |
Interesting, thanks @jetersen ! Found this quick summary:
I was thinking about using another official github tool/integration, https://github.com/integrations/terraform-provider-github, which has much more articles written about (or so I found after a quick search) I'll test the two of them on another staging org to see and compare what can be done with each of them. |
Just to mention it here, there is also https://github.com/probot/settings which could help having common set of labels across repositories. This would help the release-drafter configuration as well. |
github safe settings also supports this @alecharp :) |
Manage @jenkins-infra "as code", in order to:
The text was updated successfully, but these errors were encountered: