Skip to content

Commit

Permalink
Update runtime to Go 1.11, use gcloud to deploy (fix google#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
knyar committed Jul 12, 2019
1 parent 34fb66a commit 58e9fb9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
18 changes: 6 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
language: go
go:
- "1.10"
- "1.11"
env:
- DEP_VERSION="0.5.0"
- DEP_VERSION="0.5.4" CLOUDSDK_CORE_DISABLE_PROMPTS=1
install:
- |
LATEST_SDK="$(curl -fsSL 'https://www.googleapis.com/storage/v1/b/appengine-sdks/o?prefix=featured%2F' |
jq -r '([.items[] |
select((.name | endswith(".zip")) and (.name | contains("go_appengine_sdk_linux_amd64")))] |
sort_by(.timeCreated)) | .[-1:] | .[] | .mediaLink')"
- curl -sSLo $HOME/gae_sdk.zip "$LATEST_SDK"
- unzip -q $HOME/gae_sdk.zip -d ~
- curl https://sdk.cloud.google.com | bash
- $HOME/google-cloud-sdk/bin/gcloud components install app-engine-python app-engine-go cloud-datastore-emulator
- go get github.com/golang/mock/mockgen
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
before_script:
- export PATH=$PATH:"$HOME/go_appengine"
script:
- source $HOME/google-cloud-sdk/path.bash.inc
- go test -v ./...
- dep check
- gofmt -w $(go list -f '{{.Dir}}' ./...)
Expand All @@ -29,4 +23,4 @@ script:
git status
git diff
exit 1
fi
fi
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ using a git repository and
auth cookie:
* `gcloud init`
* `gcloud auth application-default login`
* Download and install the
[original App Engine SDK for Go](https://cloud.google.com/appengine/docs/standard/go/download)
(Expand the "Previous App Engine SDK" header to see it)
1. Clone the ts-bridge source
* `go get github.com/google/ts-bridge/...`
* The ts-bridge source code should appear in
Expand Down Expand Up @@ -147,7 +144,7 @@ using a git repository and
ts-bridge in a different Cloud region from the system itself to ensure
independent failure domains.
4. Deploy app
* `goapp deploy -application <your_project_name> -version live`
* `gcloud app deploy --project <your_project_name> --version live`
5. Verify in the Stackdriver metrics explorer that metrics are being imported
once a minute
Expand Down
25 changes: 25 additions & 0 deletions app/.gcloudignore
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions app/app.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
runtime: go
api_version: go1
runtime: go111

env_variables:
CONFIG_FILE: "metrics.yaml"
Expand Down Expand Up @@ -28,6 +27,6 @@ env_variables:

handlers:
- url: /
script: _go_app
script: auto
- url: /(sync|cleanup)
script: _go_app
script: auto

0 comments on commit 58e9fb9

Please sign in to comment.