Разрешение при повторной инициализации существующего репозитория Git - PullRequest
0 голосов
/ 11 марта 2020

Я использую Ubuntu 14.04 LTS с Gitlab Runnner v12.8.0.

Это мой .gitlab-ci.yml

image: docker:latest

before_script:
  - echo "(!) Starting process"

after_script:
  - echo "(!) Successfully ran process"

build_stage:
  stage: build
  script:
    # - sudo rm -rf ~/.m2/repository/me/pabloestrada/
    - sh lib/credentials/prod_build-persian.sh
    - sh lib/guice-quartz/prod_build-persian.sh
    - sh lib/persian-jobs/prod_build-persian.sh
    - sh persian-services/exercise-tracker/prod_build-persian.sh
    - mvn clean package -f service
    - mvn clean package -f scheduler
    - sudo npm install --prefix ui/
    - sudo npm run build --prefix ui/
    - docker-compose build

deploy_stage:
  stage: deploy
  script:
    - docker-compose up

Это мой config.toml

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "NAME"
  url = "URL"
  token = "TOKEN"
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]

Это мой / etc / sudoers

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults    env_reset
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

gitlab-runner ALL=(ALL) NOPASSWD: ALL

Всякий раз, когда я запускаю свой конвейер, он застревает в процессе сборки, потому что не может повторно инициализировать существующий репозиторий Git:

 Running with gitlab-runner 12.8.0 (1b659122)
   on PersianCI
Using Shell executor...
00:00
Running on VM...
00:00
Fetching changes with git depth set to 50...
00:00
 Reinitialized existing Git repository in /home/gitlab-runner/builds/_4pR7ipo/0/pablof300/Project/.git/
 Checking out 7ea332da as master...
 warning: failed to remove ui/build/service-worker.js: Permission denied
 warning: failed to remove ui/build/static/css/main.2c5be17a.chunk.css.map: Permission denied
 warning: failed to remove ui/build/static/css/main.2c5be17a.chunk.css: Permission denied
 warning: failed to remove ui/build/static/media/radnika-medium-webfont.352f4137.woff2: Permission denied
 warning: failed to remove ui/build/static/media/radnika-medium-webfont.0474c626.woff: Permission denied
 warning: failed to remove ui/build/static/media/exercise-tracker-service.d7b7664b.png: Permission denied

Кто-нибудь знает, почему у него нет разрешений на это?

...