push commit到gitlab时出错,管道错误无法读取Username



当我向gitlab提交更改并在cpanel上部署项目时。但是在管道中得到了这个错误。我在这个项目中使用laravel部署器,我想通过gitlab在cpanel上部署我的项目。

The command "cd /home/sfd/public_html && (/usr/local/cpanel/3rdparty/lib/pa  
th-bin/git clone   --recursive  https://gitlab.com/nas-project  
.git /home/sfd/public_html/releases/1 2>&1)" failed.                         
         
Exit Code: 128 (Invalid exit argument)                                       
         
Host Name: 51.75.174.102                                                     
         
================                                                             
Cloning into '/home/sfd/public_html/releases/1'...                           
fatal: could not read Username for 'https://gitlab.com': No such device or   
address

在这里我张贴我的一些代码,(运行程序代码,gitlab-ci。Yml,部署代码)

<<p>跑代码/strong>
[[runners]]
name = "DESKTOP-1OOOT34"
url = "https://gitlab.com/nas-project.git"
token = "mytoken"
executor = "shell"
shell = "powershell"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
<<p>Deploy.php代码/strong>
<?php
return [
'default' => 'basic',
'strategies' => [
//
],
'hooks' => [
'ready' => [
'artisan:storage:link',
'artisan:view:clear',
'artisan:config:cache',
'artisan:migrate',
],
],
'options' => [
'application' => env('APP_NAME', 'Laravel'),
'repository' => 'https://gitlab.com/n1063/suntop/nas-project.git',
],
'hosts' => [
'mysiteIP' => [
'deploy_path' => '/home/sfd/public_html',
'user' => 'sfd',
'multiplexing' => true,
'sshOptions'   => [
'StrictHostKeyChecking' => 'no',
// ...
],
],
],
'localhost' => [
//
],
'include' => [
//
],
'custom_deployer_file' => false,
];

gitlab-ci.yml

image: edbizarro/gitlab-ci-pipeline-php:7.4
stages:
- preparation
- deploy
composer:
stage: preparation
script:
- php -v
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts --no-suggest
- cp .env.example .env
- php artisan key:generate
artifacts:
paths:
- vendor/
- .env
expire_in: 1 days
when: always
cache:
paths:
- vendor/
yarn:
stage: preparation
script:
- yarn --version
- yarn install --pure-lockfile
artifacts:
paths:
- node_modules/
expire_in: 1 days
when: always

.init_ssh_live: &init_ssh_live |
mkdir -p ~/.ssh
echo -e "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
[[ -f /.dockerenv ]] && echo -e "Host *ntStrictHostKeyChecking nonn" > ~/.ssh/config
deploy:
stage: deploy
script:
- *init_ssh_live
- php artisan deploy mySiteIP -s upload
environment:
name: live
url: mySiteIP
only:
- dev

如果你想通过GitLab在cPanel服务器上部署Laravel项目,而不需要任何包,那么这可能会对你有所帮助。配置细节在描述中https://gitlab.com/-/snippets/2238596

相关内容

最新更新