2017-06-27 20:40:17 +03:00
|
|
|
# devapp
|
2017-06-23 00:18:44 +03:00
|
|
|
|
|
|
|
## Local development
|
|
|
|
|
|
|
|
```sh
|
2017-07-06 05:24:05 +03:00
|
|
|
$ go build
|
2017-06-27 20:40:17 +03:00
|
|
|
$ ./devapp
|
2017-06-23 00:18:44 +03:00
|
|
|
```
|
|
|
|
|
2017-06-27 20:40:17 +03:00
|
|
|
Then visit http://localhost:6343
|
2017-06-23 00:18:44 +03:00
|
|
|
|
|
|
|
## Deployment
|
|
|
|
|
2019-04-10 18:41:10 +03:00
|
|
|
### First-time setup
|
|
|
|
|
|
|
|
Install the `docker`, `kubectl`, and `gcloud` utilities.
|
|
|
|
|
|
|
|
Verify that `docker run hello-world` works without `sudo`. (You may need to run
|
|
|
|
`sudo adduser $USER docker`, then either log out and back in or run `newgrp
|
|
|
|
docker`.)
|
|
|
|
|
|
|
|
Then run:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ gcloud auth configure-docker
|
|
|
|
```
|
|
|
|
|
2019-11-22 00:32:40 +03:00
|
|
|
Install the App Engine Go SDK: [instructions](https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu)
|
|
|
|
|
2017-07-26 22:13:34 +03:00
|
|
|
### Staging
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ gcloud config set project go-dashboard-dev
|
|
|
|
$ gcloud container clusters get-credentials --zone=us-central1-f go
|
|
|
|
$ make push-staging
|
|
|
|
```
|
|
|
|
|
|
|
|
If creating the deployment and service the first time:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ kubectl create -f deployment-staging.yaml
|
|
|
|
$ kubectl create -f service-staging.yaml
|
|
|
|
```
|
|
|
|
|
|
|
|
If updating the pod image:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ make deploy-staging
|
|
|
|
```
|
|
|
|
|
|
|
|
### Prod
|
|
|
|
|
2017-06-23 00:18:44 +03:00
|
|
|
```sh
|
2017-07-26 22:13:34 +03:00
|
|
|
$ gcloud config set project symbolic-datum-552
|
2017-06-23 00:18:44 +03:00
|
|
|
$ gcloud container clusters get-credentials --zone=us-central1-f go
|
2017-07-26 22:13:34 +03:00
|
|
|
$ make push-prod
|
|
|
|
```
|
|
|
|
|
|
|
|
If creating the deployment and service the first time:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ kubectl create -f deployment-prod.yaml
|
|
|
|
$ kubectl create -f service-prod.yaml
|
|
|
|
```
|
|
|
|
|
|
|
|
If updating the pod image:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ make deploy-prod
|
2019-04-10 18:41:10 +03:00
|
|
|
```
|