Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
4fd93893ef | |||
d8dd625d3b | |||
f1a03bae87 | |||
5eb39daf95 | |||
6237f9410e | |||
e9bf0a3531 | |||
a1ca739c82 |
@ -1,23 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
{{ range .Versions -}}
|
||||
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
|
||||
|
||||
{{ range .CommitGroups -}}
|
||||
### {{ .Title }}
|
||||
|
||||
{{ range .Commits -}}
|
||||
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pulls/${2}") | trim }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .NoteGroups -}}
|
||||
{{ range .NoteGroups -}}
|
||||
### {{ .Title }}
|
||||
|
||||
{{ range .Notes }}
|
||||
{{ .Body }}
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
@ -1,25 +0,0 @@
|
||||
style: github
|
||||
template: CHANGELOG.tpl.md
|
||||
info:
|
||||
title: CHANGELOG
|
||||
repository_url: https://gitea.rknet.org/infra/hcloud-server-tf
|
||||
options:
|
||||
commit_groups:
|
||||
title_maps:
|
||||
feat: Features
|
||||
fix: Bug Fixes
|
||||
perf: Performance Improvements
|
||||
refactor: Code Refactoring
|
||||
chore: Others
|
||||
test: Testing
|
||||
ci: CI Pipeline
|
||||
docs: Documentation
|
||||
header:
|
||||
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
|
||||
pattern_maps:
|
||||
- Type
|
||||
- Scope
|
||||
- Subject
|
||||
notes:
|
||||
keywords:
|
||||
- BREAKING CHANGE
|
88
.drone.yml
88
.drone.yml
@ -1,88 +0,0 @@
|
||||
---
|
||||
kind: pipeline
|
||||
name: test
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: whitespace
|
||||
pull: always
|
||||
image: thegeeklab/alpine-tools
|
||||
commands:
|
||||
- git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
|
||||
|
||||
- name: tflint
|
||||
image: ghcr.io/terraform-linters/tflint
|
||||
commands:
|
||||
- tflint --color
|
||||
|
||||
- name: terraform
|
||||
pull: always
|
||||
image: jmccann/drone-terraform:8
|
||||
settings:
|
||||
actions:
|
||||
- validate
|
||||
tf_version: 1.3.0
|
||||
|
||||
node:
|
||||
zone: mgmt
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/main
|
||||
- refs/tags/**
|
||||
- refs/pull/**
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: release
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: changelog-generate
|
||||
image: thegeeklab/git-chglog
|
||||
commands:
|
||||
- git fetch -tq
|
||||
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
|
||||
|
||||
- name: changelog-format
|
||||
image: thegeeklab/alpine-tools
|
||||
commands:
|
||||
- prettier CHANGELOG.md
|
||||
- prettier -w CHANGELOG.md
|
||||
|
||||
- name: publish-gitea
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
base_url: https://gitea.rknet.org
|
||||
note: CHANGELOG.md
|
||||
overwrite: true
|
||||
title: ${DRONE_TAG}
|
||||
when:
|
||||
ref:
|
||||
- refs/tags/**
|
||||
|
||||
node:
|
||||
zone: mgmt
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/main
|
||||
- refs/pull/**
|
||||
- refs/tags/**
|
||||
|
||||
depends_on:
|
||||
- test
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: 08a182381788120a9debba89ce838da455d72b0057be6bd1b84ae3437eb1106d
|
||||
|
||||
...
|
47
.gitsv/config.yml
Normal file
47
.gitsv/config.yml
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
version: "1.1"
|
||||
|
||||
versioning:
|
||||
update-major: []
|
||||
update-minor: [feat]
|
||||
update-patch: [fix, perf, refactor, chore, test, ci, docs]
|
||||
|
||||
tag:
|
||||
pattern: "v%d.%d.%d"
|
||||
|
||||
release-notes:
|
||||
sections:
|
||||
- name: Features
|
||||
commit-types: [feat]
|
||||
section-type: commits
|
||||
- name: Bug Fixes
|
||||
commit-types: [fix]
|
||||
section-type: commits
|
||||
- name: Performance Improvements
|
||||
commit-types: [perf]
|
||||
section-type: commits
|
||||
- name: Code Refactoring
|
||||
commit-types: [refactor]
|
||||
section-type: commits
|
||||
- name: Others
|
||||
commit-types: [chore]
|
||||
section-type: commits
|
||||
- name: Testing
|
||||
commit-types: [test]
|
||||
section-type: commits
|
||||
- name: CI Pipeline
|
||||
commit-types: [ci]
|
||||
section-type: commits
|
||||
- name: Documentation
|
||||
commit-types: [docs]
|
||||
section-type: commits
|
||||
- name: Breaking Changes
|
||||
section-type: breaking-changes
|
||||
|
||||
commit-message:
|
||||
footer:
|
||||
issue:
|
||||
key: issue
|
||||
add-value-prefix: "#"
|
||||
issue:
|
||||
regex: "#?[0-9]+"
|
@ -1 +0,0 @@
|
||||
.drone*
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["github>thegeeklab/renovate-presets:ansible"]
|
||||
"extends": ["github>thegeeklab/renovate-presets"]
|
||||
}
|
||||
|
28
.woodpecker/build-package.yml
Normal file
28
.woodpecker/build-package.yml
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
when:
|
||||
- event: [pull_request, tag]
|
||||
- event: [push, manual]
|
||||
branch:
|
||||
- ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
steps:
|
||||
- name: changelog
|
||||
image: quay.io/thegeeklab/git-sv
|
||||
commands:
|
||||
- git sv current-version
|
||||
- git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md
|
||||
- cat CHANGELOG.md
|
||||
|
||||
- name: publish-gitea
|
||||
image: quay.io/thegeeklab/wp-gitea-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
base_url: https://gitea.rknet.org
|
||||
note: CHANGELOG.md
|
||||
title: ${CI_COMMIT_TAG}
|
||||
when:
|
||||
- event: [tag]
|
||||
|
||||
depends_on:
|
||||
- test
|
26
.woodpecker/notify.yml
Normal file
26
.woodpecker/notify.yml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
when:
|
||||
- event: [tag]
|
||||
- event: [push, manual]
|
||||
branch:
|
||||
- ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
runs_on: [success, failure]
|
||||
|
||||
steps:
|
||||
- name: matrix
|
||||
image: quay.io/thegeeklab/wp-matrix
|
||||
settings:
|
||||
homeserver:
|
||||
from_secret: matrix_homeserver
|
||||
room_id:
|
||||
from_secret: matrix_room_id
|
||||
user_id:
|
||||
from_secret: matrix_user_id
|
||||
access_token:
|
||||
from_secret: matrix_access_token
|
||||
when:
|
||||
- status: [success, failure]
|
||||
|
||||
depends_on:
|
||||
- docs
|
24
.woodpecker/test.yml
Normal file
24
.woodpecker/test.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
when:
|
||||
- event: [pull_request, tag]
|
||||
- event: [push, manual]
|
||||
branch:
|
||||
- ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
steps:
|
||||
- name: git-spaces
|
||||
image: quay.io/thegeeklab/alpine-tools
|
||||
commands:
|
||||
- git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
|
||||
|
||||
- name: tflint
|
||||
image: ghcr.io/terraform-linters/tflint
|
||||
commands:
|
||||
- tflint --color
|
||||
|
||||
- name: tofu
|
||||
image: quay.io/thegeeklab/wp-opentofu
|
||||
settings:
|
||||
action:
|
||||
- validate
|
||||
tofu_version: 1.6.1
|
@ -1,6 +1,7 @@
|
||||
# hcloud-server-tf
|
||||
|
||||
[![Build Status](https://drone.rknet.org/api/badges/infra/hcloud-server-tf/status.svg)](https://drone.rknet.org/infra/hcloud-server-tf)
|
||||
[![Build Status](https://ci.rknet.org/api/badges/infra/hcloud-server-tf/status.svg)](https://ci.rknet.org/repos/infra/hcloud-server-tf)
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/infra/hcloud-server-tf/src/branch/main/LICENSE)
|
||||
|
||||
Terraform module to provision Hetzner Cloud servers.
|
||||
|
||||
|
24
main.tf
24
main.tf
@ -5,6 +5,7 @@ locals {
|
||||
volume_name = volume.name
|
||||
volume_size = volume.size
|
||||
server_id = hcloud_server.server[server.name].id
|
||||
server_name = server.name
|
||||
}
|
||||
]
|
||||
])
|
||||
@ -37,10 +38,13 @@ resource "hcloud_server" "server" {
|
||||
backups = try(each.value.backups, false)
|
||||
keep_disk = try(each.value.keep_disk, false)
|
||||
user_data = try(each.value.user_data, null)
|
||||
placement_group_id = each.value.placement_group
|
||||
placement_group_id = try(each.value.placement_group, null)
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [ssh_keys]
|
||||
ignore_changes = [
|
||||
ssh_keys,
|
||||
image,
|
||||
]
|
||||
}
|
||||
|
||||
labels = merge(
|
||||
@ -66,6 +70,14 @@ resource "hcloud_volume" "volume" {
|
||||
name = each.value.volume_name
|
||||
size = each.value.volume_size
|
||||
server_id = each.value.server_id
|
||||
labels = merge(
|
||||
{
|
||||
provisioner = "terraform"
|
||||
project = var.hcloud_project
|
||||
server = each.value.server_name
|
||||
},
|
||||
try(each.value.labels, {})
|
||||
)
|
||||
}
|
||||
|
||||
resource "hcloud_ssh_key" "key" {
|
||||
@ -104,7 +116,7 @@ resource "cloudflare_record" "serverv4" {
|
||||
|
||||
zone_id = var.cloudflare_zones[try(each.value.dns_zone, var.server_dns_zone)]
|
||||
name = each.value.name
|
||||
value = hcloud_server.server[each.value.name].ipv4_address
|
||||
content = hcloud_server.server[each.value.name].ipv4_address
|
||||
type = "A"
|
||||
ttl = 1
|
||||
}
|
||||
@ -114,7 +126,7 @@ resource "cloudflare_record" "serverv6" {
|
||||
|
||||
zone_id = var.cloudflare_zones[try(each.value.dns_zone, var.server_dns_zone)]
|
||||
name = each.value.name
|
||||
value = hcloud_server.server[each.value.name].ipv6_address
|
||||
content = hcloud_server.server[each.value.name].ipv6_address
|
||||
type = "AAAA"
|
||||
ttl = 1
|
||||
}
|
||||
@ -124,7 +136,7 @@ resource "cloudflare_record" "record" {
|
||||
|
||||
zone_id = each.value.zone_id
|
||||
name = each.value.record_name
|
||||
value = each.value.record_value
|
||||
content = each.value.record_value
|
||||
type = each.value.record_type
|
||||
ttl = each.value.record_ttl
|
||||
}
|
||||
@ -139,7 +151,7 @@ resource "restapi_object" "ucs_server" {
|
||||
"name" : each.value.name,
|
||||
"a" : [
|
||||
hcloud_server.server[each.value.name].ipv4_address,
|
||||
hcloud_server.server[each.value.name].ipv6_address,
|
||||
try(each.value.ucs_ipv6_address, hcloud_server.server[each.value.name].ipv6_address),
|
||||
],
|
||||
}
|
||||
})
|
||||
|
@ -1,13 +1,13 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
cloudflare = {
|
||||
source = "cloudflare/cloudflare"
|
||||
source = "registry.opentofu.org/cloudflare/cloudflare"
|
||||
}
|
||||
hcloud = {
|
||||
source = "hetznercloud/hcloud"
|
||||
source = "registry.opentofu.org/hetznercloud/hcloud"
|
||||
}
|
||||
restapi = {
|
||||
source = "Mastercard/restapi"
|
||||
source = "registry.opentofu.org/thegeeklab/restapi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user