Launcher rebuild app pull the latest discourse from github

AI-generated summary

Launcher Rebuild App Pull the Latest Discourse from GitHub

Celso_Teixeira wants to limit the launcher rebuild app from automatically pulling the latest Discourse repository from GitHub unless a specific parameter is passed. merefield suggests switching to a stable branch, but Celso is already using the stable version (3.2.0).

The discussion revolves around the need to update the repository and the potential risks of not doing so. pfaffman explains that the point of stable is the lack of change, and rebuilding without updating may not be necessary.

Celso_Teixeira provides a solution by modifying the launcher to add flags for pulling the latest git repository and Docker image. However, merefield points out that this solution may not work properly for plugins that require compilation, and changing core build scripts can cause trouble. pfaffman advises Celso to mention this modification when seeking help with plugins in the future.

Hi,

I already have Discourse installed and running. Every time I rebuild the app, it pulls the launcher repo, the discourse/base Docker image, and the Discourse repository.

I want to limit this behavior so that the rebuild doesn’t check for updates and pull them automatically unless a specific parameter is passed.

Has anyone done something similar?

are you concerned about version stability?

why don’t you just switch to stable branch?

I’m using stable version, 3.2.0.

The intention is to only pull from git hub or docker hub repository when we want, not everytime we rebuild the container.

Are you using a standard install?

If so why just not run the rebuild command?

FYI updates to stable can be important - they usually contain vulnerability or significant bug fixes.

Yes, I’m using the standard standalone approach. I understand the need to keep the app updated. My idea is to add a flag to the launcher when I want to update the repository.

If you want to restart the container without rebuilding, just do:

./launcher restart app

why do you need to rebuild without updating - what is your goal?

stable updates are unlikely to introduce any breaking changes.

The point of stable is lack of change. Why are you rebuilding at all?

The reason that it pulls the container is to keep it in parity with the requirements of the discourse code.

If you want to do something like enter the container without doing a pull you can

 docker exec -it app bash

And if you wanted to add a plugin without rebuilding you could enter the plugin directory and clone it and then migrate the database, but you still need to make she your getting the right commit of the plugin for strangle) stable.

In case on adding or removing a plugin the ./launcher restart app will not update the instance.

Given stable releases are relatively rare, they don’t present breaking changes at all often, and usually come with important security updates when there is an update, I do not understand your requirement.

To my mind adding a plugin is a good excuse to update and ensure you’ve pulled all the available updates.

Not updating on stable, imho, is bad practice as that may expose you to known vulnerabilities for longer.

I did the following changes to the launcher

echo "    --pull-git                 Pull the latest git repository"
  echo "    --pull-image               Pull the latest Docker image"

pull_git=false
pull_image=false
rebuild)
      if [ "$(git symbolic-ref --short HEAD)" = "master" ] && [ "$pull_git" = true ]; then
        git branch -m master main
        git fetch origin
        git branch -u origin/main main
        git remote set-head origin -a
      fi
....

With this I’m able to avoid to update everytime I do the rebuild. It allow the plugin to be installed.

When you have trouble with those plugins, be sure to mention this when you start a new topic.

No it does not, at least not properly.

It might work with API only plugins, but any javascript of new plugins needs to be compiled which happens in the build process.

Therefore, to add a new plugin you must perform a rebuild in most cases.

The other issue you have is that changing core build scripts may get you into deep trouble if you are not careful, especially if there is a significant enough change to core scripting.