Commit 3a6f50e4 authored by pfandzelter's avatar pfandzelter
Browse files

fix goreleaser

parent b157020f
Pipeline #40258 passed with stages
in 19 minutes and 28 seconds
......@@ -6,33 +6,45 @@ stages:
- build
- release
before_script:
.dependencies: &dependencies
- make dep
golint:
stage: analysis
before_script:
*dependencies
script:
- make lint
unit_tests:
stage: test
retry: 2
before_script:
*dependencies
script:
- make test
race_detector:
stage: test
retry: 2
before_script:
*dependencies
script:
- make race
code_coverage:
stage: test
retry: 2
before_script:
*dependencies
script:
- make coverage
code_coverage_report:
stage: test
retry: 2
before_script:
*dependencies
script:
- make coverhtml
only:
......@@ -40,14 +52,17 @@ code_coverage_report:
build:
stage: build
before_script:
*dependencies
script:
- make
release:
stage: release
image: docker:stable
services:
- docker:dind
timeout: 20m
image:
name: goreleaser/goreleaser
entrypoint: [ '' ]
variables:
DOCKER_REGISTRY: $CI_REGISTRY
......@@ -63,13 +78,6 @@ release:
refs:
- tags
script: |
# GITLAB_TOKEN is needed to create GitLab releases.
# DOCKER_* are needed to push Docker images.
docker run --rm --privileged \
-v $PWD:/go/src/gitlab.com/YourGitLabUser/YourGitLabRepo \
-w /go/src/gitlab.com/YourGitLabUser/YourGitLabRepo \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOCKER_USERNAME -e DOCKER_PASSWORD -e DOCKER_REGISTRY \
-e GITLAB_TOKEN \
goreleaser/goreleaser release --rm-dist
\ No newline at end of file
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- goreleaser release --rm-dist
\ No newline at end of file
gitlab_urls:
api: https://git.tu-berlin.de/api/v4/
download: https://git.tu-berlin.de
builds:
-
id: "FReD"
main: ./cmd/frednode
binary: fred
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- id: "FReD Proxy"
main: ./cmd/fredproxy
binary: fredproxy
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- id: "ALExANDRA"
main: ./cmd/alexandra
binary: alexandra
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
dockers:
-
ids:
- FReD
goos: linux
goarch: amd64
dockerfile: Dockerfile
image_templates:
- "git.tu-berlin.de:5000/mcc-fred/fred/fred:{{ .Tag }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/fred:v{{ .Major }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/fred:v{{ .Major }}.{{ .Minor }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/fred:latest"
extra_files:
- pkg/
- cmd/
- proto/
- go.mod
- go.sum
- ids:
- FReD Proxy
goos: linux
goarch: amd64
dockerfile: proxy.Dockerfile
image_templates:
- "git.tu-berlin.de:5000/mcc-fred/fred/fredproxy:{{ .Tag }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/fredproxy:v{{ .Major }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/fredproxy:v{{ .Major }}.{{ .Minor }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/fredproxy:latest"
extra_files:
- pkg/
- cmd/
- proto/
- go.mod
- go.sum
- ids:
- ALeXANDRA
goos: linux
goarch: amd64
dockerfile: alexandra.Dockerfile
image_templates:
- "git.tu-berlin.de:5000/mcc-fred/fred/alexandra:{{ .Tag }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/alexandra:v{{ .Major }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/alexandra:v{{ .Major }}.{{ .Minor }}"
- "git.tu-berlin.de:5000/mcc-fred/fred/alexandra:latest"
extra_files:
- pkg/
- cmd/
- proto/
- go.mod
- go.sum
\ No newline at end of file
......@@ -33,7 +33,7 @@ coverhtml: ## Generate global code coverage report in HTML
@sh ./ci/tools/coverage.sh html;
dep: ## Get the dependencies
@go get -d ./...
@go mod download
build: dep ## Build the binary file
@go build -v $(PKG)/cmd/frednode
......@@ -45,7 +45,7 @@ container: ## Create a Docker container
@docker build . -t git.tu-berlin.de:5000/mcc-fred/fred/fred
docs: ## Build the FogStore documentation
@mdpdf docs/doc.md
@mdpdf docs/doc.md
help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
......@@ -11,6 +11,7 @@ import (
"github.com/DistributedClocks/GoVector/govec/vclock"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
dynamoDBTypes "github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/rs/zerolog"
......@@ -35,7 +36,7 @@ func TestMain(m *testing.M) {
ctx := context.Background()
req := testcontainers.ContainerRequest{
Image: "amazon/dynamodb-local:latest",
Image: "amazon/dynamodb-local@sha256:bdd26570dc0e0ae49e1ea9d49ff662a6a1afe9121dd25793dc40d02802e7e806",
Cmd: []string{"-jar", "DynamoDBLocal.jar", "-inMemory"},
ExposedPorts: []string{"8000/tcp"},
//BindMounts: map[string]string{"8000": "8000"},
......@@ -80,6 +81,8 @@ func TestMain(m *testing.M) {
log.Fatal().Msg(err.Error())
}
cfg.Credentials = credentials.NewStaticCredentialsProvider("TEST_KEY", "TEST_SECRET", "")
svc := dynamodb.New(dynamodb.Options{
Region: cfg.Region,
HTTPClient: cfg.HTTPClient,
......
......@@ -35,8 +35,7 @@ func TestMain(m *testing.M) {
},
)
zerolog.SetGlobalLevel(zerolog.ErrorLevel)
//zerolog.SetGlobalLevel(zerolog.DebugLevel)
zerolog.SetGlobalLevel(zerolog.FatalLevel)
fInfo, err := os.Stat(etcdDir)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment