Merge remote-tracking branch 'github/beta/1.1.0' into feat/1.1.1/user-center

This commit is contained in:
LinkinStars
2023-04-04 15:15:48 +08:00
7 changed files with 40 additions and 50 deletions
+5 -3
View File
@@ -25,9 +25,11 @@ ARG CGO_EXTRA_CFLAGS
COPY . ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
COPY --from=node-builder /tmp/build ${BUILD_DIR}/ui/build
RUN apk --no-cache add build-base git \
&& make clean build \
&& cp answer /usr/bin/answer
RUN apk --no-cache add build-base git bash \
&& make clean build
RUN chmod 755 answer
RUN ["/bin/bash","-c","script/build_plugin.sh"]
RUN cp answer /usr/bin/answer
RUN mkdir -p /data/uploads && chmod 777 /data/uploads \
&& mkdir -p /data/i18n && cp -r i18n/*.yaml /data/i18n
+1 -1
View File
@@ -1,6 +1,6 @@
.PHONY: build clean ui
VERSION=1.0.7
VERSION=1.1.0
BIN=answer
DIR_SRC=./cmd/answer
DOCKER_CMD=docker
+2
View File
@@ -156,3 +156,5 @@ require (
modernc.org/token v1.0.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace lukechampine.com/uint128 v1.1.1 => github.com/aichy126/uint128 v1.1.1
-20
View File
@@ -1,20 +0,0 @@
package sample
import "github.com/answerdev/answer/plugin"
type Connector struct {
}
func init() {
plugin.Register(&Connector{})
}
func (c *Connector) Info() plugin.Info {
return plugin.Info{
Name: plugin.MakeTranslator("plugin.connector.name"),
SlugName: "connector",
//Description: plugin.MakeTranslator("plugin.connector.description"),
Author: "answerdev",
Version: "0.0.1",
}
}
-26
View File
@@ -1,26 +0,0 @@
package sample
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/answerdev/answer/plugin"
"github.com/gin-gonic/gin"
)
func TestConnector_Info(t *testing.T) {
c, _ := gin.CreateTestContext(httptest.NewRecorder())
c.Request, _ = http.NewRequest("", "", nil)
c.Request.Header.Set("Accept-Language", "en_US")
_ = plugin.CallBase(func(base plugin.Base) error {
info := base.Info()
fmt.Println(info.Name.Translate(c))
fmt.Println(info.SlugName)
fmt.Println(info.Description.Translate(c))
fmt.Println(info.Author)
fmt.Println(info.Version)
return nil
})
}
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
plugin_file=./script/plugin_list
if [ ! -f "$plugin_file" ]; then
echo "plugin_list is not exist"
exit 0
fi
num=0
for line in `cat $plugin_file`
do
account=$line
accounts[$num]=$account
((num++))
done
if [ $num -eq 0 ]; then
echo "plugin_list is null"
exit 0
fi
cmd="./answer build "
for repo in ${accounts[@]}
do
echo ${repo}
cmd=$cmd" --with "${repo}
done
$cmd
if [ ! -f "./new_answer" ]; then
echo "new_answer is not exist build failed"
exit 0
fi
rm answer
mv new_answer answer
./answer plugin
+1
View File
@@ -0,0 +1 @@
github.com/answerdev/plugins/connector/basic@latest