Install plugin from private Git repository?

(Muthukkumar) #1

Hi All,
I have read all the commands in Install Plugins in Discourse. But I didn’t get the result what I am looking for. I am having one issue while cloning the plugin form Azure repo. Could some one help me to fix that. Below is my app.yml file:

  - exec: echo "Beginning of custom commands"
  - exec: cd /var/www/discourse && sudo -u discourse bundle install --deployment --without test --without development
  - exec: mkdir /root/.ssh/
  - exec: touch /root/.ssh/known_hosts
  - exec: ssh-keyscan -t rsa > /root/.ssh/known_hosts
  - exec: echo "Host\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
    #- exec: mkdir -p /root/.ssh
  - file:
      path: /root/.ssh/id_rsa
      chmod: 600
      contents: |
        -----BEGIN RSA PRIVATE KEY-----
        Proc-Type: 4,ENCRYPTED
        DEK-Info: AES-128-CBC,19EA4589000FE19E7F44F2E86FDA3990
        7bxXEvdz6VDgkanHKDsadfasgqw3tfy+1Mh4VtW7iHbOORE.. etc...
  - file:
      path: /root/.ssh/
      chmod: 600
      contents: ssh-rsa AAAAB3NzaC1ycadfasdfsalkfffjsggsadfdfsf My@abc-31.local
  - exec: cd $home/plugins && git clone
  - 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/
  - exec: echo "End of custom commands"

Error After ./launcher rebuild app
Pups::ExecError: cd /var/www/discourse/plugins && git clone failed with return #<Process::Status: pid 4231 exit 128>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "cd $home/plugins && git clone"

Could some one me to fix this issue. Many thanks in advance…


Install Plugins in Discourse

If you go to the plugins directory and run:

git clone

what do you get?

Specifically url-for-private-plugin doesn’t look like a valid path?


1 Like

(Muthukkumar) #3

Hi Thanks for the response, that is my sample URL. I can able to clone the plugin in my VM, since I am having ssh public key in VM. But I am not able to clone the repo inside the container while run the app.yml.

If I clone it inside the plugin I am getting below details:

Cloning into ‘Community%20Plugins’…
The authenticity of host ‘ (’ can’t be established.
RSA key fingerprint is SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘,’ (RSA) to the list of known hosts.’s password:

Even if I give correct password its not taking.
Could you please suggest to fix this issue.

1 Like


Got it. So this is a private repo? Instead of username/password is there any support for access tokens?

e.g. for Github:

Then you can use that in your git clone command like:

git clone

This avoids any prompt.

Not sure if that’s supported in your repository though.

1 Like

(Jay Pfaffman) #5

Are you saying that the ssh private key that you are using requires a password? They won’t work.

You’ll need an ssh key in the container they allows downloads without a password. The ssh keys must be in place before the container tries to download it.


(Muthukkumar) #6

Hi @pfaffman yes its worked. when I passed the ssh keys in app.yml I was not able to clone the plugin. But inside the plugin folder I can able to clone it.
As per @pfaffman suggestion copied the ssh keys in volume: host/ guest: command. Then I can able to clone my private repo.
Thanks a lot for the supports.