Added redis.conf and Makefile commands to assist in machine setup

This commit is contained in:
mitchell 2019-06-01 19:42:46 -07:00
parent 383a3aa1cd
commit 3d3206ddfe
6 changed files with 1407 additions and 4 deletions

View File

@ -1,5 +1,8 @@
.PHONY: all build clean format test gen-certs-go
docker: install
docker-compose build
build: clean gen-certs-go format
go build -mod=vendor -o ./bin/server ./cmd/server
rm ./cmd/server/certs.go
@ -7,9 +10,6 @@ build: clean gen-certs-go format
clean:
rm -rf ./bin
docker: install
docker-compose build
local:
docker-compose up -d
@ -26,7 +26,7 @@ machine-create-google:
docker-machine create --driver google \
--google-address selfpass \
--google-project selfpass-241808 \
--google-machine-type f1-micro \
--google-machine-type g1-small \
--google-machine-image https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-9-stretch-v20190514 \
--google-username selfpass \
--google-zone us-west1-c \
@ -35,6 +35,26 @@ machine-create-google:
machine-rm:
docker-machine rm selfpass01
machine-ssh:
docker-machine ssh selfpass01
machine-put-redis.conf:
docker-machine scp ./redis.conf selfpass01:redis.conf
machine-put-data:
docker-machine scp -r ./data selfpass01:
machine-get-data:
docker-machine scp -r selfpass01:data ./
machine-add-grpc-server-tag:
gcloud compute instances add-tags selfpass01 \
--zone us-west1-c \
--tags grpc-server
machine-install-stackdriver-agent:
docker-machine ssh selfpass01 "curl -sSO https://dl.google.com/cloudagents/install-monitoring-agent.sh && sudo bash install-monitoring-agent.sh"
format:
gofmt -w -s -l .

View File

@ -3,6 +3,7 @@ services:
redis:
volumes:
- "/home/selfpass/data:/data"
- "/home/selfpass/redis.conf:/redis.conf"
server:
entrypoint:
- server

View File

@ -3,7 +3,11 @@ services:
redis:
image: "redis:5.0.5"
restart: on-failure
command:
- redis-server
- /redis.conf
volumes:
- "./redis.conf:/redis.conf"
- "./data:/data"
server:
build: .

1
go.mod
View File

@ -14,6 +14,7 @@ require (
github.com/pquerna/otp v1.1.0
github.com/spf13/cobra v0.0.4
github.com/spf13/viper v1.4.0
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect
google.golang.org/grpc v1.21.0
gopkg.in/AlecAivazis/survey.v1 v1.8.5
)

5
go.sum
View File

@ -148,12 +148,15 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@ -168,6 +171,8 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

1372
redis.conf Normal file

File diff suppressed because it is too large Load Diff