-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
126 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
.idea/ | ||
.vscode/ | ||
|
||
vendor/ | ||
release/ | ||
logs/ | ||
|
||
*local.yaml | ||
rcon-cli | ||
rcon-cli.exe | ||
gorcon | ||
*.log | ||
.tmp/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include scripts/*.mk | ||
|
||
.DEFAULT_GOAL := nothing | ||
|
||
nothing: | ||
@echo "nothing to do" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION=docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Stage 1 - Build the code. | ||
FROM golang:1.16.7-alpine as builder | ||
|
||
RUN apk --no-cache add --update gcc musl-dev | ||
|
||
ARG VERSION=docker | ||
|
||
WORKDIR /build | ||
COPY cmd cmd | ||
COPY internal internal | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN CGO_ENABLED=1 go build -ldflags "-s -w -X main.ServiceVersion=${VERSION}" -o gorcon ./cmd/gorcon/main.go | ||
|
||
# Stage 2 - Create image. | ||
FROM alpine as runner | ||
MAINTAINER Pavel Korotkiy <paul.korotkiy@gmail.com> | ||
|
||
COPY LICENSE / | ||
COPY README.md / | ||
COPY CHANGELOG.md / | ||
COPY rcon.yaml / | ||
COPY --from=builder /build/gorcon /rcon | ||
|
||
CMD ["/rcon"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
include build/docker/.env | ||
export | ||
|
||
## If the first argument is "docker-deploy"... | ||
#ifeq (docker-run, $(firstword $(MAKECMDGOALS))) | ||
# # use the rest as arguments for "run" | ||
# RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) | ||
# # ...and turn them into do-nothing targets | ||
# $(eval $(RUN_ARGS):;@:) | ||
#endif | ||
|
||
IMAGES := `docker images --filter "dangling=true" -q --no-trunc` | ||
|
||
docker-clean: | ||
docker rmi ${IMAGES} 2> /dev/null ||: | ||
|
||
docker-build: | ||
docker build -f build/docker/Dockerfile \ | ||
--build-arg VERSION="${VERSION}" \ | ||
-t outdead/rcon . | ||
|
||
docker rmi ${IMAGES} 2> /dev/null ||: | ||
|
||
# make docker-run e=pz4 command=players | ||
docker-run: | ||
docker run -it --rm \ | ||
-v $(CURDIR)/rcon-local.yaml:/rcon.yaml \ | ||
outdead/rcon ./rcon -c rcon.yaml -e $(e) $(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# If the first argument is "docker-deploy"... | ||
ifeq (build, $(firstword $(MAKECMDGOALS))) | ||
# use the rest as arguments for "run" | ||
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) | ||
# ...and turn them into do-nothing targets | ||
$(eval $(RUN_ARGS):;@:) | ||
endif | ||
|
||
build: | ||
sh scripts/local/build.sh $(RUN_ARGS) | ||
|
||
run: | ||
sh scripts/local/run.sh | ||
|
||
lint: | ||
golangci-lint run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
go run cmd/gorcon/main.go -c rcon-local.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include scripts/docker/docker.mk | ||
include scripts/local/local.mk |