LoginSignup
0
0

More than 1 year has passed since last update.

Migrate deployer from 6.x to 7.x

Posted at

homebrewで入れてたdeployerを 6.x->7.xにアップデートしてしまい設定ファイルを変更するはめになった。

https://deployer.org/docs/7.x/UPGRADEを参考にする

-    ->user('xxxxxxxx')
-    ->port(10000)
-    ->identityFile('~/.ssh/id_rsa')
-    ->forwardAgent(true)
+    ->set('remote_user', 'xxxxxxxx')
+    ->set('port', 10000)
+    ->set('identity_file', '~/.ssh/id_rsa')
+    ->set('forward_agent', true)

IdentityFileはサーバ側でcloneするときの鍵の設定で、デフォルトで.ssh/configを見るようなのでそっちに書いといてもよかったかも。

そして実行。

[remote_host]  error  in update_code.php on line 90:
[remote_host] run export GIT_TERMINAL_PROMPT='0' GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=accept-new'; [ -f /home/xxxxxxxx/web/.dep/repo/HEAD ] || /usr/local/bin/git clone --mirror git@gitserver:xxxxxxxx/web.git /home/xxxxxxxx/web/.dep/repo 2>&1
[remote_host] Cloning into bare repository '/home/xxxxxxxx/web/.dep/repo'...
[remote_host] command-line line 0: unsupported option "accept-new".
[remote_host] fatal: Could not read from remote repository.
[remote_host] Please make sure you have the correct access rights
[remote_host] and the repository exists.
[remote_host] exit code 128 (Invalid exit argument)

"accept-new"オプションに対応してねーよ。的なコメントが出た。
デフォルトでgit clone時のsshのオプションが付くようになったようだが
サーバのsshが対応していないので外したい。

https://github.com/deployphp/deployer/issues/2908

ということぽいので

+set(‘git_ssh_command’, ‘ssh’);

あとは、指定しないと動かなかったtaskのmigrateなどが指定しなくても動くようになったりしたので、削除した。

完了。

dep deploy 時に飛んでいた飛行機のアイコンが無くなって寂しい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0