# Update private plugin without rebuilding the application

**URL:** https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286
**Category:** Support
**Created:** [May 24, 2017, 2:44pm UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286 "2017-05-24T14:44:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![net\_deamon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/net_deamon/32/70126_2.png) [@net\_deamon](https://meta.discourse.org/u/net_deamon)
#### Post date: [May 24, 2017, 2:44pm UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/1 "2017-05-24T14:44:44Z")

</div>

The admin upgrade page /`admin/upgrade` checks with “[github.com](http://github.com)” for all the plugins.

If we have a private plugin (with bitbucket), then it does not check with bitbucket, but with github. And so the plugin is always shown as update to date with last commit id.

Due to this, in order to upgrade private plugin, I have to rebuild the app, which results in downtime.

I have followed this tutorial/thread to add link the plugin with bitbucket.

> [@Install plugins on a self-hosted site](https://meta.discourse.org/t/install-a-plugin/19157):
>
> warning This guide assumes that you have a self-hosted standard installation. We only support the standard method of install here, so these instructions assume you have a [standard install](https://meta.discourse.org/t/142537?silent=true). warning This guide only applies to self-hosted Discourse instances. If you are using a managed hosting service, the available plugins are controlled by your hosting provider. For example, on our hosting [these specific plugins](https://www.discourse.org/plugins) are available by hosting tier. information_source As of mid-2025, [many p…](https://meta.discourse.org/t/373574)

What do you guys do to update bitbucket/private plugins without rebuilding the app?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 24, 2017, 3:04pm UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/2 "2017-05-24T15:04:44Z")

</div>

> [@net\_deamon](#):
>
> Due to this, in order to upgrade private plugin, I have to rebuild the app, which results in downtime.

The first thing I would do here is split it into 2 containers, one data and one web.

That way you can bootstrap a new web container while the site is running.

Not against making `/admin/upgrade` smarter, feel free to send through a PR in that department.

---

<div class="post-metadata">

### Author: ![net\_deamon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/net_deamon/32/70126_2.png) [@net\_deamon](https://meta.discourse.org/u/net_deamon)
#### Post date: [May 24, 2017, 3:15pm UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/3 "2017-05-24T15:15:07Z")

</div>

It means I will have to spawn another container. Update the other one, and then close this container?

You are talking something like this?

> [@Multiple Discourses, multiple containers, one server](https://meta.discourse.org/t/multiple-discourses-multiple-containers-one-server/35367):
>
> Despite [at least one reference which purports to describe the process](https://meta.discourse.org/t/multisite-configuration-with-docker/14084) I found it very difficult to work out how to run multiple Discourse instances on the same hosting infrastructure (using an instance of nginx running on the host to proxy the Discourse instances). Apparently there’s a way to run Discourse in a “multisite” mode, with multiple instances from a single code installation, but I have not yet seen a real description of how that works. I’ve gone the route of two independent code inst…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 24, 2017, 3:17pm UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/4 "2017-05-24T15:17:08Z")

</div>

That topic is a bit confusing.

To do a “seamless rebuild” it would be something along the lines of:

```plaintext
./launcher bootstrap web
./launcher destroy web
./launcher start web

```

Provided web is somewhat like: [discourse\_docker/samples/web\_only.yml at master · discourse/discourse\_docker · GitHub](https://github.com/discourse/discourse_docker/blob/master/samples/web_only.yml)

---

<div class="post-metadata">

### Author: ![net\_deamon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/net_deamon/32/70126_2.png) [@net\_deamon](https://meta.discourse.org/u/net_deamon)
#### Post date: [May 28, 2017, 11:45am UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/5 "2017-05-28T11:45:13Z")

</div>

Thanks @sam , I was successfully able to seperate the `standalone` instance into `web` and `data`. It took me a bit of research to fully understand and implement it, but thanks for pointing me the right direction and link.

---

<div class="post-metadata">

### Author: ![net\_deamon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/net_deamon/32/70126_2.png) [@net\_deamon](https://meta.discourse.org/u/net_deamon)
#### Post date: [July 18, 2017, 7:31pm UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/6 "2017-07-18T19:31:38Z")

</div>

> [@sam](#):
>
> Not against making /admin/upgrade smarter, feel free to send through a PR in that department.

Hi @sam, I am now working on fixing the plugin. Needed some guidance.

The real problem lies here

`In docker_manager/lib/docker_manager/git_repo.rb (54)`

```
if url =~ /^git/
    # hack so it works with git urls
  url = "https://github.com/#{url.split(":")[1]}"
 end

```

It converts the bitbucket url to github because bitbucket url starts with “git”

`example : git@bitbucket.<account_name>/<plugin_name>.git`

By adding a condition to check for bitbucket works ( and it detects the upgrade version too), but when I try to upgrade, it throws errror “Host key verification failed”

![](https://global.discourse-cdn.com/meta/original/3X/f/3/f3f049ec0cebe2c4dadf882af6474b4d1391b869.png)

Then I came to know that it occurs because we remove the keys from .ssh folder in app.yml file for bitbucket.

But even if I let the ssh keys to be present inside docker container, and run the upgrade, I get the same error.  
Here is the output of **/.ssh/config file**

> Host bitbucket  
> StrictHostKeyChecking no  
> HostName [bitbucket.org](http://bitbucket.org)  
> IdentityFile /root/.ssh/id\_rsa

**I can successfully run the upgrade command inside docker container and upgrade the plugin myself** , but it throws above error when running from /admin/upgrade.

I think it might be because the upgrader is not running as sudo user(correct me if I am wrong).

So can you give me some pointers, on how to proceed

1. Using ssh way ie `git@bitbucket.org:<accountname>/<reponame>.git` and pulling from bitbucket ( this is giving me error “host key verification failed”)
2. Using https way ie `https://<accountname>@bitbucket.org/<accountname>/<reponame>.git`, but I need to somehow provide password and username before upgrading. I think I can add textbox which asks for username and password before starting the upgrade

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/7 "2024-06-08T12:44:25Z")

</div>

This topic was automatically closed after 2571 days. New replies are no longer allowed.
