Skip to content

Commit 37da228

Browse files
author
Mikhail Podtserkovskiy
committed
add goreleaser
1 parent 8401b81 commit 37da228

File tree

6 files changed

+33
-13
lines changed

6 files changed

+33
-13
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@
2323

2424
# Your local config
2525
config.json
26+
bindata.go
27+
dist/

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ COPY ./ ${GOPATH}/src/jsonwire-grid
55
WORKDIR ${GOPATH}/src/jsonwire-grid
66
ENV CONFIG_PATH ./config.json
77

8+
RUN go get -u github.com/jteeuwen/go-bindata/...
89
RUN make
910

1011
CMD ["service-entrypoint"]

Makefile

+11-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ all: build
44
.PHONY: help build fmt clean run test coverage check vet lint doc cfpush
55

66
help:
7-
@echo "build - build application from sources"
8-
@echo "fmt - format application sources"
9-
@echo "run - start application"
10-
@echo "gen - generate files for json rpc 2.0 service"
7+
@echo "build - build application from sources"
8+
@echo "fmt - format application sources"
9+
@echo "gen - generate files"
10+
@echo "prepare - prepare project to build"
11+
@echo "run - start application"
1112

12-
build: fmt
13+
build: prepare
1314
go build -o ${GOPATH}/bin/service-entrypoint
1415

1516
fmt:
1617
go fmt
1718

19+
gen:
20+
go-bindata -pkg mysql -o storage/migrations/mysql/bindata.go storage/migrations/mysql
21+
22+
prepare: fmt gen
23+
1824
run: build
1925
${GOPATH}/bin/service-entrypoint

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ Golang implementation of Selenium Grid (hub).
33

44
## HowTo
55
#### Run binary file
6-
1. download binary file
6+
1. download binary file and
77
1. `export CONFIG_PATH=./config.json`
8-
1. `./webdriver-{platform_name}`
8+
1. `./jsonwire-grid`
99

1010
### Run From Source
1111
#### Requirements
1212
* Go >= 1.8.1
13-
1. `git clone https://github.com/qa-dev/webdriver-grid .`
14-
1. `cd webdriver-grid`
15-
1. `export CONFIG_PATH=./config.json`
16-
1. `go run main.go`
13+
* [go-bindata](https://github.com/jteeuwen/go-bindata)
14+
1. `git clone https://github.com/qa-dev/jsonwire-grid .`
15+
1. `cd jsonwire-grid`
16+
1. `cp config-sample.json config.json`
17+
1. `make run`
1718

1819
## HowToUse
1920
1. Run app

goreleaser.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
build:
2+
goos:
3+
- windows
4+
- darwin
5+
- linux
6+
hooks:
7+
pre: make prepare

main.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"jsonwire-grid/middleware"
1414
"jsonwire-grid/pool"
1515
poolMetrics "jsonwire-grid/pool/metrics"
16+
mysqlMigrations "jsonwire-grid/storage/migrations/mysql"
1617
"jsonwire-grid/storage/mysql"
1718
"jsonwire-grid/utils/metrics"
1819
"net/http"
@@ -38,8 +39,10 @@ func main() {
3839
}
3940
storage := mysql.NewMysqlStorage(db)
4041

41-
migrations := &migrate.FileMigrationSource{
42-
Dir: "storage/migrations/mysql",
42+
migrations := &migrate.AssetMigrationSource{
43+
Asset: mysqlMigrations.Asset,
44+
AssetDir: mysqlMigrations.AssetDir,
45+
Dir: "storage/migrations/mysql",
4346
}
4447
n, err := migrate.Exec(db.DB, "mysql", migrations, migrate.Up)
4548
if err != nil {

0 commit comments

Comments
 (0)