Skip to content

Commit

Permalink
fix: remove version file
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 13, 2021
1 parent 940e449 commit 0d0c6d5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
needs: [ test ]
steps:
- uses: actions/checkout@v2
- run: touch shared/util/message
- uses: golangci/golangci-lint-action@v2
with:
version: v1.36.0
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY api/ api/
COPY shared/ shared/
COPY manager/ manager/
RUN go generate ./shared/util/version.go
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -o bin/manager ./manager
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -ldflags="-X 'github.com/argoproj-labs/argo-dataflow/shared/util.message=xx$(git log -n1 --oneline)'" -o bin/manager ./manager

FROM gcr.io/distroless/static:nonroot AS controller
WORKDIR /
Expand All @@ -32,9 +32,9 @@ COPY api/ api/
COPY shared/ shared/
COPY runner/ runner/
RUN go generate ./shared/util/version.go
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -o bin/runner ./runner
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -ldflags="-X 'github.com/argoproj-labs/argo-dataflow/shared/util.message=xx$(git log -n1 --oneline)'" -o bin/runner ./runner
COPY kill/ kill/
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -o bin/kill ./kill
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -ldflags="-X 'github.com/argoproj-labs/argo-dataflow/shared/util.message=xx$(git log -n1 --oneline)'" -o bin/kill ./kill

FROM gcr.io/distroless/static:nonroot AS runner
WORKDIR /
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build: generate manifests
go build ./...

# Run tests
test: shared/util/message
test:
go test -v ./... -coverprofile cover.out

pre-commit: codegen test install lint
Expand Down Expand Up @@ -96,7 +96,7 @@ api/v1alpha1/generated.%: $(shell find api/v1alpha1 -type f -name '*.go' -not -n
mv api/v1alpha1/groupversion_info.go.0 api/v1alpha1/groupversion_info.go
go mod tidy

lint: shared/util/message
lint:
go mod tidy
golangci-lint run --fix
kubectl apply --dry-run=client -f docs/examples
Expand Down Expand Up @@ -126,7 +126,7 @@ scan-%:
changelog:
git log --oneline -n10 > changelog

$(GOBIN)/controller-gen: shared/util/message
$(GOBIN)/controller-gen:
go install sigs.k8s.io/controller-tools/cmd/[email protected]

version:=2.3.2
Expand All @@ -150,11 +150,8 @@ config/nats/single-server-nats.yml:
config/stan/single-server-stan.yml:
curl -o config/stan/single-server-stan.yml https://raw.githubusercontent.com/nats-io/k8s/v0.7.4/nats-streaming-server/single-server-stan.yml

shared/util/message:
touch shared/util/message

.PHONY: test-examples
test-examples: shared/util/message
test-examples:
go test -timeout 20m -v -tags examples -count 1 ./docs/examples

argocli:
Expand Down
11 changes: 5 additions & 6 deletions shared/util/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)

//go:generate sh -c "git log -n1 --oneline > message"
//go:embed message
var message string

var logger = zap.New()
var (
message string
logger = zap.New()
)

func init() {
logger.Info("git", "message", message)
logger.Info("version", "message", message)
}

0 comments on commit 0d0c6d5

Please sign in to comment.