Trying to deploy radicle to Cloudways

I have successfully setup Radicle locally, currently I am just using Local to run it, but probably will switch to laravel Herd. However that is not my main concern at this moment.

I plan to be using cloudways as the managed hosting provider. I am also using bitbucket and thought I could automate the deploys on my Main branch to cloudways via SSH, which does work.

What I am trying to understand is what do I need to do in the pipeline to get Radicle to run on cloudways.

At first I thought maybe I need to delete everything in my cloudways public_html and copy over in sftp the relevant files. And then deploy the changes via the pipeline. The first issue I ran into was with WP-CLI, it told me for the commands

Warning: No WordPress installation found. If the command ‘acorn optimize’ is in a plugin or theme, pass --path=path/to/wordpress.
Error: ‘acorn’ is not a registered wp command. See ‘wp help’ for available commands.

wp acorn optimize
wp acorn icons:cache 
wp login install --activate 

I was a little confused, and then thought maybe composer needs to install everything, so I ran composer install with this result and then after run the wp acorn commands

> Roots\Acorn\ComposerScripts::postAutoloadDump
Script Roots\Acorn\ComposerScripts::postAutoloadDump handling the post-autoload-dump event terminated with an exception

In autoload_real.php line 41:

  require(/home/123.cloudwaysapps.com/fjqfcnkagx/public_html/vendor/composer/../../app/helpers.php): Failed to open stream: No such file or directory


install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

fjqfcnkagx@1123446 ~/public_html $ wp acorn optimize
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
fjqfcnkagx@1123446 ~/public_html $ composer remove


  Not enough arguments (missing: "packages").

I realized at this point composer install was probably not the correct choice

I had also done this locally already, so I thought what I copied up would be correct

  1. Run yarn && yarn build from the project root

Any ideas as to what I should be doing here. I don’t mind spending some time getting this working and writing a article on my blog for how to this for others, but need some help understanding this.

Any help would be greatly appreciated

Note: I copied via cyberduck sftp, because I hadn’t decided what to with the pipeline yet, just knowing it will work, since I tested it with some basic commands

Howdy! I’m realizing the deployment docs need some updating after reading this topic. My apologies that you’re hitting some issues because of this.

Running composer install should be part of the deployment process unless you’re manually copying the vendor directory to your server during deploys

require(/home/123.cloudwaysapps.com/fjqfcnkagx/public_html/vendor/composer/../../app/helpers.php): Failed to open stream: No such file or directory

This error is suggesting that https://github.com/roots/radicle/blob/35a5181eace35ea82382ef84bb4956f580cdcc41/app/helpers.php can’t be found on your server. Are all the files that are in your git repo present on your remote server?

You can ignore the wp command instructions for now — WordPress has to be installed first (I’ll also update the docs to clarify this)

1 Like

Ok,

I have made some good progress.

I deployed everything onto a new wordpress application. I Installed a cloudways wordpress app, then deleted the contents of it public_html, to speed up setup.

Then I deployed via git everything into the same public_html folder. Then via pipelines I copied up the public/dist.

Then I logged via ssh into the server though I could have done it in the pipeline, I ran the wp commands, every command worked except wp login install --activate, got a response saying it does not exists.

However now I can login into wordpress at https://myserver.com/wp/wp-admin (for some reason the additional wp path is needed) which makes it tricky for navigating directly from the cloudways dashboard since it directs to https://myserver.com/wp-admin.

Beyond that I activated the radicle theme I now get the following error. I would like to know how to diagnose this, are there error checking I turn on.

Also I added my database and changed to production in the .env file in the server and added the address to WP_HOME

I do get this error in the logs

[proxy_fcgi:error [pid 4718:tid 140558643197696 [client 1.1.1.1.1:0 AH01071: Got error 'Primary script unknown'

I put it in development mode in .env and get this

Fatal error: Uncaught Roots\Acorn\Assets\Contracts\ManifestNotFoundException: The manifest [/home/1124382.cloudwaysapps.com/njpsaunqff/public_html/public/dist/manifest.json] cannot be found. in /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:133 Stack trace: #0 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php(101): Roots\Acorn\Assets\Manager->getJsonManifest() #1 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php(76): Roots\Acorn\Assets\Manager->resolve() #2 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Roots/Acorn/Assets/AssetsServiceProvider.php(22): Roots\Acorn\Assets\Manager->manifest() #3 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/illuminate/container/Container.php(885): Roots\Acorn\Assets\AssetsServiceProvider->Roots\Acorn\Assets\{closure}() #4 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/illuminate/container/Container.php(770): Illuminate\Container\Container->build() #5 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(856): Illuminate\Container\Container->resolve() #6 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/illuminate/container/Container.php(706): Illuminate\Foundation\Application->resolve() #7 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->make() #8 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Illuminate/Foundation/helpers.php(120): Illuminate\Foundation\Application->make() #9 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Roots/helpers.php(37): app() #10 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/app/Providers/AssetsServiceProvider.php(35): Roots\bundle() #11 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/public/wp/wp-includes/class-wp-hook.php(310): App\Providers\AssetsServiceProvider->App\Providers\{closure}() #12 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/public/wp/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters() #13 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/public/wp/wp-includes/plugin.php(517): WP_Hook->do_action() #14 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/public/wp/wp-admin/edit-form-blocks.php(272): do_action() #15 /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/public/wp/wp-admin/post.php(187): require('/home/1124382.c...') #16 {main} thrown in /home/1124382.cloudwaysapps.com/njpsaunqff/public_html/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php on line 133

This is how Bedrock behaves FYI — WordPress is installed in a subdirectory

You can fix that error by following steps 1 and 2 from https://roots.io/radicle/docs/deployment/

I’m not familiar with Cloudways, but a requirement to use Radicle is the ability to set your document root to public. If it’s using public_html as your document root, then you must get that updated to Radicle’s public directory.

1 Like

I updated my document root to public_html/public I can’t change the public_html part, but I got eveything working as far as I can tell, the public/dist folder was nested by mistake at public/dist/dist

1 Like

One last Question,

Should I add those wp commands to my pipeline so they are run on every deploy?

Also I have been playing with radicle locally and everything is working pretty smoothly I moved away from wordpress sites for dev experience reasons for a while but have a need to do them for work again, and Radicle seems to be very good for developer experience so well done.

1 Like

At a minimum you should be doing wp acorn optimize during every deploy

I’d also add in the wp acorn icons:cache command if you’re using any of the Blade icons packages

wp login install --activate is optional, but helpful if you’re wanting to utilize the WP-CLI login command

And thanks so much, I’m glad you’re liking it!

1 Like

If it’s of any use to anyone this is what I did to get Radicle working with Local/Cloudways and Bitbucket

1 Like