Hi @sam, thanks for answer.
I tried this many times in different configurations, but it failed. Then I came to know real cause, though I do not know the solution
When I install the discourse-backups-to-dropbox
plugin from github (plugin that you shared), the docker builds properly. But if I put it discourse-backups-to-dropbox
in private repository like bitbucket, it throws the error. The error logs for the plugin are same as shared in first post ie
E -u discourse bundle exec rake db:migrate
ERROR: While executing gem … (Errno::EACCES)
Permission denied @ dir_s_mkdir - /var/www/discourse/plugins/discourse-backups-to-dropbox/gems
I, [2017-07-10T18:18:41.229582 #15] INFO – :/root
is not writable.
Bundler will use `/tmp/bundler/home/discourse’ as your home directory temporarily.
gem install public_suffix -v 2.0.5 -i /var/www/discourse/plugins/discourse-backups-to-dropbox/gems/2.4.1 --no-document --ignore-dependencies
You are specifying the gem public_suffix in /var/www/discourse/plugins/discourse-backups-to-dropbox/plugin.rb, however it does not exist!
I, [2017-07-10T18:18:41.230126 #15] INFO – : Terminating async processes
So I guess the problem lies in the my private repo configuration. But if the plugin(without any gem) gets installed properly from bitbucket, I do not know why would installing plugin with gem throw error. It should not matter whether the plugin is in open repository like github or in private repo like bitbucket.
My private repo config
- exec: cd /var/www/discourse && sudo -u discourse bundle install --deployment --without test --without development
- exec: mkdir /root/.ssh
- exec: ssh-keyscan -t rsa bitbucket.org > /root/.ssh/known_hosts
- exec: echo “Host bitbucket\n\tStrictHostKeyChecking no\n\tHostName bitbucket.com\n\tIdentityFile /root/.ssh/id_rsa\n” >> /root/.ssh/config
- file:
path: /root/.ssh/id_rsa
chmod: 600
contents: |
-----BEGIN RSA PRIVATE KEY-----
…
…
-----END RSA PRIVATE KEY------ file:
path: /root/.ssh/id_rsa.pub
chmod: 600
contents: ssh-rsa …- exec: cd $home/plugins && git clone git@bitbucket.org:path/to/discourse-backups-to-dropbox.git
- exec: cd $home && sudo -E -u discourse bundle exec rake db:migrate
- exec: cd $home && rm -fr tmp/cache
- exec: cd $home && sudo -E -u discourse bundle exec rake assets:precompile
- exec: rm /root/.ssh/id_rsa
- exec: rm /root/.ssh/id_rsa.pub
Its same as mentioned in tutorial
https://meta.discourse.org/t/install-a-plugin/19157/33?u=net_deamon