Introduction
Different projects require different tools, some often requiring exact versions. MDOQ can't automatically detect what you need, but it does allow you to set it up in one place and use for all development instances going forward.
In this guide we are going to install a specific version of Node, accompanied with NPM and Yarn.
Process
To begin with we are going to test out our commands on a development instance, instead of configuring at parent level. This will stop us from breaking other instances, until we are happy with our configuration.
- Select your development instance
- Navigate to "Settings" > "PHP FPM"
- Paste the following into "Post rollup commands"
curl -o - https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
&& export NVM_DIR="$HOME/.nvm" \
&& [ -s "$NVM_DIR/nvm.sh" ] \
&& \. "$NVM_DIR/nvm.sh" \
&& [ -s "$NVM_DIR/bash_completion" ] \
&& \. "$NVM_DIR/bash_completion" \
&& nvm install 12.20.1 \
&& nvm use 12.20.1 \
&& npm install --global gulp-cli \
&& npm install --global yarn
-
Change "Run command as" to
magento
-
Click "Save"
MDOQ will recognise you have changed some settings for PHP-FPM and Synchronize that component. -
Once this is complete SSH into the instance and check all is well.
If not tweak the command and repeat until happy -
Once happy with the command, update the configuration in the live connector / production instance and click save.
This will mean every instance from now on will have these tools installed.
Troubleshooting
If the command isn't working as desired you have a few options:
- Look at the logging for the component, this should give you an idea of what is going on
- Have your command log to a file
- Tried to run the same command within SSH