mirror of
https://github.com/astaxie/beego.git
synced 2024-11-24 22:10:54 +00:00
Add docker-compose to support running test
This commit is contained in:
parent
d6ef33feee
commit
ca9b21bb30
14
test.sh
Normal file
14
test.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker-compose -f test_docker_compose.yaml up -d
|
||||||
|
|
||||||
|
export ORM_DRIVER=mysql
|
||||||
|
export TZ=UTC
|
||||||
|
export ORM_SOURCE="beego:test@tcp(localhost:13306)/orm_test?charset=utf8"
|
||||||
|
|
||||||
|
go test ./...
|
||||||
|
|
||||||
|
# clear all container
|
||||||
|
docker-compose -f test_docker_compose.yaml down
|
||||||
|
|
||||||
|
|
39
test_docker_compose.yaml
Normal file
39
test_docker_compose.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
redis:
|
||||||
|
container_name: "beego-redis"
|
||||||
|
image: redis
|
||||||
|
environment:
|
||||||
|
- ALLOW_EMPTY_PASSWORD=yes
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
container_name: "beego-mysql"
|
||||||
|
image: mysql:5.7.30
|
||||||
|
ports:
|
||||||
|
- "13306:3306"
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=1q2w3e
|
||||||
|
- MYSQL_DATABASE=orm_test
|
||||||
|
- MYSQL_USER=beego
|
||||||
|
- MYSQL_PASSWORD=test
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
container_name: "beego-postgresql"
|
||||||
|
image: bitnami/postgresql:latest
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
environment:
|
||||||
|
- ALLOW_EMPTY_PASSWORD=yes
|
||||||
|
ssdb:
|
||||||
|
container_name: "beego-ssdb"
|
||||||
|
image: wendal/ssdb
|
||||||
|
ports:
|
||||||
|
- "8888:8888"
|
||||||
|
memcache:
|
||||||
|
container_name: "beego-memcache"
|
||||||
|
image: memcached
|
||||||
|
ports:
|
||||||
|
- "11211:11211"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user