summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-21 11:50:41 +0300
committerWolfy-J <[email protected]>2019-05-21 11:50:41 +0300
commit14164eccb902ed2456a55cbdffacf774c438c300 (patch)
tree0dec569383febc42c95989b1902ab11babf2ea88
parent26fb29275d4e79165911bb1cdb3e2c0ce34dbe9a (diff)
added CE build (+jobs +grpc)
-rw-r--r--Makefile7
-rw-r--r--build-ce.sh48
-rwxr-xr-xbuild.sh2
-rw-r--r--cmd/rr-ce/LICENSE21
-rw-r--r--cmd/rr-ce/main.go72
-rw-r--r--go.mod26
6 files changed, 159 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index bbeddb2f..ed266a5c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,20 @@
all:
@./build.sh
+ @./build-ce.sh
build:
@./build.sh all
+ @./build-ce.sh all
+build-ce:
+ @./build-ce.sh all
clean:
rm -rf rr
+ rm -rf rr-ce
install: all
cp rr /usr/local/bin/rr
+ cp rr-ce /usr/local/bin/rr-ce
uninstall:
rm -f /usr/local/bin/rr
+ rm -f /usr/local/bin/rr-ce
test:
composer update
go test -v -race -cover
diff --git a/build-ce.sh b/build-ce.sh
new file mode 100644
index 00000000..e7177199
--- /dev/null
+++ b/build-ce.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+cd $(dirname "${BASH_SOURCE[0]}")
+OD="$(pwd)"
+
+# Pushes application version into the build information.
+RR_VERSION=1.4.2
+
+# Hardcode some values to the core package
+LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.Version=${RR_VERSION}"
+LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.BuildTime=$(date +%FT%T%z)"
+
+build(){
+ echo Packaging $1 CE Build
+ bdir=roadrunner-ce-${RR_VERSION}-$2-$3
+ rm -rf builds/$bdir && mkdir -p builds/$bdir
+ GOOS=$2 GOARCH=$3 ./build-ce.sh
+
+ if [ "$2" == "windows" ]; then
+ mv rr-ce builds/$bdir/rr-ce.exe
+ else
+ mv rr-ce builds/$bdir
+ fi
+
+ cp README.md builds/$bdir
+ cp CHANGELOG.md builds/$bdir
+ cp LICENSE builds/$bdir
+ cd builds
+
+ if [ "$2" == "linux" ]; then
+ tar -zcf $bdir.tar.gz $bdir
+ else
+ zip -r -q $bdir.zip $bdir
+ fi
+
+ rm -rf $bdir
+ cd ..
+}
+
+if [ "$1" == "all" ]; then
+ rm -rf builds/*ce*
+ build "Windows" "windows" "amd64"
+ build "Mac" "darwin" "amd64"
+ build "Linux" "linux" "amd64"
+ build "FreeBSD" "freebsd" "amd64"
+ exit
+fi
+
+CGO_ENABLED=0 go build -ldflags "$LDFLAGS -extldflags '-static'" -o "$OD/rr-ce" cmd/rr-ce/main.go
diff --git a/build.sh b/build.sh
index fc577356..b6303896 100755
--- a/build.sh
+++ b/build.sh
@@ -3,7 +3,7 @@ cd $(dirname "${BASH_SOURCE[0]}")
OD="$(pwd)"
# Pushes application version into the build information.
-RR_VERSION=1.4.0
+RR_VERSION=1.4.2
# Hardcode some values to the core package
LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.Version=${RR_VERSION}"
diff --git a/cmd/rr-ce/LICENSE b/cmd/rr-ce/LICENSE
new file mode 100644
index 00000000..efb98c87
--- /dev/null
+++ b/cmd/rr-ce/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 SpiralScout
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/cmd/rr-ce/main.go b/cmd/rr-ce/main.go
new file mode 100644
index 00000000..d933e3e8
--- /dev/null
+++ b/cmd/rr-ce/main.go
@@ -0,0 +1,72 @@
+// MIT License
+//
+// Copyright (c) 2018 SpiralScout
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+package main
+
+import (
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+ "github.com/spiral/roadrunner/service/limit"
+
+ // services (plugins)
+ "github.com/spiral/jobs"
+ "github.com/spiral/php-grpc"
+ "github.com/spiral/roadrunner/service/env"
+ "github.com/spiral/roadrunner/service/http"
+ "github.com/spiral/roadrunner/service/rpc"
+ "github.com/spiral/roadrunner/service/static"
+
+ // queue brokers
+ "github.com/spiral/jobs/broker/amqp"
+ "github.com/spiral/jobs/broker/beanstalk"
+ "github.com/spiral/jobs/broker/ephemeral"
+ "github.com/spiral/jobs/broker/sqs"
+
+ // additional commands and debug handlers
+ _ "github.com/spiral/jobs/cmd/rr-jobs/jobs"
+ _ "github.com/spiral/php-grpc/cmd/rr-grpc/grpc"
+ _ "github.com/spiral/roadrunner/cmd/rr/http"
+ _ "github.com/spiral/roadrunner/cmd/rr/limit"
+)
+
+func main() {
+ rr.Container.Register(env.ID, &env.Service{})
+ rr.Container.Register(rpc.ID, &rpc.Service{})
+
+ rr.Container.Register(http.ID, &http.Service{})
+ rr.Container.Register(static.ID, &static.Service{})
+
+ rr.Container.Register(grpc.ID, &grpc.Service{})
+
+ rr.Container.Register(jobs.ID, &jobs.Service{
+ Brokers: map[string]jobs.Broker{
+ "amqp": &amqp.Broker{},
+ "ephemeral": &ephemeral.Broker{},
+ "beanstalk": &beanstalk.Broker{},
+ "sqs": &sqs.Broker{},
+ },
+ })
+
+ rr.Container.Register(limit.ID, &limit.Service{})
+
+ // you can register additional commands using cmd.CLI
+ rr.Execute()
+}
diff --git a/go.mod b/go.mod
index fb8f5133..40692ea9 100644
--- a/go.mod
+++ b/go.mod
@@ -1,28 +1,22 @@
module github.com/spiral/roadrunner
require (
- github.com/BurntSushi/toml v0.3.1 // indirect
- github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f // indirect
- github.com/buger/goterm v0.0.0-20180423150900-6d19e6a8df12
+ github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect
+ github.com/buger/goterm v0.0.0-20181115115552-c206103e1f37
github.com/dustin/go-humanize v1.0.0
- github.com/go-ole/go-ole v1.2.1 // indirect
- github.com/inconshreveable/mousetrap v1.0.0 // indirect
- github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
- github.com/kr/pretty v0.1.0 // indirect
- github.com/mattn/go-colorable v0.0.9 // indirect
- github.com/mattn/go-isatty v0.0.4 // indirect
- github.com/mattn/go-runewidth v0.0.3 // indirect
+ github.com/go-ole/go-ole v1.2.4 // indirect
+ github.com/mattn/go-colorable v0.1.1 // indirect
+ github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
- github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc
- github.com/pkg/errors v0.8.0
+ github.com/olekukonko/tablewriter v0.0.1
+ github.com/pkg/errors v0.8.1
github.com/shirou/gopsutil v2.17.12+incompatible
- github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
- github.com/sirupsen/logrus v1.1.1
+ github.com/sirupsen/logrus v1.3.0
github.com/spf13/cobra v0.0.3
github.com/spf13/viper v1.3.1
github.com/spiral/goridge v2.1.3+incompatible
+ github.com/spiral/jobs v1.1.1 // indirect
+ github.com/spiral/php-grpc v1.0.6 // indirect
github.com/stretchr/testify v1.2.2
- github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
golang.org/x/net v0.0.0-20181017193950-04a2e542c03f
- gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)