lorisleiva / laravel-docker

🐳 Generic docker image for Laravel Applications
MIT License
934 stars 314 forks source link

Deploy not show '/bin/bash: line 94: /root/.: Is a directory' in .init_ssh #37

Closed youyi1314 closed 5 years ago

youyi1314 commented 5 years ago

I already set variable at CI / CD Setting

image

My Config:

.init_ssh: &init_ssh | eval $(ssh-agent -s) echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null mkdir -p ~/.ssh chmod 700 ~/.ssh [[ -f /.dockerenv ]] && echo -e "Host \n\tStrictHostKeyChecking no\n\n" > ~/. .change_file_permissions: &change_file_permissions | find . -type f -not -path "./vendor/" -exec chmod 664 {} \; find . -type d -not -path "./vendor/*" -exec chmod 775 {} \; chmod 777 -R storage;

stages:

  • deploying

cache: key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"

staging: stage: deploying image: lorisleiva/laravel-docker:latest

Pseudocode describing roughly what we're trying to achive

script:

  • *init_ssh
  • *change_file_permissions
  • php artisan deploy 1.2.3.4 -s=upload

But i got this error. why it go to /root/. where can i find this code on?

image
lorisleiva commented 5 years ago

Hi there 👋

I have no idea but I think this is more a debug question that you should ask on StackOverflow or other forums.

Please reopen if you find a bug that you can reproduce on Laravel Docker.

youyi1314 commented 5 years ago

Closed I found the problem here image for the small screen, it shows only [[ -f /.dockerenv ]] && echo -e "Host \n\tStrictHostKeyChecking no\n\n" > ~/. the actual one is # after scroll to right image

lorisleiva commented 5 years ago

Haha okay no prob. Thanks for sharing.