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

Automate Gitea mirror creation #1996

Open
JimMadge opened this issue Jul 8, 2024 · 2 comments · May be fixed by #2008
Open

Automate Gitea mirror creation #1996

JimMadge opened this issue Jul 8, 2024 · 2 comments · May be fixed by #2008
Assignees
Labels
enhancement New functionality that should be added to the Safe Haven
Milestone

Comments

@JimMadge
Copy link
Member

JimMadge commented Jul 8, 2024

Create functions to automate our code ingress process, probably using Gitea API

@JimMadge JimMadge added this to the Release 5.0.0rc3 milestone Jul 8, 2024
@JimMadge
Copy link
Member Author

JimMadge commented Jul 9, 2024

It looks like the API call we want to create a mirror is repoMigrate

@JimMadge
Copy link
Member Author

JimMadge commented Jul 9, 2024

I made a little script to test this

#!/usr/bin/env sh

http --auth "$1":"$2" localhost:3000/api/v1/repos/migrate clone_addr="$4" repo_name="$3"
❯ ./create_mirror.sh jim password dotfiles https://github.com/JimMadge/dotfiles
HTTP/1.1 201 Created
Cache-Control: max-age=0, private, must-revalidate, no-transform
Content-Type: application/json;charset=utf-8
Date: Tue, 09 Jul 2024 10:40:56 GMT
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN

{
    "allow_fast_forward_only_merge": true,
    "allow_merge_commits": true,
    "allow_rebase": true,
    "allow_rebase_explicit": true,
    "allow_rebase_update": true,
    "allow_squash_merge": true,
    "archived": false,
    "archived_at": "1970-01-01T01:00:00+01:00",
    "avatar_url": "http://localhost:3000/",
    "clone_url": "http://localhost:3000/jim/dotfiles.git",
    "created_at": "2024-07-09T11:40:53+01:00",
    "default_allow_maintainer_edit": false,
    "default_branch": "main",
    "default_delete_branch_after_merge": false,
    "default_merge_style": "merge",
    "description": "",
    "empty": false,
    "fork": false,
    "forks_count": 0,
    "full_name": "jim/dotfiles",
    "has_actions": true,
    "has_issues": true,
    "has_packages": true,
    "has_projects": true,
    "has_pull_requests": true,
    "has_releases": true,
    "has_wiki": true,
    "html_url": "http://localhost:3000/jim/dotfiles",
    "id": 2,
    "ignore_whitespace_conflicts": false,
    "internal": false,
    "internal_tracker": {
        "allow_only_contributors_to_track_time": true,
        "enable_issue_dependencies": true,
        "enable_time_tracker": true
    },
    "language": "",
    "languages_url": "http://localhost:3000/api/v1/repos/jim/dotfiles/languages",
    "link": "",
    "mirror": false,
    "mirror_interval": "",
    "mirror_updated": "0001-01-01T00:00:00Z",
    "name": "dotfiles",
    "object_format_name": "sha1",
    "open_issues_count": 0,
    "open_pr_counter": 0,
    "original_url": "https://github.com/JimMadge/dotfiles",
    "owner": {
        "active": false,
        "avatar_url": "http://localhost:3000/avatars/284f5ca6c261672f413ef3255e5675fd",
        "created": "2024-07-08T15:11:42+01:00",
        "description": "",
        "email": "[email protected]",
        "followers_count": 0,
        "following_count": 0,
        "full_name": "",
        "html_url": "http://localhost:3000/jim",
        "id": 1,
        "is_admin": false,
        "language": "",
        "last_login": "0001-01-01T00:00:00Z",
        "location": "",
        "login": "jim",
        "login_name": "",
        "prohibit_login": false,
        "restricted": false,
        "source_id": 0,
        "starred_repos_count": 0,
        "username": "jim",
        "visibility": "public",
        "website": ""
    },
    "parent": null,
    "permissions": {
        "admin": true,
        "pull": true,
        "push": true
    },
    "private": false,
    "projects_mode": "all",
    "release_counter": 0,
    "repo_transfer": null,
    "size": 22,
    "ssh_url": "git@localhost:jim/dotfiles.git",
    "stars_count": 0,
    "template": false,
    "updated_at": "2024-07-09T11:40:56+01:00",
    "url": "http://localhost:3000/api/v1/repos/jim/dotfiles",
    "watchers_count": 1,
    "website": ""
}
Screenshot 2024-07-09 at 11 43 41

@JimMadge JimMadge self-assigned this Jul 9, 2024
@JimMadge JimMadge linked a pull request Jul 10, 2024 that will close this issue
3 tasks
@jemrobinson jemrobinson added the enhancement New functionality that should be added to the Safe Haven label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality that should be added to the Safe Haven
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants