Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
fbced09
Add .circleci/config.yml
May 27, 2021
9ed87dd
Updated config.yml
May 27, 2021
efe576f
Updated config.yml
May 27, 2021
3dffb03
test(ci): upgrade circle.yml
May 27, 2021
072b020
test(ci): upgrade circle.yml
May 27, 2021
9740e53
test(ci): upgrade circle.yml
May 27, 2021
834beed
test(ci): upgrade circle.yml
May 27, 2021
72f80e3
test(ci): upgrade circle.yml
May 27, 2021
bcf9cfb
test(ci): upgrade circle.yml
May 27, 2021
5336fc6
test(ci): upgrade circle.yml
May 27, 2021
00c2b09
test(ci): upgrade circle.yml
May 27, 2021
7163d6a
test(ci): upgrade circle.yml
May 27, 2021
3af6745
test(ci): update Makefile
May 27, 2021
e92df27
test(ci): upgrade circle.yml
May 27, 2021
cc21480
test(ci): upgrade circle.yml
May 27, 2021
1223739
test(ci): upgrade circle.yml
May 27, 2021
bccf69e
test(ci): upgrade circle.yml
May 27, 2021
0f94430
test(ci): upgrade circle.yml
May 27, 2021
66e28b7
test(ci): upgrade circle.yml
May 27, 2021
d69f3a9
test(ci): upgrade circle.yml
May 27, 2021
c7b021e
test(ci): upgrade circle.yml
May 27, 2021
4c907ca
test(ci): upgrade circle.yml
May 27, 2021
2cb4fb7
test(ci): add drone.yml
May 28, 2021
5f08588
test(ci): add drone.yml
May 28, 2021
f88c16b
test(ci): add drone.yml
May 28, 2021
351855c
test(ci): add drone.yml
May 28, 2021
b062b42
test(ci): add drone.yml
May 28, 2021
48c00f5
test(ci): add drone.yml
May 28, 2021
53dd139
test(ci): add drone.yml
May 28, 2021
b1cef19
test(ci): add drone.yml
May 28, 2021
7cf1d4a
test(ci): update drone.yml
May 28, 2021
ab984b6
test(ci): updade drone.yml
May 29, 2021
061ed40
test(ci): update drone.yml
May 29, 2021
7d126fc
test(ci): update drone.yml
May 29, 2021
c866327
test(ci): update drone.yml
May 31, 2021
3fcbfcf
test(ci): update drone.yml
May 31, 2021
c3e8600
test(ci): update drone.yml
May 31, 2021
9be5c30
test(ci): update drone.yml
May 31, 2021
9c850d5
test(ci): update drone.yml
May 31, 2021
13f214d
test(ci): update drone.yml
May 31, 2021
a71a3c8
test(ci): update drone.yml
May 31, 2021
711d458
test(ci): update drone.yml
May 31, 2021
fe66b07
test(ci): update drone.yml
May 31, 2021
ecae734
test(ci): update drone.yml\
May 31, 2021
4aae539
test(ci): update drone.yml
May 31, 2021
76d76a2
test(ci): update drone.yml
May 31, 2021
6c41f29
test(ci): update drone.yml
May 31, 2021
b97a16e
test(ci): update drone.yml
Jun 1, 2021
3e33e4b
test(ci): update drone.yml
Jun 1, 2021
483303a
test(ci): update drone.yml
Jun 1, 2021
54a61c9
test(ci): update drone.yml
Jun 1, 2021
6cb726c
test(ci): update tests config.json
Jun 1, 2021
4c92c9a
test(ci): update drone.yml
Jun 1, 2021
30eb88b
test(ci): update drone.yml
Jun 1, 2021
8e06387
test(ci): update drone.yml
Jun 1, 2021
7c5f879
test(ci): update drone.yml
Jun 1, 2021
c349b99
test(ci): upgrade drone ci
Jun 1, 2021
85992eb
test(ci): update drone.yml
Jun 1, 2021
3560f16
test(ci): update drone.yml
Jun 1, 2021
d89838f
test(ci): upgrade drone ci
Jun 1, 2021
7595a74
test(ci): upgrade drone ci
Jun 1, 2021
dede9c2
test(ci): upgrade drone ci
Jun 1, 2021
e694251
test(ci): update drone.yml
Jun 1, 2021
770516b
test(ci): upgrade drone ci
Jun 1, 2021
f33f5c5
test(ci): upgrade drone ci
Jun 1, 2021
ee64708
test(ci): upgrade drone ci
Jun 1, 2021
04e06a5
test(ci): upgrade drone ci
Jun 1, 2021
631dc6f
test(ci): upgrade drone ci
Jun 1, 2021
5ecb38d
test(ci): update drone.yml
Jun 1, 2021
7b7c8cb
test(ci): update drone.yml
Jun 1, 2021
bb81cbe
test(ci): update drone.yml
Jun 1, 2021
fae447d
test(ci): update drone.yml
Jun 1, 2021
c83a1e9
test(ci): update drone ci
Jun 1, 2021
d8b5926
test(ci): update drone.yml
Jun 1, 2021
7e07787
test(ci): finally finish upgrade drone ci
Jun 1, 2021
7309bc0
test(ci): update drone ci
Jun 1, 2021
b888a60
test(ci): update drone ci
Jun 1, 2021
b1ac7b4
test(ci): update README
Jun 1, 2021
db3d516
test(ci): update ui test
Jun 1, 2021
79105d1
Merge pull request #443 from GoAdminGroup/dev.common
Jun 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
---
kind: pipeline
type: docker
name: api_mysql

