Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HOST=gcr.io
PROJECT_ID=wpt-live
PROJECT_ID=wpt-live-app

.PHONY: cert-renewer wpt-server-tot
cert-renewer wpt-server-tot:
Expand All @@ -21,15 +21,9 @@ run-%: %
--env WPT_BUCKET \
wpt-live-$*

google-cloud-platform-credentials.json:
@echo To publish images, the file $@ must be present in the root of >&2
@echo this repository. >&2
@exit 1

.PHONY: login
login: google-cloud-platform-credentials.json
cat $< | \
docker login -u _json_key --password-stdin $(HOST)
login:
yes | gcloud auth configure-docker

publish-%: % login
docker tag wpt-live-$* $(HOST)/$(PROJECT_ID)/wpt-live-$*
Expand Down
13 changes: 3 additions & 10 deletions infrastructure/docker-image/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@ variable "image" {
}

output "identifier" {
value = "${var.registry}/${var.image}@${data.external.image.result.identifier}"
value = "${var.registry}/${var.image}@${data.docker_registry_image.image.sha256_digest}"
}

data "external" "image" {
program = [
"python3",
"${path.module}/latest-image.py",
"--registry",
var.registry,
"--image",
var.image,
]
data "docker_registry_image" "image" {
name = "${var.registry}/${var.image}:latest"
}
12 changes: 10 additions & 2 deletions infrastructure/docker-image/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
terraform {
required_version = "~> 1.6.2"
required_providers {
external = {
source = "hashicorp/external"
docker = {
source = "kreuzwerker/docker"
version = "3.0.2"
}
}
}

provider "docker" {
registry_auth {
address = var.registry
config_file = pathexpand("~/.docker/config.json")
}
}
1 change: 0 additions & 1 deletion infrastructure/web-platform-tests/compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ resource "google_compute_instance_template" "wpt_server" {
resource "google_cloud_run_v2_job" "cert_renewers" {
name = "${var.name}-cert-renewers"
location = var.region
launch_stage = "BETA"

template {
template {
Expand Down
5 changes: 3 additions & 2 deletions infrastructure/web-platform-tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module "wpt-server-container" {
}

resource "google_storage_bucket" "certificates" {
name = local.bucket_name
location = "US"
name = local.bucket_name
location = "US"
uniform_bucket_level_access = true
}
2 changes: 1 addition & 1 deletion infrastructure/web-platform-tests/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ variable "wpt_server_ports" {

variable "service_account_email" {
type = string
default = "393246102209-compute@developer.gserviceaccount.com"
default = "2226368975-compute@developer.gserviceaccount.com"
}

variable "cert_renewer_ports" {
Expand Down
9 changes: 4 additions & 5 deletions terraform.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
locals {
region = "us-central1"
zone = "us-central1-b"
project_name = "wpt-live"
project_name = "wpt-live-app"
}

provider "google" {
project = local.project_name
region = local.region
credentials = file("google-cloud-platform-credentials.json")
project = local.project_name
region = local.region
}

resource "google_compute_network" "default" {
Expand Down Expand Up @@ -38,7 +37,7 @@ module "cert-renewer-image" {
module "wpt-live" {
source = "./infrastructure/web-platform-tests"

name = "wpt-tot"
name = "wpt-tot-app"
network_name = google_compute_network.default.name
subnetwork_name = google_compute_subnetwork.default.name
host_zone_name = "wpt-live"
Expand Down
Loading
Loading