如何通过Gitlab CI安装作曲家供应商?
我正在尝试在Gitlab CI上的存储库中创建 /供应商 /目录,因此我不必一直保留它,但是当我运行管道时,我得到的只是:
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
因此,文物是正确的,但仍会发布。 zip文件不包含 /供应商 /。实际上,该.zip与存储库相同。如何在CI上安装作曲家?
PS我的.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/
I'm trying to create /vendor/ directory inside a repository on gitlab CI so I wouldn't have to keep it all the time, but when I run pipelines, all I get is:
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
So, artifacts is correct, but still release .ZIP file does not contain /vendor/. In fact, that .ZIP is identical to repository. How can I install composer on CI though?
p.s. my .gitlab-ci.yml
is:
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/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论