Hyago Lopes
Hyago Lopes

Reputation: 1

Gitlab-runner fails to perform second job

I'm having a problem with the continuity of the task, where I create a GitLab-runner register and apply from the .gitlab-ci.yml file the register tag created it executes normally, however, if I perform a new commit or anything that needs to run it, it won't.

Image refers to the first job of the job successfully and second and another job of the job with error

First image successfully

First image successfully

Image with error

Code below the file .gitlab-ci.yml

image: docker:latest
services:
 - docker:dind

stages:
 - master

build:
  stage: master
  only:
   - master
  tags:
   - prod
  script:
   - sudo docker-compose -f docker-compose.yml build --no-cache
   - sudo docker-compose -f docker-compose.yml up -d

Explanation of what I want to accomplish, I need to create a pipeline where every time I commit or change the branch master, I perform the git pull on my SSH server, and after downloading the changed version, after doing it, I will upload the application on the docker.

Upvotes: 0

Views: 337

Answers (1)

sytech
sytech

Reputation: 40861

Your runner is not setup appropriately. The user the gitlab runner runs as does not have permission to write/delete in the build directories. Use chown/chmod to change the permissions under /home/gitlab-runner to ensure the gitlab-runner user has permission to read/write/delete files.

Upvotes: 1

Related Questions