This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vapor | |
func routes(_ app: Application) throws { | |
app.get { req in | |
return "It works!" | |
} | |
app.get("hello") { req -> String in | |
return "Hello, world!" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
======================= | |
==== request start ==== | |
uri: https://serviceusage.googleapis.com/v1/projects/my-project/services?alt=json&filter=state%3AENABLED | |
method: GET | |
== headers start == | |
b'Authorization': --- Token Redacted --- | |
b'accept': b'application/json' | |
b'accept-encoding': b'gzip, deflate' | |
b'content-length': b'0' | |
b'user-agent': b'google-cloud-sdk gcloud/HEAD command/gcloud.services.list invocation-id/why-are-you-looking-at-this? environment/None environment-version/None interactive/True from-script/False python/3.7.3 term/xterm-256color (Macintosh; Intel Mac OS X 19.4.0)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud services list --log-http |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT_ID=$(gcloud projects list \ | |
--filter="$PROJECT_NUMBER" \ | |
--format="value(project_id)") | |
echo $PROJECT_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT_NUMBER=$(gcloud projects list \ | |
--filter="project_id:$PROJECT_ID" \ | |
--format='value(project_number)') | |
echo $PROJECT_NUMBER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN_SERVICE=helloworld | |
RUN_SERVICE_URL=$(gcloud run services describe $RUN_SERVICE --format 'value(status.address.url)') | |
curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" $RUN_SERVICE_URL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud beta billing projects describe \ | |
$(gcloud config get-value project) \ | |
--format="value(billingEnabled)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set project | |
gcloud config set project "my-project" | |
# Get project | |
PROJECT=$(gcloud config get-value core/project 2> /dev/null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN_SERVICE=$(gcloud run services describe hellodotnet --format 'value(status.address.url)') | |
curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" $RUN_SERVICE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Microsoft's official build .NET image. | |
# https://hub.docker.com/_/microsoft-dotnet-core-sdk/ | |
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build | |
WORKDIR /app | |
# Install production dependencies. | |
# Copy csproj and restore as distinct layers. | |
COPY *.csproj ./ | |
RUN dotnet restore |