Skip to content

Commit e8b7429

Browse files
feat: add initial infrastructure
1 parent 4811f20 commit e8b7429

File tree

5 files changed

+101
-0
lines changed

5 files changed

+101
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
release:
3535
runs-on: ubuntu-latest
3636
needs: test
37+
permissions:
38+
contents: write
3739
steps:
3840
- uses: actions/checkout@v3
3941
- uses: go-semantic-release/action@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ plugin-registry
77

88
pkg/legacy/v1/plugins.json
99
pkg/legacy/v1/plugins/
10+
11+
infrastructure/.terraform/

infrastructure/.terraform.lock.hcl

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/gcr/main.tf

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
variable "name" {
2+
type = string
3+
}
4+
5+
resource "google_cloud_run_v2_service" "default" {
6+
name = "${var.name}-plugin-registry"
7+
location = "europe-west1"
8+
ingress = "INGRESS_TRAFFIC_ALL"
9+
10+
template {
11+
max_instance_request_concurrency = 100
12+
13+
scaling {
14+
max_instance_count = 1
15+
}
16+
17+
containers {
18+
image = "gcr.io/go-semantic-release/plugin-registry"
19+
20+
startup_probe {
21+
http_get {
22+
path = "/"
23+
}
24+
}
25+
26+
liveness_probe {
27+
http_get {
28+
path = "/"
29+
}
30+
}
31+
32+
resources {
33+
limits = {
34+
cpu = "1000m"
35+
memory = "512Mi"
36+
}
37+
cpu_idle = true
38+
}
39+
}
40+
}
41+
42+
traffic {
43+
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
44+
percent = 100
45+
}
46+
}

infrastructure/main.tf

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
terraform {
2+
required_version = ">= 1.3.7"
3+
required_providers {
4+
google = {
5+
source = "hashicorp/google"
6+
version = ">= 4.51.0"
7+
}
8+
}
9+
backend "gcs" {
10+
bucket = "gsr-tf-state"
11+
prefix = "tf-state"
12+
}
13+
}
14+
15+
provider "google" {
16+
project = "go-semantic-release"
17+
region = "europe-west1"
18+
}
19+
20+
locals {
21+
stages = toset(["staging"])
22+
}
23+
24+
25+
module "gcr" {
26+
for_each = local.stages
27+
source = "./gcr"
28+
name = each.value
29+
}

0 commit comments

Comments
 (0)