File tree Expand file tree Collapse file tree 12 files changed +83
-40
lines changed Expand file tree Collapse file tree 12 files changed +83
-40
lines changed Original file line number Diff line number Diff line change 76
76
go install github.com/tcnksm/[email protected]
77
77
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete -generatenotes ${CIRCLE_TAG} ./release
78
78
79
- docker :
79
+ build_docker :
80
+ resource_class : small
81
+ docker :
82
+ - image : cimg/base:2023.04
83
+ steps :
84
+ - checkout
85
+ - setup_remote_docker :
86
+ version : 20.10.18
87
+ - run : |
88
+ for cmd in ${cmds}; do
89
+ docker build -f ./cmd/${cmd}/Dockerfile -t robocupssl/${cmd}:latest .
90
+ done
91
+
92
+ publish_docker :
80
93
resource_class : small
81
94
docker :
82
95
- image : cimg/base:2023.04
89
102
TAG=${CIRCLE_TAG:1}
90
103
TAG=${TAG:-latest}
91
104
for cmd in ${cmds}; do
92
- docker build -t robocupssl/${cmd}:${TAG} .
105
+ docker build -f ./cmd/${cmd}/Dockerfile - t robocupssl/${cmd}:${TAG} .
93
106
docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"
94
107
docker push robocupssl/${cmd}:${TAG}
95
108
done
@@ -114,6 +127,7 @@ workflows:
114
127
filters : { branches: { ignore: /.*/ }, tags: { only: /^v.*/ } }
115
128
docker :
116
129
jobs :
117
- - docker :
130
+ - build_docker
131
+ - publish_docker :
118
132
context : docker hub
119
133
filters : { branches: { only: master }, tags: { only: /^v.*/ } }
Original file line number Diff line number Diff line change 1
- .circleci
2
- .idea
3
- .vscode
4
- .local
5
- /config
6
- /doc
7
- node_modules
8
- /proto
9
- .git
10
- /Dockerfile
11
- /.env
12
- /docker-compose.yaml
13
- /state-store.json.stream
14
- dist
1
+ *
2
+ ! cmd
3
+ ! frontend
4
+ ! internal
5
+ ! pkg
6
+ ! go.mod
7
+ ! go.sum
8
+
9
+ frontend /node_modules
10
+ frontend /dist
Original file line number Diff line number Diff line change @@ -17,3 +17,6 @@ indent_size = 4
17
17
[* .{yaml,json} ]
18
18
indent_style = space
19
19
indent_size = 2
20
+
21
+ [Makefile ]
22
+ indent_style = tab
Original file line number Diff line number Diff line change @@ -26,3 +26,6 @@ yarn-error.log*
26
26
27
27
# Local installations
28
28
/.local
29
+
30
+ # Make cache
31
+ /.frontend
Original file line number Diff line number Diff line change
1
+ .PHONY : all ssl-game-controller-docker ssl-ref-client-docker docker frontend test install proto
2
+
3
+ all : install docker
4
+
5
+ docker-ssl-game-controller :
6
+ docker build -f ./cmd/ssl-game-controller/Dockerfile -t ssl-game-controller:latest .
7
+
8
+ docker-ssl-ref-client :
9
+ docker build -f ./cmd/ssl-ref-client/Dockerfile -t ssl-ref-client:latest .
10
+
11
+ docker : docker-ssl-game-controller docker-ssl-ref-client
12
+
13
+ .frontend : $(shell find frontend/ -type f)
14
+ cd frontend && \
15
+ npm install && \
16
+ npm run build && \
17
+ touch ../.frontend
18
+
19
+ frontend : .frontend
20
+
21
+ test : frontend
22
+ go test ./...
23
+
24
+ install : frontend
25
+ go install -v ./...
26
+
27
+ proto :
28
+ tools/generateProto.sh
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ go run cmd/ssl-game-controller/main.go
149
149
### Build self-contained release binary
150
150
151
151
``` bash
152
- ./ install.sh
152
+ make install
153
153
```
154
154
155
155
### Test with autoRefs
Original file line number Diff line number Diff line change @@ -6,12 +6,7 @@ RUN npm run build
6
6
7
7
FROM golang:1.20-alpine AS build_go
8
8
WORKDIR /go/src/github.com/RoboCup-SSL/ssl-game-controller
9
- COPY cmd cmd
10
- COPY internal internal
11
- COPY pkg pkg
12
- COPY frontend frontend
13
- COPY go.mod .
14
- COPY go.sum .
9
+ COPY . .
15
10
COPY --from=build_node /tmp/ssl-game-controller/frontend/dist frontend/dist
16
11
RUN go install -v ./cmd/ssl-game-controller
17
12
@@ -20,6 +15,5 @@ FROM alpine:3
20
15
COPY --from=build_go /go/bin/ssl-game-controller /app/ssl-game-controller
21
16
RUN mkdir -p config && chown -R 1000: config
22
17
USER 1000
23
- EXPOSE 8081 10007 10008 10009 10011 10107 10108 10111
24
18
ENTRYPOINT ["/app/ssl-game-controller" ]
25
19
CMD []
Original file line number Diff line number Diff line change
1
+ FROM golang:1.20-alpine AS build_go
2
+ WORKDIR /go/src/github.com/RoboCup-SSL/ssl-game-controller
3
+ COPY . .
4
+ RUN go install -v ./cmd/ssl-ref-client
5
+
6
+ # Start fresh from a smaller image
7
+ FROM alpine:3
8
+ COPY --from=build_go /go/bin/ssl-ref-client /app/ssl-ref-client
9
+ USER 1000
10
+ ENTRYPOINT ["/app/ssl-ref-client" ]
11
+ CMD []
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ version: "3.1"
2
2
3
3
services :
4
4
ssl-game-controller :
5
- build : " ."
5
+ build :
6
+ context : .
7
+ dockerfile : ./cmd/ssl-game-controller/Dockerfile
6
8
command :
7
9
- " -visionAddress"
8
10
- " 224.5.23.2:10020"
Original file line number Diff line number Diff line change 6
6
"net/http"
7
7
)
8
8
9
- //go:embed dist/*
9
+ //go:embed dist
10
10
var content embed.FS
11
11
12
12
func HandleUi () {
You can’t perform that action at this time.
0 commit comments