trigger:
event:
- pull_request

clone:
disable: true

services:
- name: db_mysql
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: go-admin-test

steps:
- name: api
image: chg80333/goadmin-test:v7
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
commands:
- cd /go/src/github.com/GoAdminGroup/go-admin
- git pull
- git checkout $DRONE_COMMIT
- sleep 80
- make mysql-test

---
kind: pipeline
type: docker
name: api_mssql

trigger:
event:
- pull_request

clone:
disable: true

volumes:
- name: data
temp: {}

services:
- name: db_mssql
image: mcr.microsoft.com/mssql/server:2017-latest
volumes:
- name: data
path: /home/data
environment:
ACCEPT_EULA: Y
SA_PASSWORD: Aa123456

steps:
- name: api
image: chg80333/goadmin-test:v7
volumes:
- name: data
path: /go/src/github.com/GoAdminGroup/go-admin/tests/data
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
commands:
- cd /go/src/github.com/GoAdminGroup/go-admin
- git pull
- git checkout $DRONE_COMMIT
- sleep 80
- make ms-test

---
kind: pipeline
type: docker
name: api_postgres

trigger:
event:
- pull_request

clone:
disable: true

services:
- name: db_pgsql
image: postgres:10
environment:
POSTGRES_USER: postgres
POSTGRES_DB: go-admin-test
POSTGRES_PASSWORD: root

steps:
- name: api
image: chg80333/goadmin-test:v7
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
commands:
- cd /go/src/github.com/GoAdminGroup/go-admin
- git pull
- git checkout $DRONE_COMMIT
- sleep 80
- make pg-test

---
kind: pipeline
type: docker
name: api_sqlite

trigger:
event:
- pull_request

clone:
disable: true

steps:
- name: api
image: chg80333/goadmin-test:v7
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
commands:
- cd /go/src/github.com/GoAdminGroup/go-admin
- git pull
- git checkout $DRONE_COMMIT
- sleep 80
- make sqlite-test

---
kind: pipeline
type: docker
name: frontend

trigger:
event:
- pull_request

clone:
disable: true

services:
- name: db_mysql
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: go-admin-test

steps:
- name: chrome
image: chg80333/goadmin-test:v7
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
commands:
- cd /go/src/github.com/GoAdminGroup/go-admin
- git pull
- git checkout $DRONE_COMMIT
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- sleep 8
- make web-test
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

28 changes: 15 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ TEST_CONFIG_MS_PATH=./../../common/config_ms.json
TEST_FRAMEWORK_DIR=./tests/frameworks

## database configs
MYSQL_HOST = 127.0.0.1
MYSQL_HOST = db_mysql
MYSQL_PORT = 3306
MYSQL_USER = root
MYSQL_PWD = root

POSTGRESSQL_HOST = db_pgsql
POSTGRESSQL_PORT = 5432
POSTGRESSQL_USER = postgres
POSTGRESSQL_PWD = root

TEST_DB = go-admin-test

all: test

## tests
Expand Down Expand Up @@ -79,25 +86,20 @@ import-sqlite:
cp ./tests/data/admin.db ./tests/common/admin.db

import-mysql:
mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} -e "create database if not exists \`go-admin-test\`"
mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} go-admin-test < ./tests/data/admin.sql
mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} -e "create database if not exists \`${TEST_DB}\`"
mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} ${TEST_DB} < ./tests/data/admin.sql

import-postgresql:
dropdb -U postgres go-admin-test
createdb -U postgres go-admin-test
psql -d go-admin-test -U postgres -f ./tests/data/admin_pg.sql
PGPASSWORD=${POSTGRESSQL_PWD} dropdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB}
PGPASSWORD=${POSTGRESSQL_PWD} createdb -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -U ${POSTGRESSQL_USER} ${TEST_DB}
PGPASSWORD=${POSTGRESSQL_PWD} psql -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -d ${TEST_DB} -U ${POSTGRESSQL_USER} -f ./tests/data/admin_pg.sql

import-mssql:
docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/home/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5"
/opt/mssql-tools/bin/sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/home/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5"

backup-mssql:
docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "BACKUP DATABASE [goadmin] TO DISK = N'/home/data/admin_ms.bak' WITH NOFORMAT, NOINIT, NAME = 'goadmin-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10"

fix-gf:
go get -u -v github.com/gogf/gf@v1.12.1
sudo chmod -R 777 $(GOPATH)/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go
sudo echo "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $(GOPATH)/pkg/mod/github.com/gogf/gf@v1.12.1/net/ghttp/ghttp_server_handler.go

cp-mod:
cp go.mod go.mod.old
cp go.sum go.sum.old
Expand Down Expand Up @@ -154,4 +156,4 @@ cli:
cp ./adm/build/windows/i386/adm_windows_i386_$(VERSION).zip ./adm/build/zip/
cp ./adm/build/mac/adm_darwin_x86_64_$(VERSION).zip ./adm/build/zip/

.PHONY: all fmt golint govet cp-mod restore-mod test black-box-test mysql-test sqlite-test import-sqlite import-mysql import-postgresql pg-test fix-gf lint cilint cli
.PHONY: all fmt golint govet cp-mod restore-mod test black-box-test mysql-test sqlite-test import-sqlite import-mysql import-postgresql pg-test lint cilint cli
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</p>

<p align="center">
<a href="https://travis-ci.com/GoAdminGroup/go-admin"><img alt="Go Report Card" src="https://api.travis-ci.com/GoAdminGroup/go-admin.svg?branch=master"></a>
<a href="http://drone.go-admin.com/GoAdminGroup/go-admin"><img alt="Build Status" src="http://drone.go-admin.com/api/badges/GoAdminGroup/go-admin/status.svg?ref=refs/heads/master"></a>
<a href="https://goreportcard.com/report/github.com/GoAdminGroup/go-admin"><img alt="Go Report Card" src="https://camo.githubusercontent.com/59eed852617e19c272a4a4764fd09c669957fe75/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f6368656e6867352f676f2d61646d696e"></a>
<a href="https://goreportcard.com/report/github.com/GoAdminGroup/go-admin"><img alt="golang" src="https://img.shields.io/badge/awesome-golang-blue.svg"></a>
<a href="https://t.me/joinchat/NlyH6Bch2QARZkArithKvg" rel="nofollow"><img alt="telegram" src="https://img.shields.io/badge/chat%20on-telegram-blue" style="max-width:100%;"></a>
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
遗失的Golang编写的数据可视化与管理平台构建框架
</p>
<p align="center">
<a href="https://travis-ci.com/GoAdminGroup/go-admin"><img alt="Go Report Card" src="https://api.travis-ci.com/GoAdminGroup/go-admin.svg?branch=master"></a>
<a href="http://drone.go-admin.com/GoAdminGroup/go-admin"><img alt="Build Status" src="http://drone.go-admin.com/api/badges/GoAdminGroup/go-admin/status.svg?ref=refs/heads/master"></a>
<a href="https://goreportcard.com/report/github.com/GoAdminGroup/go-admin"><img alt="Go Report Card" src="https://camo.githubusercontent.com/59eed852617e19c272a4a4764fd09c669957fe75/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f6368656e6867352f676f2d61646d696e"></a>
<a href="https://goreportcard.com/report/github.com/GoAdminGroup/go-admin"><img alt="golang" src="https://img.shields.io/badge/awesome-golang-blue.svg"></a>
<a href="https://t.me/joinchat/NlyH6Bch2QARZkArithKvg" rel="nofollow"><img alt="telegram" src="https://img.shields.io/badge/chat%20on-telegram-blue" style="max-width:100%;"></a>
Expand Down
2 changes: 1 addition & 1 deletion tests/common/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"database": {
"default": {
"host": "127.0.0.1",
"host": "db_mysql",
"port": "3306",
"user": "root",
"pwd": "root",
Expand Down
2 changes: 1 addition & 1 deletion tests/common/config_ms.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"database": {
"default": {
"host": "127.0.0.1",
"host": "db_mssql",
"port": "1433",
"user": "sa",
"pwd": "Aa123456",
Expand Down
2 changes: 1 addition & 1 deletion tests/common/config_pg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"database": {
"default": {
"host": "127.0.0.1",
"host": "db_pgsql",
"port": "5432",
"user": "postgres",
"pwd": "root",
Expand Down
3 changes: 1 addition & 2 deletions tests/frameworks/gf/gf.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,5 @@ func (hh *httpHandler) SetSrv(s *ghttp.Server) *httpHandler {
}

func (hh *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// NOTE: ╮(╯▽╰)╭
hh.srv.DefaultHttpHandle(w, r)
hh.srv.ServeHTTP(w, r)
}
2 changes: 1 addition & 1 deletion tests/web/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"database": {
"default": {
"host": "127.0.0.1",
"host": "db_mysql",
"port": "3306",
"user": "root",
"pwd": "root",
Expand Down
2 changes: 1 addition & 1 deletion tests/web/web_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func testEditPageOperations(page *Page) {
page.Value(birthdayField, "2010-09-05 00:00:00")
page.Value(passwordField, "12345678")
page.Value(ipField, "127.0.0.1")
page.Value(amountField, "15.00")
page.Value(amountField, "15")

page.Click(selectTab)

Expand Down