Jump to content

RockMigrations 🚀🔥 The Ultimate Automation and Deployment-Tool for ProcessWire


bernhard

Recommended Posts

RockMigrations v5.1.0

  • The automatic detection of the php version/command on the remote when using deployments has been further improved and some issues have been fixed.
  • Breaking Change: We now share the sessions folder by default on deployment. If you don't use RM deployments there is no breaking change and you can simply update.
  • Another fix for deployments: We now use a timestamp like release-20240801220000-12345 because github deploy ids jumped from 999... to 1000... which broke the folder rename operation of deployments.
  • Added automatic modules refresh on $rm->installModule(); Before this change I sometimes had the situation that I had to do a manual modules::refresh on my remote after pushing a new version that installed a new module. This is not the case any more ?
  • You can now (again, as this has been there before but was removed in the last release) define the remote PHP command in your deploy yaml file if the automatic detection should not work for whatever reason. Simply add something like PHP_COMMAND: /path/to/your/php_binary_81
  • Added getTemplateIds() method that can be handy when PW wants template ids but you want to define that in a human readable way like $foo->bar($rm->getTemplateIds(['home', 'basic-page']));
  • Like 1
Link to comment
Share on other sites

On 7/24/2024 at 2:58 AM, bernhard said:

In the module settings you have a checkbox to copy snippets over to /your/project/.vscode and that should make VSCode recognise the snippets and show suggestions once you type "rmf-" etc

Thanks @bernhard! rmf- suggestions are working for me. But I cannot find a way to see methods as createPage, deleteField as you do in your video. If you can point me in the right direction I would appreciate it.
 

Spoiler

From your video (sorry the quality).

image.png.076f9e9caee4e3828e32786632b2f159.png


My VSCode.
image.png.3172a784973e983ce2aa80ee7b8c9e60.png

 image.png.f70c7c1953dc758f894a75eb0ad38e45.png
 


 

Link to comment
Share on other sites

  • 4 weeks later...

RockMigrations v5.2.0

  • Added a snippet for the RockIcons module/fields.
  • Added a deprecation note for Magic Field Methods. This feature has been moved to RockFrontend, because the way I implemented it to RockMigrations was not ideal. It added a hook for every existing field, which was something I wanted to change for a long time. But as I didn't see any noticable performance penalties it didn't happen until recently 😎
    If you have been using magic field methods be sure to update RockFrontend to the latest version and refactor your code until you don't get any deprecation notices in your logs! Logs will be shown in the "magic-pages" log and will even have a notice how to fix it:

GYAVMx4oY4QDnbRvpwdH5gxyUU8hiTRJQIdhIOb3

  • Like 1
Link to comment
Share on other sites

  • bernhard changed the title to RockMigrations 🚀🔥 The Ultimate Automation and Deployment-Tool for ProcessWire

Having an issue where RockMigrations is running constantly, every 2-5 seconds from the looks of it. The log says "detected changes in migrate.php" but I didn't make any changes. I commented out everything in migrate.php and it continues to happen. It also said that it detected change in two RPB block PHP fields that didn't have any changes, so I deleted thos but no dice. I don't know where to start debugging.

I disabled migrations in the module config and RockMigration continues to run and logs "Migrations disabled via module settings'.

I've closed every tab but one and Tracy continues to show new log entries for RockMigrations so it appears that migrations are running on every request that ProcessWire handles, even when loading one page.

603298040_Screenshotfrom2024-09-0714-29-49.png.c79f27fe2a6daae1d263da974701428e.png

I've upgraded RockMigrations, RockFrontEnd, RockPageBuilder in case there were any conflicts in versions.

Any insights?

Link to comment
Share on other sites

@bernhard Found the culprit. RockMigrations is not compatible with WireCache: Filesystem. If both are installed it causes migrations to run on every PHP request that ProcessWire handles and may cause the UI to hang in certain instances. I disabled filesystem cache but given it's speed it would be great if that compatibility could be made. Possible?

Found this a bit ago but I forgot to hit the submit reply button 🤷‍♂️

  • Like 1
Link to comment
Share on other sites

@FireWire glad you found the issue. Could you please open a new thread for this and explain the benefits of filesystem cache and how you are using it? Then we can discuss there in an isolated environment which makes it easier to reply, link, refer to... Please also explain your use case as I've never used filesystem cache.

Link to comment
Share on other sites

  • 4 weeks later...

We always have to deal with exceptions, right?

I'm always using the $rm->setPageNameFromTitle() helper that will update the pagename according to the page title on save. That's easy to do in a MagicPage:

  public function init(): void
  {
    $rm = rockmigrations();
    $rm->setPageNameFromTitle($this);
  }

But what if we wanted to make sure that one page has a custom page name that can't be changed, so that we can rely on the url eg in a fetch() call?

  public function onSaveReady(): void
  {
    if ($this->id === 6840) $this->name = 'versandkosten';
    else rockmigrations()->setPageNameFromTitle($this);
  }

We have to use the magic "onSaveReady()" method, because in init() and in ready() we cannot use $this to access the current page, because init() and ready() are triggered on a NullPage object and not the page itself. The reason for this is interesting but not for this post 🙂 

Link to comment
Share on other sites

  • 4 weeks later...

RockMigrations v5.5.0

  • Added PR #65 from lemachinarbo that improves the moduleInstall command; Thank you! 🚀
  • Added support for config migrations: See docs
    This update is extremely helpful and from now on the recommended way to write migrations, as this workflow makes circular references a problem of the past! 🥳💪
  • Added docs about automated releases
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

RockMigrations v6.0.0

I'm really sorry, but I had to introduce a breaking change if anybody already adopted the new config migrations. It's unlikely, because this addition was only 10 days old, but I bumped to v6.0.0 to be safe.

If you have not yet used config migrations you can just update without issues.

  • Like 2
Link to comment
Share on other sites

Actually none of both. I just changed how fields created by RM can be referenced as class constants. Before it was like this:

RockCommerceFields::myfield

Now it is like this:

RockCommerce::field_myfield

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

I've been working to improve the deployments feature. As a result I changed a small detail in v6.3.0 that might break your deployment pipeline.

If you are seeing this error:

Quote

Could not open input file: .../tmp-release-2024.../site/modules/RockMigrations/deploy.php

You can either update RockMigrations or, if that is not possible, make your workflow use the old version of the deployment:

Quote

uses: baumrock/RockMigrations/.github/workflows/deploy.yaml@v6.2.0

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...