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 7676 go install github.com/tcnksm/ghr@v0.16.0
7777 ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete -generatenotes ${CIRCLE_TAG} ./release
7878
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 :
8093 resource_class : small
8194 docker :
8295 - image : cimg/base:2023.04
89102 TAG=${CIRCLE_TAG:1}
90103 TAG=${TAG:-latest}
91104 for cmd in ${cmds}; do
92- docker build -t robocupssl/${cmd}:${TAG} .
105+ docker build -f ./cmd/${cmd}/Dockerfile - t robocupssl/${cmd}:${TAG} .
93106 docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"
94107 docker push robocupssl/${cmd}:${TAG}
95108 done
@@ -114,6 +127,7 @@ workflows:
114127 filters : { branches: { ignore: /.*/ }, tags: { only: /^v.*/ } }
115128 docker :
116129 jobs :
117- - docker :
130+ - build_docker
131+ - publish_docker :
118132 context : docker hub
119133 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
1717[* .{yaml,json} ]
1818indent_style = space
1919indent_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*
2626
2727# Local installations
2828/.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
149149### Build self-contained release binary
150150
151151``` bash
152- ./ install.sh
152+ make install
153153```
154154
155155### Test with autoRefs
Original file line number Diff line number Diff line change @@ -6,12 +6,7 @@ RUN npm run build
66
77FROM golang:1.20-alpine AS build_go
88WORKDIR /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 . .
1510COPY --from=build_node /tmp/ssl-game-controller/frontend/dist frontend/dist
1611RUN go install -v ./cmd/ssl-game-controller
1712
@@ -20,6 +15,5 @@ FROM alpine:3
2015COPY --from=build_go /go/bin/ssl-game-controller /app/ssl-game-controller
2116RUN mkdir -p config && chown -R 1000: config
2217USER 1000
23- EXPOSE 8081 10007 10008 10009 10011 10107 10108 10111
2418ENTRYPOINT ["/app/ssl-game-controller" ]
2519CMD []
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"
22
33services :
44 ssl-game-controller :
5- build : " ."
5+ build :
6+ context : .
7+ dockerfile : ./cmd/ssl-game-controller/Dockerfile
68 command :
79 - " -visionAddress"
810 - " 224.5.23.2:10020"
Original file line number Diff line number Diff line change 66 "net/http"
77)
88
9- //go:embed dist/*
9+ //go:embed dist
1010var content embed.FS
1111
1212func HandleUi () {
You can’t perform that action at this time.
0 commit comments