From c44dccc34be54ef0247a88302e9db21decd4070b Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Tue, 25 Aug 2020 23:34:09 +0200 Subject: [PATCH] build: circleci: switch to 'machine' executor for test-build-in-docker job refs #356 --- .circleci/config.yml | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96e061d..ef4017b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,29 +129,18 @@ jobs: docker: - image: circleci/golang:1.14 - # 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 + # this job tests the build-in-docker instructions + # given in docs/installation/compile-from-source.rst 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 + machine: + image: default steps: - checkout - - setup_remote_docker + - run: docker build -t zrepl_build -f build.Dockerfile . - 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 ' -- 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 \ No newline at end of file + command: | + docker run -it --rm \ + -v "${PWD}:/src" \ + --user "$(id -u):$(id -g)" \ + zrepl_build make release