Skip to content

Commit

Permalink
keep utask version while using the Makefile inside the Docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley GALIPO <[email protected]>
  • Loading branch information
Galiley authored and rclsilver committed Jun 27, 2023
1 parent 814b9f0 commit 12e3dcd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ FROM golang:1.20

COPY . /go/src/github.com/ovh/utask
WORKDIR /go/src/github.com/ovh/utask
RUN make re && \
mv hack/Makefile-child Makefile && \
RUN make re && make makefile && \
mkdir -p /app/plugins /app/templates /app/config /app/init /app/static/dashboard && \
mv hack/wait-for-it/wait-for-it.sh /wait-for-it.sh && \
chmod +x /wait-for-it.sh
chmod +x /wait-for-it.sh && \
go clean -cache && rm -rf /go/pkg/*
WORKDIR /app

COPY --from=js-builder /home/node/ui/dashboard/dist/utask-ui/ /app/static/dashboard/
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ifndef VERSION
VERSION = $(shell git describe --abbrev=3 --tags $(git rev-list --tags --max-count=1))-dev
endif

LAST_COMMIT = `git rev-parse HEAD`
LAST_COMMIT := $(shell git rev-parse HEAD)
VERSION_PKG = github.com/ovh/utask

DOCKER = 0
Expand Down Expand Up @@ -93,4 +93,7 @@ endif

package:

.PHONY: all clean test re package release test test-travis test-docker run-test-stack run-test-stack-docker run-goreleaser docker
makefile:
sed -e 's/VERSION=/VERSION=${VERSION}/g' hack/Makefile-child | sed -e 's/LAST_COMMIT=/LAST_COMMIT=${LAST_COMMIT}/g' >| Makefile

.PHONY: all clean test re package release test test-travis test-docker run-test-stack run-test-stack-docker run-goreleaser docker makefile
5 changes: 4 additions & 1 deletion hack/Makefile-child
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
LAST_COMMIT=
VERSION=

all:
GO111MODULE=on go get -d -v ./...
GO111MODULE=on go build -o utask ./cmd/utask
GO111MODULE=on go build -ldflags "-X github.com/ovh/utask.Commit=${LAST_COMMIT} -X github.com/ovh/utask.Version=${VERSION}" -o utask ./cmd/utask
for p in $$(ls ./plugins); do if [ -d ./plugins/$$p ]; then GO111MODULE=on go build --buildmode=plugin -o ./plugins/$$p.so ./plugins/$$p/*.go; fi; done
for p in $$(ls ./init); do if [ -d ./init/$$p ]; then GO111MODULE=on go build --buildmode=plugin -o ./init/$$p.so ./init/$$p/*.go; fi; done

Expand Down

0 comments on commit 12e3dcd

Please sign in to comment.