diff options
author | Valery Piashchynski <[email protected]> | 2022-01-19 09:48:50 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2022-01-19 09:48:50 +0300 |
commit | 1b451b0e9e3c6970ee1ed5aec94ee0ffcf008f4e (patch) | |
tree | de6f408173dcc82837aebe4062980ed47fbe1aaa | |
parent | 37a9130e5cf7be4f8ddf7aa3c71d24cd2c937b3c (diff) |
Update Dockerfile, add plugins_test
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r-- | Dockerfile | 10 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | internal/container/plugins.go | 4 | ||||
-rw-r--r-- | internal/container/plugins_test.go | 18 |
4 files changed, 28 insertions, 6 deletions
@@ -16,9 +16,11 @@ ENV LDFLAGS="-s \ -X github.com/roadrunner-server/roadrunner/v2/internal/meta.buildTime=$BUILD_TIME" # compile binary file -RUN set -x \ - && CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" -o ./rr ./cmd/rr \ - && ./rr -v +RUN set -x +RUN go mod download +RUN go mod tidy +RUN CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" -o ./rr ./cmd/rr +RUN ./rr -v # Image page: <https://hub.docker.com/_/alpine> # https://alpinelinux.org/posts/Alpine-3.13.4-released.html @@ -31,7 +33,7 @@ ARG BUILD_TIME="undefined" LABEL \ org.opencontainers.image.title="roadrunner" \ - org.opencontainers.image.description="High-performance PHP application server, load-balancer and process manager" \ + org.opencontainers.image.description="High-performance PHP application server, load-balancer, process manager written in Go and powered with plugins" \ org.opencontainers.image.url="https://github.com/roadrunner-server/roadrunner" \ org.opencontainers.image.source="https://github.com/roadrunner-server/roadrunner" \ org.opencontainers.image.vendor="SpiralScout" \ @@ -110,6 +110,8 @@ github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d h1:pVrfxiGfwel github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= github.com/buger/goterm v1.0.1 h1:kSgw3jcjYUzC0Uh/eG8ULjccuz353solup27lUH8Zug= github.com/buger/goterm v1.0.1/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= +github.com/buger/goterm v1.0.3 h1:7V/HeAQHrzPk/U4BvyH2g9u+xbUW9nr4yRPyG59W4fM= +github.com/buger/goterm v1.0.3/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI= github.com/caddyserver/certmagic v0.15.2 h1:OMTakTsLM1ZfzMDjwvYprfUgFzpVPh3u87oxMPwmeBc= github.com/caddyserver/certmagic v0.15.2/go.mod h1:qhkAOthf72ufAcp3Y5jF2RaGE96oip3UbEQRIzwe3/8= diff --git a/internal/container/plugins.go b/internal/container/plugins.go index 7cbead2b..fe775f04 100644 --- a/internal/container/plugins.go +++ b/internal/container/plugins.go @@ -33,7 +33,7 @@ import ( "github.com/roadrunner-server/kv/v2" "github.com/roadrunner-server/memcached/v2" "github.com/roadrunner-server/tcp/v2" - roadrunner_temporal "github.com/temporalio/roadrunner-temporal" + rrt "github.com/temporalio/roadrunner-temporal" ) // Plugins returns active plugins for the endure container. Feel free to add or remove any plugins. @@ -101,6 +101,6 @@ func Plugins() []interface{} { //nolint:funlen &tcp.Plugin{}, // temporal plugins - &roadrunner_temporal.Plugin{}, + &rrt.Plugin{}, } } diff --git a/internal/container/plugins_test.go b/internal/container/plugins_test.go new file mode 100644 index 00000000..b857f09a --- /dev/null +++ b/internal/container/plugins_test.go @@ -0,0 +1,18 @@ +package container + +import ( + "reflect" + "testing" +) + +func TestPlugins(t *testing.T) { + for _, p := range Plugins() { + if p == nil { + t.Error("plugin cannot be nil") + } + + if pk := reflect.TypeOf(p).Kind(); pk != reflect.Ptr && pk != reflect.Struct { + t.Errorf("plugin %v must be a structure or pointer to the structure", p) + } + } +} |