chore: build xfsprogs before binaries (#197)

Building xfsprogs before adding the soruce code will speed up builds.
This commit is contained in:
Andrew Rynhard 2018-11-10 15:00:19 -08:00 committed by GitHub
parent ab82aa7577
commit edbc84bfbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,11 @@ pipeline:
- image - image
stages: stages:
base: base:
artifacts:
- source: /src/github.com/autonomy/dianemo/src/initramfs/vendor
destination: ./vendor
tasks: tasks:
- xfsprogs
- src - src
osd: osd:
tasks: tasks:
@ -79,7 +83,6 @@ stages:
- blockd - blockd
initramfs: initramfs:
tasks: tasks:
- xfsprogs
- init - init
- initramfs - initramfs
image: image:
@ -88,11 +91,11 @@ stages:
generate: generate:
artifacts: artifacts:
- source: /src/github.com/autonomy/dianemo/src/initramfs/cmd/osd/proto - 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 - 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 - source: /src/github.com/autonomy/dianemo/src/initramfs/cmd/blockd/proto
destination: ./cmd/blockd destination: ./cmd/blockd/proto
tasks: tasks:
- proto - proto
test: test:
@ -124,6 +127,7 @@ tasks:
CMD false CMD false
init: init:
template: | template: |
FROM {{ .Repository }}:base AS {{ .Docker.CurrentStage }}
WORKDIR /src/github.com/autonomy/dianemo/src/initramfs/cmd/{{ .Docker.CurrentStage }} WORKDIR /src/github.com/autonomy/dianemo/src/initramfs/cmd/{{ .Docker.CurrentStage }}
{{ if and .Git.IsClean .Git.IsTag }} {{ if and .Git.IsClean .Git.IsTag }}
RUN GOOS=linux GOARCH=amd64 go build \ 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 RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.1
ENV GO111MODULE auto ENV GO111MODULE auto
WORKDIR /src/github.com/autonomy/dianemo/src/initramfs WORKDIR /src/github.com/autonomy/dianemo/src/initramfs
RUN cp /tools/lib/libblkid.* /lib \ COPY --from=xfsprogs {{ index .Variables "rootfs" }} {{ index .Variables "rootfs" }}
&& cp /tools/lib/libuuid.* /lib
COPY ./ ./ COPY ./ ./
RUN go mod download RUN go mod download
RUN go mod verify RUN go mod verify
RUN go mod vendor
CMD ["false"]
test: test:
template: | template: |
FROM {{ .Repository }}:base AS {{ .Docker.CurrentStage }} FROM {{ .Repository }}:base AS {{ .Docker.CurrentStage }}
@ -263,7 +268,12 @@ tasks:
ENTRYPOINT ["/{{ .Docker.CurrentStage }}"] ENTRYPOINT ["/{{ .Docker.CurrentStage }}"]
xfsprogs: xfsprogs:
template: | 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 }} WORKDIR /tmp/{{ .Docker.CurrentStage }}
RUN curl -L {{index .Variables "srcXfsprogs" }} | tar -xJ --strip-components=1 RUN curl -L {{index .Variables "srcXfsprogs" }} | tar -xJ --strip-components=1
RUN make \ RUN make \