Adds terraform/opentofu state registry with locking. Implements: https://github.com/go-gitea/gitea/issues/33644. I also checked [encrypted state](https://opentofu.org/docs/language/state/encryption), it works out of the box. Docs PR: https://gitea.com/gitea/docs/pulls/357 --------- Co-authored-by: Andras Elso <elso.andras@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
27 lines
1.3 KiB
Handlebars
27 lines
1.3 KiB
Handlebars
{{if eq .PackageDescriptor.Package.Type "terraform"}}
|
|
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
|
|
<div class="ui attached segment">
|
|
<div class="ui form">
|
|
<div class="field">
|
|
<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.terraform.install"}}</label>
|
|
<div class="markup"><pre class="code-block"><code>terraform {
|
|
backend "http" {
|
|
address = "{{ctx.AppFullLink}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/terraform/state/{{$.PackageDescriptor.Package.Name}}""
|
|
lock_address = "{{ctx.AppFullLink}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/terraform/state/{{$.PackageDescriptor.Package.Name}}/lock"
|
|
unlock_address = "{{ctx.AppFullLink}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/terraform/state/{{$.PackageDescriptor.Package.Name}}/lock"
|
|
lock_method = "POST"
|
|
unlock_method = "DELETE"
|
|
}
|
|
}</code></pre></div>
|
|
</div>
|
|
<div class="field">
|
|
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.terraform.install2"}}</label>
|
|
<div class="markup"><pre class="code-block"><code>terraform init -migrate-state</code></pre></div>
|
|
</div>
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "packages.registry.documentation" "Terraform" "https://docs.gitea.com/usage/packages/terraform"}}</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|