diff --git a/.circleci/config.yml b/.circleci/config.yml index 612ea25b5..7afb82a60 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,8 +50,9 @@ jobs: - setup_remote_docker: docker_layer_caching: true - run: docker build -t pathwar/pathwar . - - run: make docker.integration - - run: make docker.integration + - run: docker build -t pathwar/test ./test + - run: make integration.run + - run: make integration.run # yes, again - run: docker-compose logs workflows: diff --git a/.dockerignore b/.dockerignore index 050ba0709..2af4c450d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ +.circleci/ +test/ .git/ *~ .#* diff --git a/Dockerfile b/Dockerfile index 85ce49a11..c41a3590c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # builder -FROM golang:1.11-alpine as builder +FROM golang:1.12-alpine as builder RUN apk --no-cache --update add nodejs-npm make gcc g++ musl-dev openssl-dev git -ENV GO111MODULE=on -COPY go.* /go/src/pathwar.pw/ +ENV GO111MODULE=on GOPROXY=https://goproxy.io +COPY go.mod go.sum /go/src/pathwar.pw/ WORKDIR /go/src/pathwar.pw RUN go get . COPY . . @@ -10,7 +10,8 @@ RUN touch .proto.generated && make install # runtime FROM alpine:3.8 -RUN apk --no-cache --update add openssl +RUN apk --no-cache --update add openssl wget bash +RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && chmod +x wait-for-it.sh COPY --from=builder /go/bin/pathwar.pw /bin/pathwar.pw ENTRYPOINT ["/bin/pathwar.pw"] CMD ["server"] diff --git a/Makefile b/Makefile index d54cb96c6..cc341e36b 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ help: sed 's/^/ $(HELP_MSG_PREFIX)make /' .PHONY: run -run: $(BIN) +run: $(BIN) mysql.up $(BIN) server $(RUN_OPTS) .PHONY: install @@ -47,6 +47,26 @@ install: $(BIN) $(BIN): .proto.generated $(PWCTL_OUT_FILES) $(OUR_SOURCES) go install -v +.PHONY: mysql.up +mysql.up: + docker-compose up -d mysql + @echo "Waiting for mysql to be ready..." + @while ! mysqladmin ping -h127.0.0.1 -P3306 --silent; do sleep 1; done + @echo "Done." + +.PHONY: mysql.down +mysql.down: + docker-compose stop mysql || true + docker-compose rm -f -v mysql || true + +.PHONY: mysql.shell +mysql.shell: + mysql -h127.0.0.1 -P3306 -uroot -puns3cur3 pathwar + +.PHONY: mysql.dump +mysql.dump: + mysqldump -h127.0.0.1 -P3306 -uroot -puns3cur3 pathwar + .PHONY: clean clean: rm -f $(GENERATED_FILES) .proto.generated @@ -93,13 +113,14 @@ test: .proto.generated .PHONY: docker.build docker.build: - docker build -t pathwar/pathwar . - -.PHONY: docker.integration -docker.integration: - docker-compose -f ./test/docker-compose.yml up -d server - docker-compose -f ./test/docker-compose.yml run client - docker-compose -f ./test/docker-compose.yml down + docker build -t pathwar/pathwar:latest . + docker build -t pathwar/pathwar:test ./test + +.PHONY: integration.run +integration.run: + docker-compose -f ./docker-compose.yml -f ./test/docker-compose.yml up -d --no-build server + docker-compose -f ./docker-compose.yml -f ./test/docker-compose.yml run --no-deps client + docker-compose -f ./docker-compose.yml -f ./test/docker-compose.yml down .PHONY: integration integration: diff --git a/docker-compose.yml b/docker-compose.yml index 9e0f9336a..bae15a3a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,22 @@ version: '2.3' services: server: - &server - image: pathwar/pathwar - command: server - #depends_on: - # - mysql + image: pathwar/pathwar:latest + build: . + entrypoint: /bin/bash -c + command: + - ./wait-for-it.sh mysql:3306 -- /bin/pathwar.pw server --sql-config="root:uns3cur3@tcp(mysql:3306)/pathwar?charset=utf8" + depends_on: + - mysql ports: - 8000 + + mysql: + image: mysql:latest + command: --default-authentication-plugin=mysql_native_password + restart: always + ports: + - 3306:3306 + environment: + MYSQL_ROOT_PASSWORD: uns3cur3 + MYSQL_DATABASE: pathwar \ No newline at end of file diff --git a/entity/entity.go b/entity/entity.go index 2fefce6c4..8bc473219 100644 --- a/entity/entity.go +++ b/entity/entity.go @@ -2,7 +2,6 @@ package entity func All() []interface{} { return []interface{}{ - Achievement{}, Coupon{}, Event{}, Hypervisor{}, @@ -19,5 +18,6 @@ func All() []interface{} { UserSession{}, User{}, WhoswhoAttempt{}, + Achievement{}, } } diff --git a/entity/entity.pb.go b/entity/entity.pb.go index 340195fe5..d66c6e606 100644 --- a/entity/entity.pb.go +++ b/entity/entity.pb.go @@ -224,9 +224,9 @@ type TeamMember struct { Metadata `protobuf:"bytes,1,opt,name=metadata,proto3,embedded=metadata" json:"metadata"` Role TeamMember_Role `protobuf:"varint,100,opt,name=role,proto3,enum=pathwar.entity.TeamMember_Role" json:"role,omitempty"` User *User `protobuf:"bytes,200,opt,name=user,proto3" json:"user,omitempty" gorm:"foreignkey:UserID"` - UserID string `protobuf:"bytes,201,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty" sql:"type:string not null REFERENCES user(id)" gorm:"index"` + UserID string `protobuf:"bytes,201,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty" sql:"not null" gorm:"index"` TournamentTeam *TournamentTeam `protobuf:"bytes,202,opt,name=tournament_team,json=tournamentTeam,proto3" json:"tournament_team,omitempty" gorm:"foreignkey:TournamentTeamID"` - TournamentTeamID string `protobuf:"bytes,203,opt,name=tournament_team_id,json=tournamentTeamId,proto3" json:"tournament_team_id,omitempty" sql:"type:string not null REFERENCES tournament_team(id)" gorm:"index"` + TournamentTeamID string `protobuf:"bytes,203,opt,name=tournament_team_id,json=tournamentTeamId,proto3" json:"tournament_team_id,omitempty" sql:"not null" gorm:"index"` } func (m *TeamMember) Reset() { *m = TeamMember{} } @@ -638,7 +638,7 @@ var xxx_messageInfo_Tournament proto.InternalMessageInfo type TournamentTeam struct { Metadata `protobuf:"bytes,1,opt,name=metadata,proto3,embedded=metadata" json:"metadata"` Tournament *Tournament `protobuf:"bytes,200,opt,name=tournament,proto3" json:"tournament,omitempty" gorm:"foreignkey:TournamentID"` - TournamentID string `protobuf:"bytes,201,opt,name=tournament_id,json=tournamentId,proto3" json:"tournament_id,omitempty" sql:"type:string not null REFERENCES tournament(id)" gorm:"index"` + TournamentID string `protobuf:"bytes,201,opt,name=tournament_id,json=tournamentId,proto3" json:"tournament_id,omitempty" sql:"not null" gorm:"index"` } func (m *TournamentTeam) Reset() { *m = TournamentTeam{} } @@ -728,7 +728,7 @@ var xxx_messageInfo_WhoswhoAttempt proto.InternalMessageInfo type LevelSubscription struct { Metadata `protobuf:"bytes,1,opt,name=metadata,proto3,embedded=metadata" json:"metadata"` TournamentTeam *TournamentTeam `protobuf:"bytes,200,opt,name=tournament_team,json=tournamentTeam,proto3" json:"tournament_team,omitempty" gorm:"foreignkey:TournamentTeamID"` - TournamentTeamID string `protobuf:"bytes,201,opt,name=tournament_team_id,json=tournamentTeamId,proto3" json:"tournament_team_id,omitempty" sql:"type:string not null REFERENCES tournament_team(id)" gorm:"index"` + TournamentTeamID string `protobuf:"bytes,201,opt,name=tournament_team_id,json=tournamentTeamId,proto3" json:"tournament_team_id,omitempty" sql:"not null" gorm:"index"` } func (m *LevelSubscription) Reset() { *m = LevelSubscription{} } @@ -781,7 +781,7 @@ func (m *LevelSubscription) GetTournamentTeamID() string { type ShopItem struct { Metadata `protobuf:"bytes,1,opt,name=metadata,proto3,embedded=metadata" json:"metadata"` TournamentTeam *TournamentTeam `protobuf:"bytes,200,opt,name=tournament_team,json=tournamentTeam,proto3" json:"tournament_team,omitempty" gorm:"foreignkey:TournamentTeamID"` - TournamentTeamID string `protobuf:"bytes,201,opt,name=tournament_team_id,json=tournamentTeamId,proto3" json:"tournament_team_id,omitempty" sql:"type:string not null REFERENCES tournament_team(id)" gorm:"index"` + TournamentTeamID string `protobuf:"bytes,201,opt,name=tournament_team_id,json=tournamentTeamId,proto3" json:"tournament_team_id,omitempty" sql:"not null" gorm:"index"` } func (m *ShopItem) Reset() { *m = ShopItem{} } @@ -874,7 +874,7 @@ type LevelInstance struct { // associations // Hypervisor *Hypervisor `protobuf:"bytes,200,opt,name=hypervisor,proto3" json:"hypervisor,omitempty" gorm:"foreignkey:HypervisorID"` - HypervisorID string `protobuf:"bytes,201,opt,name=hypervisor_id,json=hypervisorId,proto3" json:"hypervisor_id,omitempty" sql:"type:string not null REFERENCES hypervisor(id)" gorm:"index"` + HypervisorID string `protobuf:"bytes,201,opt,name=hypervisor_id,json=hypervisorId,proto3" json:"hypervisor_id,omitempty" sql:"not null" gorm:"index"` } func (m *LevelInstance) Reset() { *m = LevelInstance{} } @@ -1045,7 +1045,7 @@ type Coupon struct { // associations // TeamMember *TeamMember `protobuf:"bytes,200,opt,name=team_member,json=teamMember,proto3" json:"team_member,omitempty" gorm:"foreignkey:TeamMemberID"` - TeamMemberID string `protobuf:"bytes,201,opt,name=team_member_id,json=teamMemberId,proto3" json:"team_member_id,omitempty" sql:"type:string REFERENCES team_member(id)" gorm:"index"` + TeamMemberID string `protobuf:"bytes,201,opt,name=team_member_id,json=teamMemberId,proto3" json:"team_member_id,omitempty" gorm:"index"` } func (m *Coupon) Reset() { *m = Coupon{} } @@ -1106,7 +1106,7 @@ type Achievement struct { Metadata `protobuf:"bytes,1,opt,name=metadata,proto3,embedded=metadata" json:"metadata"` Type Achievement_Type `protobuf:"varint,100,opt,name=type,proto3,enum=pathwar.entity.Achievement_Type" json:"type,omitempty"` TeamMember *TeamMember `protobuf:"bytes,200,opt,name=team_member,json=teamMember,proto3" json:"team_member,omitempty" gorm:"foreignkey:TeamMemberID"` - TeamMemberID string `protobuf:"bytes,201,opt,name=team_member_id,json=teamMemberId,proto3" json:"team_member_id,omitempty" sql:"type:string not null REFERENCES team_member(id)" gorm:"index"` + TeamMemberID string `protobuf:"bytes,201,opt,name=team_member_id,json=teamMemberId,proto3" json:"team_member_id,omitempty" sql:"not null" gorm:"index"` } func (m *Achievement) Reset() { *m = Achievement{} } @@ -1266,103 +1266,100 @@ func init() { func init() { proto.RegisterFile("entity/entity.proto", fileDescriptor_9b38ccb06a827056) } var fileDescriptor_9b38ccb06a827056 = []byte{ - // 1534 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x73, 0xdb, 0xc4, - 0x17, 0x8f, 0x1c, 0xdb, 0xb1, 0x9f, 0x9d, 0xc4, 0xd9, 0x24, 0x8d, 0x92, 0xa6, 0x96, 0xab, 0xef, - 0x77, 0x98, 0x40, 0xa9, 0x03, 0x2e, 0x99, 0x81, 0x74, 0x60, 0x88, 0x9b, 0xa4, 0xf5, 0xd0, 0x14, - 0x46, 0x69, 0xca, 0x0c, 0x07, 0x8c, 0x62, 0x6d, 0x6c, 0x51, 0x59, 0x12, 0xda, 0x95, 0x83, 0x87, - 0xe1, 0xc6, 0x15, 0xe8, 0x3f, 0xc0, 0x9f, 0x00, 0x27, 0x86, 0x3f, 0x80, 0x53, 0x0a, 0x1c, 0x7a, - 0x61, 0x86, 0x0b, 0x86, 0x49, 0xff, 0x03, 0xdf, 0x99, 0x61, 0x76, 0x65, 0x59, 0xb2, 0xa3, 0x94, - 0x74, 0x9c, 0xd2, 0x0b, 0x27, 0xef, 0xbe, 0xf7, 0x79, 0x3f, 0xf7, 0xed, 0x7b, 0x5a, 0xc3, 0x2c, - 0x36, 0xa9, 0x4e, 0xdb, 0xab, 0xde, 0x4f, 0xd1, 0x76, 0x2c, 0x6a, 0xa1, 0x29, 0x5b, 0xa5, 0x8d, - 0x43, 0xd5, 0x29, 0x7a, 0xd4, 0xa5, 0xeb, 0x75, 0x9d, 0x36, 0xdc, 0xfd, 0x62, 0xcd, 0x6a, 0xae, - 0xd6, 0x2d, 0x43, 0x35, 0xeb, 0xab, 0x1c, 0xb8, 0xef, 0x1e, 0xac, 0xda, 0xb4, 0x6d, 0x63, 0xb2, - 0x4a, 0xf5, 0x26, 0x26, 0x54, 0x6d, 0xda, 0xc1, 0xca, 0x53, 0xb6, 0x74, 0x75, 0x40, 0xb8, 0x6e, - 0x05, 0xa2, 0x6c, 0xc7, 0x37, 0x7c,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13, 0xb2, - 0xe1, 0x47, 0xbd, 0x18, 0xff, 0xc7, 0xe7, 0x67, 0x26, 0xf4, 0x9e, 0x67, 0xa6, 0xd8, 0x96, 0x88, - 0x89, 0x68, 0x53, 0x4c, 0x4e, 0xf1, 0x20, 0xe5, 0x2b, 0x47, 0xc7, 0x79, 0xe1, 0xd1, 0x71, 0x5e, - 0xf8, 0xf3, 0x38, 0x2f, 0x3c, 0x78, 0x9c, 0x1f, 0x7b, 0xf4, 0x38, 0x3f, 0xf6, 0xdb, 0xe3, 0xfc, - 0xd8, 0x07, 0x33, 0xbe, 0x94, 0x7d, 0xd8, 0xfb, 0xb3, 0x74, 0x3f, 0xc9, 0xff, 0x0e, 0xbc, 0xf6, - 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x71, 0x39, 0xea, 0x72, 0x44, 0x15, 0x00, 0x00, + // 1473 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x72, 0x1b, 0xc5, + 0x16, 0xf6, 0xc8, 0x92, 0x2c, 0x1f, 0xc9, 0xb6, 0xdc, 0xb6, 0xe3, 0xf1, 0x4f, 0x24, 0x65, 0xee, + 0xad, 0x5b, 0xbe, 0x37, 0x37, 0x32, 0x28, 0xb8, 0x8a, 0x0a, 0x05, 0x85, 0x15, 0x93, 0x44, 0x45, + 0x12, 0xa8, 0x71, 0x1c, 0xaa, 0xd8, 0x88, 0xb6, 0xa6, 0xad, 0x19, 0x32, 0x7f, 0x4c, 0xf7, 0xc8, + 0xe8, 0x09, 0x80, 0x0d, 0xa4, 0xd8, 0x53, 0xc5, 0x96, 0x3d, 0x4f, 0xc0, 0xca, 0x81, 0x4d, 0x96, + 0x6c, 0x22, 0x28, 0xe7, 0x0d, 0xbc, 0xa7, 0x8a, 0xea, 0x1e, 0x8d, 0x66, 0x24, 0x8f, 0x63, 0x28, + 0x39, 0xb0, 0x61, 0xe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5, 0x54, 0x8a, + 0xc3, 0x20, 0x9e, 0xec, 0x2c, 0x1b, 0x12, 0xa1, 0x7d, 0x40, 0x23, 0x11, 0x79, 0x05, 0x3f, 0x05, + 0x15, 0x5c, 0x3f, 0xee, 0x95, 0x8b, 0xa3, 0x3e, 0xce, 0xab, 0xa5, 0x38, 0x1c, 0xa1, 0xa1, 0x29, + 0x57, 0x21, 0xcd, 0x19, 0x47, 0x33, 0x30, 0xbd, 0x67, 0x6b, 0xe4, 0xc0, 0xb0, 0x89, 0x56, 0x9c, + 0x40, 0xd3, 0x90, 0x79, 0xef, 0xd0, 0x26, 0x5e, 0x51, 0xe2, 0xcb, 0x3a, 0xa6, 0x46, 0xab, 0x98, + 0x52, 0x9e, 0xa5, 0x20, 0xcd, 0x49, 0x1b, 0xbb, 0x1d, 0x56, 0x21, 0xc7, 0x59, 0xe5, 0x99, 0x88, + 0x96, 0x98, 0x56, 0x07, 0x7b, 0xb4, 0x08, 0x19, 0x62, 0x61, 0xc3, 0x94, 0x89, 0x50, 0x04, 0x1b, + 0xf4, 0x2f, 0x98, 0x71, 0x31, 0xa5, 0x87, 0x8e, 0xa7, 0x35, 0x75, 0x4c, 0x75, 0xf9, 0x40, 0x68, + 0x0b, 0xa1, 0xf0, 0x0e, 0xa6, 0xfa, 0x10, 0x88, 0x62, 0x93, 0xc9, 0xed, 0x61, 0xd0, 0x2e, 0x36, + 0x19, 0x5a, 0x86, 0x29, 0x4a, 0x75, 0x7e, 0xe6, 0x64, 0x5d, 0xa8, 0xb3, 0x94, 0xea, 0xef, 0x92, + 0x2e, 0x7a, 0x1d, 0x72, 0x94, 0x50, 0x6a, 0x38, 0x36, 0xe5, 0x2d, 0x37, 0xb9, 0x91, 0xaf, 0xad, + 0x25, 0xb5, 0xdc, 0x6e, 0x00, 0x52, 0x07, 0x68, 0x74, 0x0b, 0x8a, 0xe2, 0xeb, 0x58, 0xa2, 0x85, + 0xa9, 0x6e, 0xb8, 0x94, 0x37, 0xda, 0xa4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0xcd, 0xf6, 0xb5, 0xb5, 0x44, 0xed, + 0x54, 0x5f, 0xbb, 0x95, 0xa8, 0xcd, 0xa1, 0xcb, 0xb0, 0x12, 0x78, 0x4e, 0x52, 0x4f, 0x73, 0xf5, + 0x43, 0x6c, 0x1a, 0xfc, 0xbd, 0x7d, 0x9a, 0x09, 0x40, 0x25, 0x58, 0x0d, 0xd5, 0x09, 0x74, 0xe4, + 0x51, 0x05, 0xd6, 0x07, 0xe6, 0x49, 0x01, 0x0a, 0x71, 0x44, 0x22, 0x31, 0x33, 0x71, 0x44, 0x22, + 0x3b, 0xb3, 0xe8, 0x0a, 0x5c, 0x8e, 0xa2, 0x24, 0x41, 0xe6, 0xe2, 0x90, 0x64, 0x9e, 0x8a, 0x71, + 0x48, 0x32, 0x59, 0xf3, 0x48, 0x81, 0x52, 0x2c, 0x50, 0x12, 0x06, 0xa1, 0x05, 0x98, 0x1b, 0x60, + 0x82, 0x11, 0x55, 0x5c, 0x40, 0x8b, 0x50, 0x1c, 0xf8, 0x0e, 0x84, 0xb4, 0xb8, 0x88, 0x96, 0x60, + 0x3e, 0x72, 0x17, 0x8a, 0x97, 0xe2, 0xe2, 0xda, 0x40, 0x7c, 0x29, 0x2e, 0xde, 0x1a, 0x88, 0x97, + 0xd1, 0x25, 0x40, 0xb1, 0x9c, 0x42, 0xb9, 0x1c, 0x97, 0xd7, 0x22, 0xf9, 0x4a, 0x5c, 0xbe, 0x15, + 0xc9, 0x57, 0xd1, 0x32, 0x2c, 0xc4, 0x6b, 0x0b, 0x15, 0x6b, 0xca, 0x97, 0x29, 0x48, 0xef, 0xf8, + 0x96, 0x8b, 0xde, 0x86, 0x19, 0xf1, 0x16, 0x1b, 0x3c, 0x3f, 0xff, 0xc0, 0xeb, 0xb3, 0xe0, 0x47, + 0x1b, 0x8a, 0xae, 0x41, 0xd6, 0x14, 0x9c, 0xc9, 0x29, 0x61, 0xba, 0x34, 0x6a, 0x2a, 0x18, 0x55, + 0xfb, 0x20, 0xf4, 0x3f, 0xc8, 0x70, 0x73, 0x2a, 0x4f, 0x0a, 0x74, 0xe2, 0x2f, 0x2b, 0x6a, 0x00, + 0x41, 0x6f, 0x42, 0x21, 0xfe, 0xb8, 0x95, 0xd3, 0xe7, 0x3e, 0xc3, 0xf2, 0xb1, 0x77, 0x2d, 0x0f, + 0xc5, 0xb7, 0x54, 0xce, 0x24, 0x87, 0xe2, 0x76, 0x6a, 0x00, 0xa9, 0x5f, 0x3d, 0x3a, 0x2e, 0x49, + 0x4f, 0x8f, 0x4b, 0xd2, 0xaf, 0xc7, 0x25, 0xe9, 0xf1, 0xf3, 0xd2, 0xc4, 0xd3, 0xe7, 0xa5, 0x89, + 0x9f, 0x9f, 0x97, 0x26, 0x3e, 0x9c, 0x0f, 0xad, 0xdc, 0xc3, 0xfe, 0x0f, 0x7d, 0xfb, 0x59, 0xf1, + 0x53, 0xd6, 0xf5, 0xdf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x48, 0x8d, 0xd6, 0x91, 0x00, 0x14, 0x00, + 0x00, } func (m *Metadata) Marshal() (dAtA []byte, err error) { diff --git a/entity/entity.proto b/entity/entity.proto index d00237053..6932d9494 100644 --- a/entity/entity.proto +++ b/entity/entity.proto @@ -36,10 +36,10 @@ message TeamMember { // User user = 200 [(gogoproto.moretags) = "gorm:\"foreignkey:UserID\""]; - string user_id = 201 [(gogoproto.customname) = "UserID", (gogoproto.moretags) = "sql:\"type:string not null REFERENCES user(id)\" gorm:\"index\""]; + string user_id = 201 [(gogoproto.customname) = "UserID", (gogoproto.moretags) = "sql:\"not null\" gorm:\"index\""]; TournamentTeam tournament_team = 202 [(gogoproto.moretags) = "gorm:\"foreignkey:TournamentTeamID\""]; - string tournament_team_id = 203 [(gogoproto.customname) = "TournamentTeamID", (gogoproto.moretags) = "sql:\"type:string not null REFERENCES tournament_team(id)\" gorm:\"index\""]; + string tournament_team_id = 203 [(gogoproto.customname) = "TournamentTeamID", (gogoproto.moretags) = "sql:\"not null\" gorm:\"index\""]; } // User definces a User Account / Profile @@ -142,7 +142,7 @@ message TournamentTeam { // Tournament tournament = 200 [(gogoproto.moretags) = "gorm:\"foreignkey:TournamentID\""]; - string tournament_id = 201 [(gogoproto.customname) = "TournamentID", (gogoproto.moretags) = "sql:\"type:string not null REFERENCES tournament(id)\" gorm:\"index\""]; + string tournament_id = 201 [(gogoproto.customname) = "TournamentID", (gogoproto.moretags) = "sql:\"not null\" gorm:\"index\""]; } message WhoswhoAttempt { @@ -169,7 +169,7 @@ message LevelSubscription { // TournamentTeam tournament_team = 200 [(gogoproto.moretags) = "gorm:\"foreignkey:TournamentTeamID\""]; - string tournament_team_id = 201 [(gogoproto.customname) = "TournamentTeamID", (gogoproto.moretags) = "sql:\"type:string not null REFERENCES tournament_team(id)\" gorm:\"index\""]; + string tournament_team_id = 201 [(gogoproto.customname) = "TournamentTeamID", (gogoproto.moretags) = "sql:\"not null\" gorm:\"index\""]; } message ShopItem { @@ -184,7 +184,7 @@ message ShopItem { // TournamentTeam tournament_team = 200 [(gogoproto.moretags) = "gorm:\"foreignkey:TournamentTeamID\""]; - string tournament_team_id = 201 [(gogoproto.customname) = "TournamentTeamID", (gogoproto.moretags) = "sql:\"type:string not null REFERENCES tournament_team(id)\" gorm:\"index\""]; + string tournament_team_id = 201 [(gogoproto.customname) = "TournamentTeamID", (gogoproto.moretags) = "sql:\"not null\" gorm:\"index\""]; } message LevelFlavor { @@ -210,7 +210,7 @@ message LevelInstance { // associations // Hypervisor hypervisor = 200 [(gogoproto.moretags) = "gorm:\"foreignkey:HypervisorID\""]; - string hypervisor_id = 201 [(gogoproto.customname) = "HypervisorID", (gogoproto.moretags) = "sql:\"type:string not null REFERENCES hypervisor(id)\" gorm:\"index\""]; + string hypervisor_id = 201 [(gogoproto.customname) = "HypervisorID", (gogoproto.moretags) = "sql:\"not null\" gorm:\"index\""]; } message Hypervisor { @@ -261,7 +261,7 @@ message Coupon { // associations // TeamMember team_member = 200 [(gogoproto.moretags) = "gorm:\"foreignkey:TeamMemberID\""]; - string team_member_id = 201 [(gogoproto.customname) = "TeamMemberID", (gogoproto.moretags) = "sql:\"type:string REFERENCES team_member(id)\" gorm:\"index\""]; + string team_member_id = 201 [(gogoproto.customname) = "TeamMemberID", (gogoproto.moretags) = "gorm:\"index\""]; } message Achievement { @@ -308,7 +308,7 @@ message Achievement { // TeamMember team_member = 200 [(gogoproto.moretags) = "gorm:\"foreignkey:TeamMemberID\""]; - string team_member_id = 201 [(gogoproto.customname) = "TeamMemberID", (gogoproto.moretags) = "sql:\"type:string not null REFERENCES team_member(id)\" gorm:\"index\""]; + string team_member_id = 201 [(gogoproto.customname) = "TeamMemberID", (gogoproto.moretags) = "sql:\"not null\" gorm:\"index\""]; } message Dump { diff --git a/go.mod b/go.mod index dd1c840c6..e2b39639e 100644 --- a/go.mod +++ b/go.mod @@ -11,12 +11,11 @@ require ( github.com/docker/go-connections v0.4.0 github.com/docker/go-units v0.3.3 // indirect github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect - github.com/go-sql-driver/mysql v1.4.1 // indirect + github.com/go-sql-driver/mysql v1.4.1 github.com/gobuffalo/packr/v2 v2.0.0-rc.15 github.com/gogo/gateway v1.0.0 github.com/gogo/protobuf v1.2.0 github.com/golang/protobuf v1.2.0 - github.com/google/go-cmp v0.2.0 // indirect github.com/gorilla/mux v1.7.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190104160321-4832df01553a github.com/grpc-ecosystem/grpc-gateway v1.6.4 @@ -24,7 +23,7 @@ require ( github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a // indirect github.com/jinzhu/now v0.0.0-20181116074157-8ec929ed50c3 // indirect github.com/lib/pq v1.0.0 // indirect - github.com/mattn/go-sqlite3 v1.10.0 + github.com/mattn/go-sqlite3 v1.10.0 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/pkg/errors v0.8.1 @@ -40,6 +39,6 @@ require ( google.golang.org/appengine v1.2.0 // indirect google.golang.org/genproto v0.0.0-20190108161440-ae2f86662275 google.golang.org/grpc v1.17.0 - gotest.tools v2.2.0+incompatible // indirect + gotest.tools v0.0.0-20181223230014-1083505acf35 // indirect moul.io/zapgorm v0.0.0-20181220094309-2149c5ded6fc ) diff --git a/go.sum b/go.sum index 3dedfba09..beb79efb2 100644 --- a/go.sum +++ b/go.sum @@ -453,6 +453,7 @@ 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-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180810170437-e96c4e24768d/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181003024731-2f84ea8ef872/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -501,8 +502,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools v2.2.0+incompatible h1:y0IMTfclpMdsdIbr6uwmJn5/WZ7vFuObxDMdrylFM3A= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools v0.0.0-20181223230014-1083505acf35 h1:zpdCK+REwbk+rqjJmHhiCN6iBIigrZ39glqSF0P3KF0= +gotest.tools v0.0.0-20181223230014-1083505acf35/go.mod h1:R//lfYlUuTOTfblYI3lGoAAAebUdzjvbmQsuB7Ykd90= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= moul.io/zapgorm v0.0.0-20181220094309-2149c5ded6fc h1:Ddo1Fa0ruGmrNMWVOzEfbMcp3yy3XrspnmQMJ4o7mfg= moul.io/zapgorm v0.0.0-20181220094309-2149c5ded6fc/go.mod h1:5XkuYCrMvJcscMD3+T4QGDaWsCZiql8k2Pv5iNhTB/g= diff --git a/sql/cmd_sql.go b/sql/cmd_sql.go index f88e1c179..8b7846665 100644 --- a/sql/cmd_sql.go +++ b/sql/cmd_sql.go @@ -9,7 +9,7 @@ import ( ) type Options struct { - Path string `mapstructure:"path"` + Config string `mapstructure:"config"` } func Commands() cli.Commands { @@ -28,7 +28,7 @@ type sqlCommand struct{ opts Options } func (cmd *sqlCommand) LoadDefaultOptions() error { return viper.Unmarshal(&cmd.opts) } func (cmd *sqlCommand) ParseFlags(flags *pflag.FlagSet) { - flags.StringVarP(&cmd.opts.Path, "sql-path", "", "/tmp/pathwar.db", "SQL db path") + flags.StringVarP(&cmd.opts.Config, "sql-config", "", "root:uns3cur3@tcp(127.0.0.1:3306)/pathwar?charset=utf8", "SQL connection config") if err := viper.BindPFlags(flags); err != nil { zap.L().Warn("failed to bind viper flags", zap.Error(err)) } diff --git a/sql/sql.go b/sql/sql.go index 8512406c6..2520be67a 100644 --- a/sql/sql.go +++ b/sql/sql.go @@ -6,7 +6,8 @@ import ( "os" "github.com/jinzhu/gorm" - _ "github.com/mattn/go-sqlite3" // required by gorm + //_ "github.com/mattn/go-sqlite3" // required by gorm + _ "github.com/go-sql-driver/mysql" // required by gorm "go.uber.org/zap" "moul.io/zapgorm" @@ -14,7 +15,7 @@ import ( ) func FromOpts(opts *Options) (*gorm.DB, error) { - db, err := gorm.Open("sqlite3", opts.Path) + db, err := gorm.Open("mysql", opts.Config) if err != nil { return nil, err } @@ -30,10 +31,10 @@ func FromOpts(opts *Options) (*gorm.DB, error) { db.BlockGlobalUpdate(true) db.SingularTable(true) db.LogMode(true) - if err := db.Exec("PRAGMA foreign_keys = ON").Error; err != nil { + if err := db.AutoMigrate(entity.All()...).Error; err != nil { return nil, err } - if err := db.AutoMigrate(entity.All()...).Error; err != nil { + if err := db.Model(entity.Achievement{}).AddForeignKey("team_member_id", "team_member(id)", "RESTRICT", "RESTRICT").Error; err != nil { return nil, err } // FIXME: use gormigrate diff --git a/test/Dockerfile b/test/Dockerfile index b42d40cb1..c9d35c14c 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -3,6 +3,6 @@ RUN apk --no-cache add curl openssl python3 make bash jq \ && pip3 install -U pip setuptools httpie \ && http --version \ && jq --version +RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && chmod +x wait-for-it.sh ENTRYPOINT ["/bin/bash", "-c"] -CMD ["sleep 5; ./integration.sh"] COPY . . diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 21bf971ba..d9788de9c 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -1,15 +1,15 @@ version: '2.3' services: - server: - extends: - file: ../docker-compose.yml - service: server - client: + image: pathwar/pathwar:test build: . environment: TARGET: http://server:8000 + command: + - ./wait-for-it.sh server:8000 -- ./integration.sh depends_on: - server + links: + - server tty: true