Add temporary redirect site for Open Match (#200)

This commit is contained in:
Jeremy Edwards
2019-04-12 11:24:23 -07:00
committed by GitHub
parent db912b2d68
commit 0cea4ed713
4 changed files with 66 additions and 1 deletions

View File

@ -618,6 +618,9 @@ browse-site: build/site/
deploy-dev-site: build/site/
cd $(BUILD_DIR)/site && gcloud $(OM_SITE_GCP_PROJECT_FLAG) app deploy .app.yaml --promote --version=$(VERSION_SUFFIX) --quiet
deploy-redirect-site:
cd $(REPOSITORY_ROOT)/site/redirect/ && gcloud $(OM_SITE_GCP_PROJECT_FLAG) app deploy app.yaml --promote --quiet
run-site: build/toolchain/bin/hugo$(EXE_EXTENSION)
cd site/ && ../build/toolchain/bin/hugo$(EXE_EXTENSION) server --debug --watch --enableGitInfo . --bind 0.0.0.0 --port $(SITE_PORT) --disableFastRender
@ -695,4 +698,4 @@ sync-deps:
sleep-10:
sleep 10
.PHONY: sync-deps sleep-10 proxy-dashboard proxy-prometheus proxy-grafana clean clean-toolchain clean-binaries clean-protos presubmit test test-10 vet
.PHONY: deploy-redirect-site sync-deps sleep-10 proxy-dashboard proxy-prometheus proxy-grafana clean clean-toolchain clean-binaries clean-protos presubmit test test-10 vet

View File

@ -0,0 +1,25 @@
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

21
site/redirect/app.yaml Normal file
View File

@ -0,0 +1,21 @@
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
runtime: go111
service: default
handlers:
- url: /.*
secure: always
script: auto

16
site/redirect/redirect.go Normal file
View File

@ -0,0 +1,16 @@
package main
import (
"net/http"
"google.golang.org/appengine"
)
func main() {
http.HandleFunc("/", redirect)
appengine.Main()
}
func redirect(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "https://github.com/GoogleCloudPlatform/open-match/", 301)
}