Compare commits

..

No commits in common. "e4ff32cc941aa558696c038e96a5f14b2d401941" and "8e2fc7264bb8a913a9cd259835d95e438ad9708a" have entirely different histories.

6 changed files with 7 additions and 24 deletions

View File

@ -3,7 +3,7 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
GOFMT ?= gofmt -s GOFMT ?= gofmt -s
VERSION = 0.7.3 VERSION = 0.7.2
test: fmt-check test: fmt-check
go test -i $(TEST) || exit 1 go test -i $(TEST) || exit 1

View File

@ -17,7 +17,7 @@ terraform {
required_providers { required_providers {
gitea = { gitea = {
source = "Lerentis/gitea" source = "Lerentis/gitea"
version = "0.7.3" version = "0.7.2"
} }
} }
} }

View File

@ -72,8 +72,7 @@ Need to exist in the gitea instance
Need to exist in the gitea instance Need to exist in the gitea instance
- `license` (String) The license under which the source code of this repository should be. - `license` (String) The license under which the source code of this repository should be.
Need to exist in the gitea instance Need to exist in the gitea instance
- `migration_clone_address` (String) - `migration_clone_addresse` (String)
- `migration_clone_addresse` (String) DEPRECATED in favor of `migration_clone_address`
- `migration_issue_labels` (Boolean) - `migration_issue_labels` (Boolean)
- `migration_lfs` (Boolean) - `migration_lfs` (Boolean)
- `migration_lfs_endpoint` (String) - `migration_lfs_endpoint` (String)

View File

@ -12,7 +12,7 @@ resource "gitea_repository" "mirror" {
name = "terraform-provider-gitea-mirror" name = "terraform-provider-gitea-mirror"
description = "Mirror of Terraform Provider" description = "Mirror of Terraform Provider"
mirror = true mirror = true
migration_clone_address = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git" migration_clone_addresse = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git"
migration_service = "gitea" migration_service = "gitea"
migration_service_auth_token = var.gitea_mirror_token migration_service_auth_token = var.gitea_mirror_token
} }

View File

@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
gitea = { gitea = {
source = "terraform.local/lerentis/gitea" source = "terraform.local/lerentis/gitea"
version = "0.8.0" version = "0.7.2"
} }
} }
} }

View File

@ -34,8 +34,7 @@ const (
repoAllowManualMerge string = "allow_manual_merge" repoAllowManualMerge string = "allow_manual_merge"
repoAutodetectManualMerge string = "autodetect_manual_merge" repoAutodetectManualMerge string = "autodetect_manual_merge"
repoMirror string = "mirror" repoMirror string = "mirror"
migrationCloneAddresse string = "migration_clone_addresse" migrationCloneAddress string = "migration_clone_addresse"
migrationCloneAddress string = "migration_clone_address"
migrationService string = "migration_service" migrationService string = "migration_service"
migrationServiceAuthName string = "migration_service_auth_username" migrationServiceAuthName string = "migration_service_auth_username"
migrationServiceAuthPassword string = "migration_service_auth_password" migrationServiceAuthPassword string = "migration_service_auth_password"
@ -90,18 +89,10 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) {
} }
if (d.Get(repoMirror)).(bool) { if (d.Get(repoMirror)).(bool) {
var cloneAddr string
if d.Get(migrationCloneAddresse).(string) != "" {
cloneAddr = d.Get(migrationCloneAddresse).(string)
} else {
cloneAddr = d.Get(migrationCloneAddress).(string)
}
opts := gitea.MigrateRepoOption{ opts := gitea.MigrateRepoOption{
RepoName: d.Get(repoName).(string), RepoName: d.Get(repoName).(string),
RepoOwner: d.Get(repoOwner).(string), RepoOwner: d.Get(repoOwner).(string),
CloneAddr: cloneAddr, CloneAddr: d.Get(migrationCloneAddress).(string),
Service: gitea.GitServiceType(d.Get(migrationService).(string)), Service: gitea.GitServiceType(d.Get(migrationService).(string)),
Mirror: d.Get(repoMirror).(bool), Mirror: d.Get(repoMirror).(bool),
Private: d.Get(repoPrivateFlag).(bool), Private: d.Get(repoPrivateFlag).(bool),
@ -454,13 +445,6 @@ func resourceGiteaRepository() *schema.Resource {
Default: false, Default: false,
}, },
"migration_clone_addresse": { "migration_clone_addresse": {
Type: schema.TypeString,
Required: false,
Optional: true,
ForceNew: true,
Description: "DEPRECATED in favor of `migration_clone_address`",
},
"migration_clone_address": {
Type: schema.TypeString, Type: schema.TypeString,
Required: false, Required: false,
Optional: true, Optional: true,