From edbc84bfbe5a4ddecdf560bb3e55bcb34be0d073 Mon Sep 17 00:00:00 2001 From: Andrew Rynhard Date: Sat, 10 Nov 2018 15:00:19 -0800 Subject: [PATCH] chore: build xfsprogs before binaries (#197) Building xfsprogs before adding the soruce code will speed up builds. --- src/initramfs/.conform.yaml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/initramfs/.conform.yaml b/src/initramfs/.conform.yaml index 067dd5180..3f4d343ed 100644 --- a/src/initramfs/.conform.yaml +++ b/src/initramfs/.conform.yaml @@ -55,7 +55,11 @@ pipeline: - image stages: base: + artifacts: + - source: /src/github.com/autonomy/dianemo/src/initramfs/vendor + destination: ./vendor tasks: + - xfsprogs - src osd: tasks: @@ -79,7 +83,6 @@ stages: - blockd initramfs: tasks: - - xfsprogs - init - initramfs image: @@ -88,11 +91,11 @@ stages: generate: artifacts: - source: /src/github.com/autonomy/dianemo/src/initramfs/cmd/osd/proto - destination: ./cmd/osd + destination: ./cmd/osd/proto - source: /src/github.com/autonomy/dianemo/src/initramfs/cmd/trustd/proto - destination: ./cmd/trustd + destination: ./cmd/trustd/proto - source: /src/github.com/autonomy/dianemo/src/initramfs/cmd/blockd/proto - destination: ./cmd/blockd + destination: ./cmd/blockd/proto tasks: - proto test: @@ -124,6 +127,7 @@ tasks: CMD false init: template: | + FROM {{ .Repository }}:base AS {{ .Docker.CurrentStage }} WORKDIR /src/github.com/autonomy/dianemo/src/initramfs/cmd/{{ .Docker.CurrentStage }} {{ if and .Git.IsClean .Git.IsTag }} RUN GOOS=linux GOARCH=amd64 go build \ @@ -232,11 +236,12 @@ tasks: RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.1 ENV GO111MODULE auto WORKDIR /src/github.com/autonomy/dianemo/src/initramfs - RUN cp /tools/lib/libblkid.* /lib \ - && cp /tools/lib/libuuid.* /lib + COPY --from=xfsprogs {{ index .Variables "rootfs" }} {{ index .Variables "rootfs" }} COPY ./ ./ RUN go mod download RUN go mod verify + RUN go mod vendor + CMD ["false"] test: template: | FROM {{ .Repository }}:base AS {{ .Docker.CurrentStage }} @@ -263,7 +268,12 @@ tasks: ENTRYPOINT ["/{{ .Docker.CurrentStage }}"] xfsprogs: template: | - FROM {{ .Repository }}:base AS {{ .Docker.CurrentStage }} + FROM dianemo/tools:{{ .Docker.Image.Tag }} AS {{ .Docker.CurrentStage }} + RUN ln -s /tools/lib64 /lib64 + RUN mkdir -p /etc/ssl/certs + RUN ln -s /tools/etc/ssl/certs/ca-certificates /etc/ssl/certs/ca-certificates + RUN cp /tools/lib/libblkid.* /lib \ + && cp /tools/lib/libuuid.* /lib WORKDIR /tmp/{{ .Docker.CurrentStage }} RUN curl -L {{index .Variables "srcXfsprogs" }} | tar -xJ --strip-components=1 RUN make \