-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #3 from alpkeskin/v1
v1 to Main
- Loading branch information
Showing
34 changed files
with
2,072 additions
and
814 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v1 | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.23.4 | ||
|
||
- name: Install dependencies | ||
run: go mod download | ||
|
||
- name: Run unit tests | ||
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic | ||
|
||
- name: Upload coverage reports | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.txt | ||
flags: unittests | ||
fail_ci_if_error: true | ||
|
||
- name: Run linter | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: latest |
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 |
---|---|---|
|
@@ -23,4 +23,7 @@ go.work.sum | |
|
||
# Other | ||
.DS_Store | ||
*.txt | ||
*.txt | ||
|
||
# Logs | ||
*.log |
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,8 @@ | ||
# This is the official list of Rota Authors for copyright purposes. | ||
# Authors may be either individual people or legal entities. | ||
# | ||
# Not all individual contributors are authors. For the full list of | ||
# contributors, refer to the project's page on GitHub or the repo's | ||
# commit history. | ||
|
||
Alp Keskin <@alpkeskin> |
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,19 +1,36 @@ | ||
FROM golang:1.22-alpine AS build | ||
FROM golang:1.23.4-alpine AS build | ||
|
||
LABEL description="Rota IP Rotator" | ||
LABEL description="Rota Proxy" | ||
LABEL repository="https://github.com/alpkeskin/rota" | ||
LABEL maintainer="alpkeskin" | ||
|
||
WORKDIR /app | ||
|
||
COPY ./go.mod . | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN go build -ldflags "-s -w" \ | ||
-o ./bin/rota ./cmd/rota | ||
|
||
FROM alpine:latest | ||
|
||
FROM alpine:3.21 | ||
|
||
RUN mkdir -p /var/log/rota && \ | ||
mkdir -p /etc/rota && \ | ||
adduser -D rota && \ | ||
chown -R rota:rota /var/log/rota && \ | ||
chown -R rota:rota /etc/rota | ||
|
||
COPY --from=build /app/bin/rota /bin/rota | ||
ENV HOME / | ||
|
||
USER rota | ||
|
||
WORKDIR /etc/rota | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
|
||
ENTRYPOINT ["/bin/rota"] |
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
Oops, something went wrong.