File tree 4 files changed +28
-0
lines changed
4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 26
26
uses : actions/setup-go@v4
27
27
with :
28
28
go-version : 1.19
29
+
30
+ - name : Set up db
31
+ run : |
32
+ cd server
33
+ make run-db
29
34
30
35
- name : Build
31
36
run : cd server && go build -v ./...
Original file line number Diff line number Diff line change
1
+ DB_DATABASE=hoge
2
+ DB_HOST="glyph-database"
3
+ DB_USER=hoge
4
+ DB_PASSWORD=hoge
Original file line number Diff line number Diff line change 5
5
ENV_LOCAL_FILE := .env.local
6
6
ENV_LOCAL = $(shell cat $(ENV_LOCAL_FILE ) )
7
7
8
+ ENV_SAMPLE_FILE = .env.db.sample
9
+ ENV_SAMPLE = $(shell cat $(ENV_SAMPLE_FILE ) )
10
+
11
+
8
12
# go
9
13
GO := go run
10
14
11
15
# docker
12
16
DOCKER_FILE_DIR := ./docker
17
+ DOCKER_COMPOSE_CI := $(DOCKER_FILE_DIR ) /docker-compose.ci.yml
13
18
DOCKER_COMPOSE_LOCAL := $(DOCKER_FILE_DIR ) /docker-compose.local.yml
14
19
DOCKER_COMPOSE_LOCAL_DATABASE := $(DOCKER_FILE_DIR ) /docker-compose.local.database.yml
15
20
DOCKER_COMPOSE_LOCAL_SERVER := $(DOCKER_FILE_DIR ) /docker-compose.local.server.yml
@@ -44,6 +49,13 @@ fclean:down del-volumes ## マウントしたデータを削除、またdocker
44
49
.PHONY : re
45
50
re :fclean up # # 完全に初期化した状態でdocker環境を立ち上げる
46
51
52
+ .PHONY : run-db
53
+ run-db :
54
+ $(ENV_SAMPLE ) docker-compose \
55
+ -f $(DOCKER_COMPOSE_CI ) \
56
+ -f $(DOCKER_COMPOSE_LOCAL_DATABASE ) up
57
+
58
+
47
59
.PHONY : del-volumes
48
60
del-volumes :del-data
49
61
Original file line number Diff line number Diff line change
1
+ version : " 3"
2
+
3
+ services :
4
+ database :
5
+ container_name : glyph-database
6
+ restart : always
7
+ tty : true
You can’t perform that action at this time.
0 commit comments