mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Support migration from AWS CodeCommit (#31981)
This PR adds support for migrating repos from [AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html). The access key ID and secret access key are required to get repository information and pull requests. And [HTTPS Git credentials](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html) are required to clone the repository. <img src="https://github.com/user-attachments/assets/82ecb2d0-8d43-42b0-b5af-f5347a13b9d0" width="680" /> The AWS CodeCommit icon is from [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/). <img src="https://github.com/user-attachments/assets/3c44d21f-d753-40f5-9eae-5d3589e0d50d" width="320" />
This commit is contained in:
@@ -169,6 +169,10 @@ func Migrate(ctx *context.APIContext) {
|
||||
opts.PullRequests = false
|
||||
opts.Releases = false
|
||||
}
|
||||
if gitServiceType == api.CodeCommitService {
|
||||
opts.AWSAccessKeyID = form.AWSAccessKeyID
|
||||
opts.AWSSecretAccessKey = form.AWSSecretAccessKey
|
||||
}
|
||||
|
||||
repo, err := repo_service.CreateRepositoryDirectly(ctx, ctx.Doer, repoOwner, repo_service.CreateRepoOptions{
|
||||
Name: opts.RepoName,
|
||||
|
@@ -231,6 +231,10 @@ func MigratePost(ctx *context.Context) {
|
||||
opts.PullRequests = false
|
||||
opts.Releases = false
|
||||
}
|
||||
if form.Service == structs.CodeCommitService {
|
||||
opts.AWSAccessKeyID = form.AWSAccessKeyID
|
||||
opts.AWSSecretAccessKey = form.AWSSecretAccessKey
|
||||
}
|
||||
|
||||
err = repo_model.CheckCreateRepository(ctx, ctx.Doer, ctxUser, opts.RepoName, false)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user