cmd/relui: add cloud build configuration

Add cloud build configuration for running integration tests for relui.

For golang/go#47407

Change-Id: Id06846f4ecd7129b112b5f130cb72b257cc6898a
Reviewed-on: https://go-review.googlesource.com/c/build/+/369254
Trust: Alex Rakoczy <alex@golang.org>
Run-TryBot: Alex Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/cmd/relui/cloudbuild.yaml b/cmd/relui/cloudbuild.yaml
new file mode 100644
index 0000000..81693eb
--- /dev/null
+++ b/cmd/relui/cloudbuild.yaml
@@ -0,0 +1,10 @@
+steps:
+  - name: gcr.io/cloud-builders/docker
+    args: [ 'run', '-d', '--network=cloudbuild', '--env=POSTGRES_HOST_AUTH_METHOD=trust', '--name=postgres', 'postgres:13' ]
+  - name: postgres
+    timeout: 120s
+    args: ['bash', '-c', 'while ! timeout 1 psql --host=postgres --user=postgres --command "select 1"; do sleep 1; done']
+  - name: gcr.io/cloud-builders/docker
+    args: [ 'build', '-f', 'cmd/relui/Dockerfile.test', '-t', 'golang/relui-test', '.' ]
+  - name: gcr.io/cloud-builders/docker
+    args: [ 'run', '--rm', '--network=cloudbuild', '-e', 'PGHOST=postgres', '-e', 'PGUSER=postgres', '-t', 'golang/relui-test', ]