From 39e5cbc182b2269576f6080f20ed9e6ffb94ce40 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Wed, 20 Jan 2021 22:42:52 +1300 Subject: [PATCH] Fix build-tarball: use dir shared between GitLab runner and Docker --- .gitlab-ci.yml | 6 +++++- builder/build-tarball | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82808ae..90eadc1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,15 +2,19 @@ image: docker services: - docker:dind +variables: + GITLAB_SHARED_DIND_DIR: /builds/$CI_PROJECT_PATH/shared + stages: - build - + build: stage: build script: - ls -l - pwd - apk add bash + - mkdir -p "$GITLAB_SHARED_DIND_DIR" && chmod 777 "$GITLAB_SHARED_DIND_DIR" - bash builder/build-tarball - bash builder/build-deb - mkdir output diff --git a/builder/build-tarball b/builder/build-tarball index 666bd15..ec85a4b 100755 --- a/builder/build-tarball +++ b/builder/build-tarball @@ -7,6 +7,8 @@ build_www_dir() { docker run --rm -v $PWD/builder/www:/build kasmweb/www:latest } +shared_with_docker_dir=${GITLAB_SHARED_DIND_DIR:-/tmp} + cd "$(dirname "$0")/.." build_www_dir @@ -14,9 +16,9 @@ build_www_dir docker pull ubuntu:18.04 docker build -t kasmvncbuilder:18.04 -f builder/dockerfile.ubuntu1804.build . mkdir -p builder/build -docker run -v /tmp:/build --rm kasmvncbuilder:18.04 +docker run -v $shared_with_docker_dir:/build --rm kasmvncbuilder:18.04 L_GID=$(id -g) L_UID=$(id -u) -chown $L_UID:$L_GID /tmp/kasmvnc.ubuntu_18.04.tar.gz -mv /tmp/kasmvnc.ubuntu_18.04.tar.gz $PWD/builder/build/ +chown $L_UID:$L_GID $shared_with_docker_dir/kasmvnc.ubuntu_18.04.tar.gz +mv $shared_with_docker_dir/kasmvnc.ubuntu_18.04.tar.gz $PWD/builder/build/