Search code examples
dockergitlabgitlab-cigitlab-ci-runner

gitlab-ci docker | using build files outside container


Hey fellow developers,

I use gitlab-ci, with my own gitlab-runner running as a docker image on the server (Ubuntu 22.04, Docker 20.10, Docker image: gitlab/gitlab-runner:latest).

It builds, using npm install && npm run build a CRA build, this works.

I want to use the generated CRA build (bunch of javascript & co files) outside of the docker container. Copy it in a /var/www/html folder on the server side (same server than the docker container).

How can I do that ?

Thanks for any help.

EDIT: I cannot use docker cp since I'm 'inside' the container when the gitlab-ci job runs.


Solution

  • I finally end up by creating a second runner with shell executor, building and deploying the app.

    But there was a way to do what I did want, mount a volume in the container from the host where my build is used, and put the build in it, but it's more problems and code than using a second "shell" runner.

    Ty