Jump to content

RockShell - a ProcessWire Commandline Companion ⌨️


bernhard
 Share

Recommended Posts

RockShell v2.0.0 is out.

It's been in development for quite a long time and I use it on a daily basis. 

This module is a little special, as it has to be placed in the PW root folder (not in /site/modules). From there you can then call the shell interface via "php RockShell/rockshell"

251757691-3858509e-5522-476c-acd0-dd3154

You can then use the "symlink" command to create a symlink in the root folder. After that you can call rockshell via "php rock" in the pw root folder.

I've made it as easy as possible to create custom commands - you only need one config() and one handle() method!

68747470733a2f2f692e696d6775722e636f6d2f

https://github.com/baumrock/RockShell/

  • Like 7
  • Thanks 3
Link to comment
Share on other sites

  • 1 month later...

v2.1.0 is out 😎🚀

 

Bug Fixes

  • command db:pull using old syntax (52f78e4)
  • install command not working for dotnetic (2a68b11)
  • rename rockshell to rock everywhere and update readme (2697bd6)

Features

  • add DbDownload command (2e91be7)
  • add warning if PHP version is too low (a8caca8)

We have a new db:download command and I created an alias for my laptop so that I can simply call "rockshell db:pull staging" instead of "ddev php rock db:pull staging" which is really nice if you use it often.

  • Like 2
Link to comment
Share on other sites

  • 3 months later...

Awesome stuff @bernhard I have incorperated rockshell to my workflow (together with ddev, thanks for that video, just found it). Togerther with RockMigrations they are a great improvement.

A thing I noticed it doesn't delete install file and folder (and also non-used site profile, though I'm not sure the default installation deletes these)

  • Thanks 1
Link to comment
Share on other sites

Yes, I have added rockshell alias, and a function to make it some less effort to get default setup.

function setup_spinbox_project() {
    # Convert project name to lowercase
    local project_name=$(echo "$1" | tr '[:upper:]' '[:lower:]')

    # Check if project name is provided
    if [[ -z "$project_name" ]]; then
        echo "Please provide a project name."
        return 1
    fi

    # Clone the repository and check for success
    git clone git@gitlab.com:#############################.git "$project_name"
    if [ $? -ne 0 ]; then
        echo "Failed to clone the repository. Check your access rights."
        return 1
    fi

    # Change to the project directory
    cd "$project_name" || return

    # Run ddev config
    ddev config

    # Automatically add phpMyAdmin to .ddev/config.yaml
    echo "services:" >> .ddev/config.yaml
    echo "  phpmyadmin:" >> .ddev/config.yaml
    echo "    type: phpmyadmin" >> .ddev/config.yaml
    echo "    port: 8036" >> .ddev/config.yaml

    # Start ddev
    ddev start

    # Run RockShell commands
    rockshell pw:download
    rockshell pw:install

    echo "Setup for $project_name complete."
}

 

  • Like 1
Link to comment
Share on other sites

Nice 😎 Why are you adding phpmyadmin? Isn't that a ddev default anyhow? 

45 minutes ago, Spinbox said:

A thing I noticed it doesn't delete install file and folder (and also non-used site profile, though I'm not sure the default installation deletes these)

And could you please give me some more details if there's something that should be fixed here?

Link to comment
Share on other sites

19 minutes ago, bernhard said:

Nice 😎 Why are you adding phpmyadmin? Isn't that a ddev default anyhow? 

1 hour ago, Spinbox said:

It isn't anymore. but the following code can be changed for ddev get ddev/ddev-phpmyadmin

  # Automatically add phpMyAdmin to .ddev/config.yaml
    echo "services:" >> .ddev/config.yaml
    echo "  phpmyadmin:" >> .ddev/config.yaml
    echo "    type: phpmyadmin" >> .ddev/config.yaml
    echo "    port: 8036" >> .ddev/config.yaml
  • When you have to choose Timezone you have to set an integer (god knows which), instead of for example Europe/Amsterdam
  • 19 minutes ago, bernhard said:

    And could you please give me some more details if there's something that should be fixed here?

    I will try to look into the specifics

  • Thanks 1
Link to comment
Share on other sites

It's probably easier to use Adminer (since I also use tracy). I have been using phpmyadmin for so long that I didn't think about alternatives 🙂 

I have tried to get the pw:install command working. It looks like the stepAdmin data isn't being saved (url, user credentials,) or executed properly, the install files don't get deleted either.
owever, this does work when I use them as options --name=Name etc. Not sure why that is.


After some more testing I found out I actually didn't delete the previous databases these tries. My bad.

Edited by Spinbox
Link to comment
Share on other sites

  • 1 month later...

Ho,

is it possible to config that (for example) the db:pull command will use a ssh-key file and the place would be configurable via the $config options? I mean, i know it can't use my ssh-agent on the host, but it would help in a team env, where you add the keys of the dev's in the authorization file on the server.

 

Never mind, the answer is to load the .ssh in the ddev container... (from the ddev manual)

  • If you use SSH inside the container and want to use your .ssh/config, consider mkdir -p ~/.ddev/homeadditions/.ssh && ln -s ~/.ssh/config ~/.ddev/homeadditions/.ssh/config. Some people will be able to symlink their entire .ssh directory, ln -s ~/.ssh ~/.ddev/homeadditions/.ssh. If you provide your own .ssh/config though, please make sure it includes these lines:

UserKnownHostsFile=/home/.ssh-agent/known_hosts
StrictHostKeyChecking=accept-new

 

The option can set global, like above in ~/.ddev or per project projectFolder/.ddev

  • 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
 Share

  • Recently Browsing   0 members

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