diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index f269b3683..326fd9599 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -36,10 +36,12 @@ jobs: run: | make install - - name: Lint - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.26.0 - golangci-lint run --timeout=10m ./... + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v2.3.0 + with: + version: v1.33 + only-new-issues: false + args: --timeout 10m - name: Helm Lint run: | diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 780d026ff..1737a4c35 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -39,11 +39,13 @@ jobs: run: | make install - - name: Lint - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.26.0 - golangci-lint run --timeout=10m ./... - + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v2.3.0 + with: + version: v1.33 + only-new-issues: false + args: --timeout 10m + - name: Install kubectl run: | curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl" diff --git a/Makefile b/Makefile index 0588b2f43..d07db2b6a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # note: call scripts from /scripts -.PHONY: default build builder-image binary-image test stop clean-images clean push apply deploy release release-all manifest push clean-image +.PHONY: default build build-image test stop push apply deploy release release-all manifest push OS ?= linux ARCH ?= ??? @@ -9,12 +9,12 @@ ALL_ARCH ?= arm64 arm amd64 BUILDER ?= reloader-builder-${ARCH} BINARY ?= Reloader DOCKER_IMAGE ?= stakater/reloader -# Default value "dev" -TAG ?= v0.0.75.0 -REPOSITORY_GENERIC = ${DOCKER_IMAGE}:${TAG} -REPOSITORY_ARCH = ${DOCKER_IMAGE}:${TAG}-${ARCH} +# Default value "dev" VERSION ?= 0.0.1 + +REPOSITORY_GENERIC = ${DOCKER_IMAGE}:${VERSION} +REPOSITORY_ARCH = ${DOCKER_IMAGE}:v${VERSION}-${ARCH} BUILD= GOCMD = go @@ -29,20 +29,13 @@ install: build: "$(GOCMD)" build ${GOFLAGS} ${LDFLAGS} -o "${BINARY}" -builder-image: - docker buildx build --platform ${OS}/${ARCH} --build-arg GOARCH=$(ARCH) -t "${BUILDER}" --load -f build/package/Dockerfile.build . - -reloader-${ARCH}.tar: - docker buildx build --platform ${OS}/${ARCH} --build-arg GOARCH=$(ARCH) -t "${BUILDER}" --load -f build/package/Dockerfile.build . - docker run --platform ${OS}/${ARCH} --rm "${BUILDER}" > reloader-${ARCH}.tar - -binary-image: builder-image - cat reloader-${ARCH}.tar | docker buildx build --platform ${OS}/${ARCH} -t "${REPOSITORY_ARCH}" --load -f Dockerfile.run - +build-image: + docker buildx build --platform ${OS}/${ARCH} --build-arg GOARCH=$(ARCH) -t "${REPOSITORY_ARCH}" --load -f Dockerfile . push: docker push ${REPOSITORY_ARCH} -release: binary-image push manifest +release: build-image push manifest release-all: -rm -rf ~/.docker/manifests/* @@ -66,23 +59,6 @@ test: stop: @docker stop "${BINARY}" -clean-images: stop - -docker rmi "${BINARY}" - @for arch in $(ALL_ARCH) ; do \ - echo Clean image: $$arch ; \ - make clean-image ARCH=$$arch ; \ - done - -docker rmi "${REPOSITORY_GENERIC}" - -clean-image: - -docker rmi "${BUILDER}" - -docker rmi "${REPOSITORY_ARCH}" - -rm -rf ~/.docker/manifests/* - -clean: - "$(GOCMD)" clean -i - -rm -rf reloader-*.tar - apply: kubectl apply -f deployments/manifests/ -n temp-reloader diff --git a/build/package/Dockerfile.build b/build/package/Dockerfile.build deleted file mode 100644 index 2162b66a1..000000000 --- a/build/package/Dockerfile.build +++ /dev/null @@ -1,26 +0,0 @@ -FROM golang:1.15.2-alpine -LABEL maintainer "Stakater Team" - -ARG GOARCH=amd64 - -RUN apk -v --update \ - --no-cache \ - add git build-base - -WORKDIR "$GOPATH/src/github.com/stakater/Reloader" - -COPY go.mod go.sum ./ - -RUN go mod download - -COPY . . - -ENV CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH - -RUN go build -a --installsuffix cgo --ldflags="-s" -o /Reloader - -COPY build/package/Dockerfile.run / - -# Running this image produces a tarball suitable to be piped into another -# Docker build command. -CMD tar -cf - -C / Dockerfile.run Reloader diff --git a/build/package/Dockerfile.run b/build/package/Dockerfile.run deleted file mode 100644 index 079e88f32..000000000 --- a/build/package/Dockerfile.run +++ /dev/null @@ -1,14 +0,0 @@ -FROM alpine:3.11 -LABEL maintainer "Stakater Team" - -RUN apk add --update --no-cache ca-certificates - -COPY Reloader /bin/Reloader - -# On alpine 'nobody' has uid 65534 -USER 65534 - -# Port for metrics and probes -EXPOSE 9090 - -ENTRYPOINT ["/bin/Reloader"] diff --git a/stk.yaml b/stk.yaml deleted file mode 100644 index e30e7c8fb..000000000 --- a/stk.yaml +++ /dev/null @@ -1,4 +0,0 @@ -issues: - kind: 1 - url: https://aurorasolutions.atlassian.net - project: STK \ No newline at end of file