-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy.sandbox.sh
executable file
·69 lines (51 loc) · 2.54 KB
/
deploy.sandbox.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# [INFO] GCLOUD: ERROR: (gcloud.app.deploy)
# The current Google Cloud project [sandbox-cryptonomica] does not contain an App Engine application.
# Use `gcloud app create` to initialize an App Engine application within the project.
# > this will create GAE project > you have to choose region
# to be able to deploy you have to be authorized:
## gcloud auth login
gcloud config set project sandbox-cryptonomica
./sed.sandbox.sh # < make changes in code
gcloud app versions list
# (max. 15 versions)
# gcloud app versions delete ... (list separated by empty spaces, not commas)
# see:
# https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine-java8/endpoints-v2-backend
mvn clean package
mvn endpoints-framework:openApiDocs
# mvn endpoints-framework:discoveryDocs
# old:
# gcloud service-management deploy target/openapi-docs/openapi.json
# You can safely ignore the warnings about the paths in openapi.json not requiring an API key
# ( https://cloud.google.com/endpoints/docs/frameworks/java/get-started-frameworks-java )
# >>> new:
gcloud endpoints services deploy target/openapi-docs/openapi.json
# result like:
# Service Configuration [2018-02-21r0] uploaded for service [cryptonomica-server.appspot.com]
# for first rum before deploy run:
# gcloud app create
# if created already should be a message:
# ERROR: (gcloud.app.create) The project [cryptonomica-server] already contains an App Engine application in region [us-central].
# You can deploy your application using `gcloud app deploy`.
mvn package appengine:deploy -Dapp.deploy.projectId=sandbox-cryptonomica # <<< !!!
# after deploy API should be accessible on
# https://apis-explorer.appspot.com/apis-explorer/?base=https://cryptonomica-server.appspot.com/_ah/api
# and web-site on
# https://cryptonomica.net and https://cryptonomica-server.appspot.com
# logs:
# https://console.cloud.google.com/logs/viewer?project=cryptonomica-server
# google dev console dashboard:
# https://console.cloud.google.com/home/dashboard?project=cryptonomica-server
mvn clean
# test:
echo 'sending test request to sandbox-cryptonomica.appspot.com API:'
curl -i -H "Content-Type: application/json" -X POST -d '{"message":"echo"}' https://sandbox-cryptonomica.appspot.com/_ah/api/testAPI/v1/echo
echo # empty line
echo "$(date "+%FT%T%Z") : $(whoami)"
gcloud app versions list
## remove old versions in dev console
# https://console.cloud.google.com/appengine/versions?project=cryptonomica-server
## flush cache on
# https://console.cloud.google.com/appengine/memcache?project=cryptonomica-server
#