-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nieuwsma/training
Training
- Loading branch information
Showing
1,383 changed files
with
1,042 additions
and
633,900 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.idea/ | ||
bin/ |
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 @@ | ||
1.0.0 |
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,51 @@ | ||
# Copyright | ||
|
||
# Dockerfile for building Dimension server | ||
# Build base just has the packages installed we need. | ||
FROM golang:1.20-alpine AS build-base | ||
RUN echo "GOPATH is set to: $GOPATH" | ||
|
||
RUN set -ex \ | ||
&& apk -U upgrade \ | ||
&& apk add build-base | ||
|
||
# Base copies in the files we need to test/build. | ||
FROM build-base AS base | ||
|
||
|
||
RUN go env -w GO111MODULE=auto | ||
|
||
# Copy all the necessary files to the image. | ||
COPY cmd $GOPATH/src/github.com/nieuwsma/dimension/cmd | ||
COPY vendor $GOPATH/src/github.com/nieuwsma/dimension/vendor | ||
COPY pkg $GOPATH/src/github.com/nieuwsma/dimension/pkg | ||
COPY internal $GOPATH/src/github.com/nieuwsma/dimension/internal | ||
COPY .version $GOPATH/src/github.com/nieuwsma/dimension/.version | ||
|
||
### Build Stage ### | ||
FROM base AS builder | ||
|
||
RUN set -ex && go build -v -o /usr/local/bin/server github.com/nieuwsma/dimension/cmd/server | ||
|
||
### Final Stage ### | ||
|
||
FROM alpine:3 | ||
LABEL maintainer="Nieuwsma" | ||
EXPOSE 28007 | ||
STOPSIGNAL SIGTERM | ||
|
||
RUN set -ex \ | ||
&& apk -U upgrade | ||
|
||
# Get the system-power-capping-service from the builder stage. | ||
COPY --from=builder /usr/local/bin/server /usr/local/bin/. | ||
COPY .version / | ||
|
||
|
||
ENV LOG_LEVEL "TRACE" | ||
ENV PORT "8080" | ||
|
||
#nobody 65534:65534 | ||
USER 65534:65534 | ||
|
||
CMD ["sh", "-c", "server $@"] |
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,24 @@ | ||
# Copyright | ||
# This file only exists as a means to run tests in an automated fashion. | ||
|
||
FROM golang:1.20-alpine | ||
|
||
RUN set -ex \ | ||
&& apk -U upgrade \ | ||
&& apk add build-base | ||
ENV LOG_LEVEL "WARN" | ||
ENV TEST_DIR "$GOPATH/src/github.com/nieuwsma/dimension/pkg/logic/test_cases" | ||
|
||
|
||
RUN go env -w GO111MODULE=auto | ||
|
||
COPY cmd $GOPATH/src/github.com/nieuwsma/dimension/cmd | ||
COPY vendor $GOPATH/src/github.com/nieuwsma/dimension/vendor | ||
COPY pkg $GOPATH/src/github.com/nieuwsma/dimension/pkg | ||
COPY internal $GOPATH/src/github.com/nieuwsma/dimension/internal | ||
COPY .version $GOPATH/src/github.com/nieuwsma/dimension/.version | ||
|
||
CMD set -ex \ | ||
&& go version \ | ||
&& go test -cover -v -o dimension github.com/nieuwsma/dimension/internal/api \ | ||
&& go test -cover -v -o dimension github.com/nieuwsma/dimension/pkg/logic |
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,33 @@ | ||
# Copyright | ||
|
||
# Service | ||
NAME ?= dimension | ||
VERSION ?= $(shell cat .version) | ||
|
||
|
||
all: image unittest server | ||
|
||
binary: server | ||
|
||
#create server binary | ||
server: | ||
go build -v -o bin/server github.com/nieuwsma/dimension/cmd/server | ||
|
||
#create docker image for server | ||
image: | ||
docker build --pull ${DOCKER_ARGS} --tag '${NAME}:${VERSION}' -f Dockerfile . | ||
|
||
#run all tests | ||
test: unittest | ||
|
||
#run unit tests | ||
unittest: | ||
./runUnitTest.sh | ||
|
||
#empty the bin | ||
clean: | ||
rm bin/* | ||
|
||
#generate lines of code in project | ||
cloc: | ||
cloc --exclude-dir=vendor,data_processing,test,.docker,.DS_Store,.git,.idea,bin,configs --exclude-ext=.json,JSON --exclude-lang=JSON . |
Oops, something went wrong.