diff options
author | Adin Scannell <ascannell@google.com> | 2020-04-27 22:24:58 -0700 |
---|---|---|
committer | Adin Scannell <ascannell@google.com> | 2020-05-06 14:15:18 -0700 |
commit | 508e25b6d6e9a81edb6ddf8738450b79898b446a (patch) | |
tree | a7f6105ac25c8a879ed880e477d89ec6b6eb1a24 /website/cmd | |
parent | 8cb33ce5ded7d417710e7e749524b895deb20397 (diff) |
Adapt website to use g3doc sources and bazel.
This adapts the merged website repository to use the image and bazel
build framework. It explicitly avoids the container_image rules provided
by bazel, opting instead to build with direct docker commands when
necessary.
The relevant build commands are incorporated into the top-level
Makefile.
Diffstat (limited to 'website/cmd')
-rw-r--r-- | website/cmd/generate-syscall-docs/BUILD | 9 | ||||
-rw-r--r-- | website/cmd/generate-syscall-docs/main.go | 3 | ||||
-rw-r--r-- | website/cmd/server/BUILD | 10 | ||||
-rw-r--r-- | website/cmd/server/main.go (renamed from website/cmd/gvisor-website/main.go) | 10 |
4 files changed, 25 insertions, 7 deletions
diff --git a/website/cmd/generate-syscall-docs/BUILD b/website/cmd/generate-syscall-docs/BUILD new file mode 100644 index 000000000..40d13e5c8 --- /dev/null +++ b/website/cmd/generate-syscall-docs/BUILD @@ -0,0 +1,9 @@ +load("//tools:defs.bzl", "go_binary") + +package(licenses = ["notice"]) + +go_binary( + name = "generate-syscall-docs", + srcs = ["main.go"], + visibility = ["//website:__pkg__"], +) diff --git a/website/cmd/generate-syscall-docs/main.go b/website/cmd/generate-syscall-docs/main.go index d0faed128..9ca1b9730 100644 --- a/website/cmd/generate-syscall-docs/main.go +++ b/website/cmd/generate-syscall-docs/main.go @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2019 The gVisor Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ layout: docs category: Compatibility weight: 50 permalink: /docs/user_guide/compatibility/{{.OS}}/{{.Arch}}/ -noedit: true --- This table is a reference of {{.OS}} syscalls for the {{.Arch}} architecture and diff --git a/website/cmd/server/BUILD b/website/cmd/server/BUILD new file mode 100644 index 000000000..6b5a08f0d --- /dev/null +++ b/website/cmd/server/BUILD @@ -0,0 +1,10 @@ +load("//tools:defs.bzl", "go_binary") + +package(licenses = ["notice"]) + +go_binary( + name = "server", + srcs = ["main.go"], + pure = True, + visibility = ["//website:__pkg__"], +) diff --git a/website/cmd/gvisor-website/main.go b/website/cmd/server/main.go index d86d7c735..18cd525d2 100644 --- a/website/cmd/gvisor-website/main.go +++ b/website/cmd/server/main.go @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2019 The gVisor Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,20 +25,20 @@ import ( ) var redirects = map[string]string{ - // Github redirects + // GitHub redirects. "/change": "https://github.com/google/gvisor", "/issue": "https://github.com/google/gvisor/issues", "/issue/new": "https://github.com/google/gvisor/issues/new", "/pr": "https://github.com/google/gvisor/pulls", - // For links + // For links. "/faq": "/docs/user_guide/faq/", // Redirects to compatibility docs. "/c": "/docs/user_guide/compatibility/", "/c/linux/amd64": "/docs/user_guide/compatibility/linux/amd64/", - // Redirect for old urls + // Redirect for old URLs. "/docs/user_guide/compatibility/amd64/": "/docs/user_guide/compatibility/linux/amd64/", "/docs/user_guide/compatibility/amd64": "/docs/user_guide/compatibility/linux/amd64/", "/docs/user_guide/kubernetes/": "/docs/user_guide/quick_start/kubernetes/", @@ -191,7 +191,7 @@ func envFlagString(name, def string) string { } var ( - addr = flag.String("http", envFlagString("HTTP", ":8080"), "HTTP service address") + addr = flag.String("http", envFlagString("HTTP", ":"+envFlagString("PORT", "8080")), "HTTP service address") staticDir = flag.String("static-dir", envFlagString("STATIC_DIR", "_site"), "static files directory") // Uses the standard GOOGLE_CLOUD_PROJECT environment variable set by App Engine. |