mirror of
https://github.com/zrepl/zrepl.git
synced 2025-06-14 13:56:46 +02:00
build: fix build.Dockerfile + integrate into CircleCI
fixup of 080f2c0616d536cc1887a1ab3120c760e86a2e07 fixup of 4994b7a9eaea199e8c8533be74a1a1cb7ec2e5fd
This commit is contained in:
parent
5e17d7ba80
commit
c24c327151
@ -7,7 +7,9 @@ workflows:
|
|||||||
- build-1.12
|
- build-1.12
|
||||||
- build-1.13
|
- build-1.13
|
||||||
- build-latest
|
- build-latest
|
||||||
|
- test-build-in-docker
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
# build-latest serves as the template
|
# build-latest serves as the template
|
||||||
# we use YAML anchors & aliases to exchange the docker image (and hence Go version used for the build)
|
# we use YAML anchors & aliases to exchange the docker image (and hence Go version used for the build)
|
||||||
build-latest: &build-latest
|
build-latest: &build-latest
|
||||||
@ -108,3 +110,30 @@ jobs:
|
|||||||
<<: *build-latest
|
<<: *build-latest
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.13
|
- image: circleci/golang:1.13
|
||||||
|
|
||||||
|
# this job tries to mimic the build-in-docker instructions
|
||||||
|
# given in docs/installation.rst
|
||||||
|
#
|
||||||
|
# However, CircleCI doesn't support volume mounts, so we have to copy
|
||||||
|
# the source into the build-container by modifying the Dockerfile
|
||||||
|
test-build-in-docker:
|
||||||
|
description: Check that build-in-docker works
|
||||||
|
docker:
|
||||||
|
- image: circleci/golang:latest
|
||||||
|
environment:
|
||||||
|
working_directory: /go/src/github.com/zrepl/zrepl
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- setup_remote_docker
|
||||||
|
- run:
|
||||||
|
name: (hacky) circleci doesn't allow volume mounts, so copy src to container
|
||||||
|
command: echo "ADD . /src" >> build.Dockerfile
|
||||||
|
- run:
|
||||||
|
name: (hacky) commit modified Dockerfile to avoid failing git clean check in Makefile
|
||||||
|
command: git -c user.name='circleci' -c user.email='circleci@localhost' commit -m 'CIRCLECI modified Dockerfile with zrepl src' --author 'autoauthor <circleci@localhost>' -- build.Dockerfile
|
||||||
|
- run:
|
||||||
|
name: build the build image (build deps)
|
||||||
|
command: docker build -t zrepl_build -f build.Dockerfile .
|
||||||
|
- run:
|
||||||
|
name: try compiling
|
||||||
|
command: docker run -it zrepl_build make release
|
@ -2,7 +2,8 @@ FROM golang:latest
|
|||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
unzip
|
unzip \
|
||||||
|
gawk
|
||||||
|
|
||||||
ADD build.installprotoc.bash ./
|
ADD build.installprotoc.bash ./
|
||||||
RUN bash build.installprotoc.bash
|
RUN bash build.installprotoc.bash
|
||||||
@ -22,7 +23,7 @@ RUN mkdir -p /.cache && chmod -R 0777 /.cache
|
|||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Install build tools (e.g. protobuf generator, stringer) into $GOPATH/bin
|
# Install build tools (e.g. protobuf generator, stringer) into $GOPATH/bin
|
||||||
ADD go.mod go.sum ./
|
ADD build/ /tmp/build
|
||||||
RUN /tmp/lazy.sh godep
|
RUN /tmp/lazy.sh godep
|
||||||
|
|
||||||
RUN chmod -R 0777 /go
|
RUN chmod -R 0777 /go
|
||||||
|
Loading…
x
Reference in New Issue
Block a user