diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fad5fb0b20734ce9c8011ae63e8fc48bde2d361..6fb11dafebb7c7dad5438ed6c6da6f7079766801 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,12 +47,23 @@ Integration tests: tags: - golang - mongo + - goqt services: - "lesterpig/mongo:latest" script: - "ln -s -f $(pwd) $GOPATH/src/dfss" - "./build/deps.sh" - "cd $GOPATH/src/dfss && make install" + # Copy required files + - "cp $GOPATH/src/github.com/visualfc/goqt/bin/* $GOPATH/src/dfss/dfssd/" + # Build ressources + - "cd $GOPATH/src/dfss/dfssd/gui && ../goqt_rcc -go gui -o application.qrc.go application.qrc" + # Build binary + - "cd $GOPATH/src/dfss/dfssd && go build -ldflags \"-r .\" -o dfssd" + # Install binary + - "mv $GOPATH/src/dfss/dfssd/dfssd /bin/" + - "mv $GOPATH/src/dfss/dfssd/libqtdrv.ui.so.1 /lib/" + # Start integration tests - "go test -v dfss/tests" Code lint: @@ -74,11 +85,12 @@ Code lint: Deploy: stage: deploy only: - - /^v[0-9]/ - - master + - /^v[0-9]/ + - master tags: - golang - strong + - goqt script: - "ln -s -f $(pwd) $GOPATH/src/dfss" - "./build/deps.sh" diff --git a/Makefile b/Makefile index df3784056634b8b21589d9a5817e9f486301b59e..ddb8e2d09348dd29c3922a54ec9bdb3eb0c3d6a1 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,6 @@ install_all: install go install ./... git reset --hard -release: clean build_all package # prepare_gui builds a new container from the goqt image, adding DFSS dependencies for faster builds. # call it once or after dependency addition. @@ -52,9 +51,21 @@ protobuf: protoc --go_out=plugins=grpc:. dfss/dfsst/api/resolution.proto # Release internals -build_all: +# Do not run these commands on your personal computer +release: clean build_x build_g package + +build_x: go get github.com/mitchellh/gox - gox -os "linux darwin windows" -parallel 1 -output "release/dfss_${VERSION}_{{.OS}}_{{.Arch}}/{{.Dir}}" dfss/dfssc dfss/dfssp dfss/dfsst + gox -osarch "linux/amd64 linux/386 linux/arm windows/386 darwin/amd64" -parallel 1 -output "release/dfss_${VERSION}_{{.OS}}_{{.Arch}}/{{.Dir}}" dfss/dfssc dfss/dfssp dfss/dfsst + +build_g: + cp $(GOPATH)/src/github.com/visualfc/goqt/bin/goqt_rcc /bin/ + cp $(GOPATH)/src/github.com/visualfc/goqt/bin/lib* /lib/ + cd gui && goqt_rcc -go main -o a.qrc.go application.qrc + cd dfssd/gui && goqt_rcc -go gui -o a.qrc.go application.qrc + cd gui && go build -ldflags "-r ." -o ../release/dfss_${VERSION}_linux_amd64/dfssc_gui + cd dfssd/gui && go build -ldflags "-r ." -o ../../release/dfss_${VERSION}_linux_amd64/dfssd + cp /lib/libqtdrv.ui.so.1.0.0 release/dfss_${VERSION}_linux_amd64/libqtdrv.ui.so.1 package: echo "$(VERSION) $(REVISION)" > build/embed/VERSION