Le_Traceur_Snork
@Le_Traceur_Snork
PHP-программист | Wordpress

Как собрать composer vendor на Gitlab CI?

Есть репозиторий Wordpress-плагина на Gitlab'е, плагин использует внешнюю зависимость, подтягиваемую через composer. Чтобы не хранить vendor в репозитории, хочу собирать его каждый раз при сборке релиза и класть в архив релиза. Как это правильно делать, использую файл .gitlab-ci.yml?

Мой `.gitlab-ci.yml`:

image: composer:2

composer_install:
  stage: deploy
  before_script:
    - composer config -g cache-dir "$(pwd)/.composer-cache"
  script:
    - composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress
  artifacts:
    paths:
      - vendor/


На пайплайне получаю:
Running with gitlab-runner 14.8.2 (c6e7e194)
  on k8s-gitlab-runner hfVw4xNF
Preparing the "kubernetes" executor
00:00
Using Kubernetes namespace: gitlab-runner
Using Kubernetes executor with image composer:2 ...
Using attach strategy to execute scripts...
Preparing environment
00:09
Waiting for pod gitlab-runner/runner-hfvw4xnf-project-520-concurrent-0sn79m to be running, status is Pending
Waiting for pod gitlab-runner/runner-hfvw4xnf-project-520-concurrent-0sn79m to be running, status is Pending
    ContainersNotInitialized: "containers with incomplete status: [init-permissions]"
    ContainersNotReady: "containers with unready status: [build helper]"
    ContainersNotReady: "containers with unready status: [build helper]"
Waiting for pod gitlab-runner/runner-hfvw4xnf-project-520-concurrent-0sn79m to be running, status is Pending
    ContainersNotReady: "containers with unready status: [build helper]"
    ContainersNotReady: "containers with unready status: [build helper]"
Running on runner-hfvw4xnf-project-520-concurrent-0sn79m via gitlab-runner-gitlab-runner-6cd96486f4-s62w7...
Getting source from Git repository
00:00
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/saligzhanov.i/admin-changelog-md/.git/
Created fresh repository.
Checking out b5018ce4 as make-vendor-on-ci...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:02
$ composer config -g cache-dir "$(pwd)/.composer-cache"
$ composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 1 install, 0 updates, 0 removals
  - Downloading erusev/parsedown (1.7.4)
  - Installing erusev/parsedown (1.7.4): Extracting archive
Generating optimized autoload files
Uploading artifacts for successful job
00:00
Uploading artifacts...
vendor/: found 19 matching files and directories   
Uploading artifacts as "archive" to coordinator... 201 Created  id=910700 responseStatus=201 Created token=2nEedKzr
Cleaning up project directory and file based variables
00:01
Job succeeded
  • Вопрос задан
  • 179 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы