cap producion deploy
, приложение должно работать на ip 000.000.000.003, а на 000.000.000.002 GitLab, на обоих CentOS 6# Файл deploy.rb
lock "~> 3.11.0"
set :application, "nameproject"
set :repo_url, "http://000.000.000.002/root/nameproject.git"
set :password, "****"
# Путь на где хранится проект
set :deploy_to, "/var/www/nameproject/data/www/nameproject"
task :dev do
on "user@000.000.000.003" do #
execute "node #{release_path}/index.js"
end
end
after "deploy:cleanup", :dev #
# Файл production.rb # Но по существу это должен быть dev.rb
server "000.000.000.003", user: "username", password: "****", roles: %w{app web}
PS D:\путь к проекту> cap production deploy
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 userK3@000.000.000.003 10.899s
Uploading /tmp/git-ssh-nameproject-production-winusr.sh 100.0%
02 chmod 700 /tmp/git-ssh-nameproject-production-winusr.sh
✔ 02 userK3@000.000.000.003 0.421s
00:11 git:check
01 git ls-remote http://000.000.000.002/root/nameproject.git HEAD
01 remote: HTTP Basic: Access denied
01 fatal: Authentication failed for 'http://000.000.000.002/root/nameproject.git/'
#<Thread:0x00000000044c0e88@C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sshkit-1.17.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sshkit-1.17.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sshkit-1.17.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as userK3@000.000.000.003: git
exit status: 128 (SSHKit::Runner::ExecuteError)
git stdout: Nothing written
git stderr: remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://000.000.000.002/root/nameproject.git/'
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as userK3@000.000.000.003: git exit status: 128
git stdout: Nothing written
git stderr: remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://000.000.000.002/root/nameproject.git/'
Caused by:
SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
git stderr: remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://000.000.000.002/root/nameproject.git/'
Tasks: TOP => deploy:check => git:check
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as userK3@000.000.000.003: git exit status: 128
git stdout: Nothing written
git stderr: remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://000.000.000.002/root/nameproject.git/'
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
INFO [24577c0e] Finished in 0.861 seconds with exit status 0 (successful).
INFO [cb0a2907] Running /usr/bin/env git ls-remote http://000.000.000.002/root/nameproject.git HEAD as userK3@000.000.000.003
DEBUG [cb0a2907] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-nameproject-production-winusr.sh" ; /usr/bin/env git ls-remote http://000.000.000.002/root/nameproject.git
HEAD )
DEBUG [b9fda019] remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://000.000.000.002/root/nameproject.git/'
INFO ---------------------------------------------------------------------------
INFO START 2018-09-19 13:45:48 +0300 cap production deploy
INFO ---------------------------------------------------------------------------
INFO [a8fe0d90] Running /usr/bin/env mkdir -p /tmp as userK3@000.000.000.003
DEBUG [a8fe0d90] Command: /usr/bin/env mkdir -p /tmp
INFO [fc9791c0] Finished in 10.899 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/git-ssh-nameproject-production-winusr.sh 0.0%
INFO Uploading /tmp/git-ssh-nameproject-production-winusr.sh 100.0%
INFO [1b17c9c5] Running /usr/bin/env chmod 700 /tmp/git-ssh-nameproject-production-winusr.sh as userK3@000.000.000.003
DEBUG [1b17c9c5] Command: /usr/bin/env chmod 700 /tmp/git-ssh-nameproject-production-winusr.sh
INFO [a7a946fa] Finished in 0.421 seconds with exit status 0 (successful).
INFO [1c1909ea] Running /usr/bin/env git ls-remote http://000.000.000.002/root/nameproject.git HEAD as userK3@000.000.000.003
DEBUG [1c1909ea] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-nameproject-production-winusr.sh" ; /usr/bin/env git ls-remote http://000.000.000.002/root/nameproject.git
HEAD )
DEBUG [2f23f4d6] remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://000.000.000.002/root/nameproject.git/'
git@000.000.000.002:root/nameproject.git
ssh-keygen
vi ~/.ssh/id_rsa.pub
Профиль в правом верхнем углу > Settings > слева список > SSH Keys