burgerbuds / swiff Goto Github PK
View Code? Open in Web Editor NEWπ Command line tools for common local β remote server tasks.
License: Other
π Command line tools for common local β remote server tasks.
License: Other
When running swiff -db
or swiff -database
the app runs the incorrect task.
This would definitely have to be in conjunction with #4, but it would be useful during initial developments of a site to push a local database to a remote environment (99% of the time, a staging server).
Currently, since multi-environments aren't supported, our staging site is configured in swiff, and we're manually uploading the local database to the staging server to let the client see incremental work.
In Craft 3.4, the ENV variables changed from using DB_DRIVER
, DB_SERVER
, DB_DATABASE
, and DB_PORT
to define your database config to just DB_DSN
.
It would be great if Swiff could check for and use that value first and then fallback to searching for the old ENV variables (so older installs would continue to be supported).
I just noticed that swiff
tracks usage. Is there a way to disable this? I understand the need of tracking but not all users would appreciate being tracked.
Thx
Not sure if it would be difficult to add, but might be useful to be able to push the project.yaml. I find myself git commiting project.yaml file just so it will deploy through build process, but that takes a bit longer to execute...
Pushing to production isn't the safest / best thing to do so I'm thinking of adding 'are you sure' prompt before it sync up the files.
That'll make it harder to accidentally ruin your week :)
I have SSH running on a non-standard port and it doesn't appear that I can specify it in swiff.config.js. I'm otherwise trying to authenticate with a valid username and key. I attempted to append the port to the hostname (foo.dev:1234
) but it resulted in the same response when I attempt a Pull:
Havenβt added your key to the server?
Add your key to the remote server with ssh-copy-id:
ssh-copy-id foo.dev:1234
swiff --version
1.1.3
We are getting a privateKey error when running the database sync:
Error: Cannot parse privateKey: Unsupported key format
For info, i'm on a fresh install of osx and have just added new keys and verified they are working on the remote server.
"π Backing up the remote live database"
I thought they'd be in storage/backups but not seeing them there.
Thanks!
When there's more than a page full of response text the menu gets pushed off the top of the screen.
It'd be nice to know the size of the non-gzipped database after pulling it down.
Steps to reproduce:
Prereq: Have an identical database for Craft CMS installed both locally and remotely, aka on the "receiving" server
swiff
Exception 'yii\web\ServerErrorHttpException' with message 'The info table is missing its row'
in /storage/av05666/www/public_html/vendor/craftcms/cms/src/base/ApplicationTrait.php:635
Stack trace:
#0 /storage/av05666/www/public_html/vendor/craftcms/cms/src/base/ApplicationTrait.php(286): craft\console\Application->getInfo(true)
#1 /storage/av05666/www/public_html/vendor/craftcms/cms/src/helpers/App.php(538): craft\console\Application->getIsInstalled()
#2 /storage/av05666/www/public_html/vendor/craftcms/cms/src/config/app.php(219): craft\helpers\App::logConfig()
#3 [internal function]: {closure}()
#4 /storage/av05666/www/public_html/vendor/yiisoft/yii2/di/Container.php(524): call_user_func_array(Object(Closure), Array)
#5 /storage/av05666/www/public_html/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->invoke(Object(Closure), Array)
#6 /storage/av05666/www/public_html/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Object(Closure))
#7 /storage/av05666/www/public_html/vendor/yiisoft/yii2/base/Module.php(742): yii\di\ServiceLocator->get('log', true)
#8 /storage/av05666/www/public_html/vendor/craftcms/cms/src/console/Application.php(156): yii\base\Module->get('log', true)
#9 /storage/av05666/www/public_html/vendor/yiisoft/yii2/base/Application.php(508): craft\console\Application->get('log')
#10 /storage/av05666/www/public_html/vendor/craftcms/cms/src/base/ApplicationTrait.php(1381): yii\base\Application->getLog()
#11 /storage/av05666/www/public_html/vendor/craftcms/cms/src/console/Application.php(57): craft\console\Application->_preInit()
#12 /storage/av05666/www/public_html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
#13 /storage/av05666/www/public_html/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#14 /storage/av05666/www/public_html/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#15 /storage/av05666/www/public_html/vendor/craftcms/cms/src/console/Application.php(48): yii\console\Application->__construct(Array)
#16 [internal function]: craft\console\Application->__construct(Array)
#17 /storage/av05666/www/public_html/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)
#18 /storage/av05666/www/public_html/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\\console\\A...', Array, Array)
#19 /storage/av05666/www/public_html/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\console\\A...', Array, Array)
#20 /storage/av05666/www/public_html/vendor/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject(Array)
#21 /storage/av05666/www/public_html/vendor/craftcms/cms/bootstrap/console.php(43): require('/storage/av0566...')
#22 /storage/av05666/www/public_html/craft(21): require('/storage/av0566...')
Craft CMS commands via the CLI and the admin interface both become unusable entirely.
I can see the info
table is indeed completely empty, after the push:
mysql> select * from info;
Empty set (0.00 sec)
Locally, the info table is correct.
If the ssh key is protected by a passphrase, it fails (gracefully) with this message :
πβ Error: Encrypted private key detected, but no passphrase given
It would be great if support for encrypted key would be added (either by just asking for the passphrase, or in my case the passphrase is stored in the OSX keychain so I usually just do a ssh-add -K
at the beginning of my session and don't have to worry about it after
Thanks to @samstevens for this great idea.
Basically you'd be able to add additional tasks to Swiff yourself.
You'd also be able to customise the menu to show only the tasks you'd use.
Perhaps being able to npm install -g swiff-plugin
for the more popular extensions?
Open to suggestions/ideas.
Ctrl+C just won't cut it - let's add an easier way to close
Package yoga-layout-prebuilt throws exception when trying to run tasks from the command line.
Tested on fresh installs of swiff on fresh installs of nodejs versions 8.16.1, 10.16.3, 10.17.0, and 12.13.1.
Stack trace from trying to run '$ swiff --composerPull'
/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
TypeError: Cannot read property 'yogaNode' of undefined
at squashTextNodes (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/render-node-to-output.js:47:38)
at squashTextNodes (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/render-node-to-output.js:59:43)
at renderNodeToOutput (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/render-node-to-output.js:134:18)
at renderNodeToOutput (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/render-node-to-output.js:154:7)
at renderNodeToOutput (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/render-node-to-output.js:154:7)
at renderNodeToOutput (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/render-node-to-output.js:154:7)
at Instance.node [as renderer] (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/renderer.js:108:37)
at Instance.onRender (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/instance.js:105:14)
at resetAfterCommit (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/ink/build/reconciler.js:24:14)
at commitRootImpl (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/react-reconciler/cjs/react-reconciler.development.js:13367:5)
at unstable_runWithPriority (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/scheduler/cjs/scheduler.development.js:643:12)
at runWithPriority (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/react-reconciler/cjs/react-reconciler.development.js:1796:10)
at commitRoot (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/react-reconciler/cjs/react-reconciler.development.js:13211:3)
at runRootCallback (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/react-reconciler/cjs/react-reconciler.development.js:12346:20)
at /Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/react-reconciler/cjs/react-reconciler.development.js:1844:24
at unstable_runWithPriority (/Users/nicholas/.nvm/versions/node/v10.17.0/lib/node_modules/swiff/node_modules/scheduler/cjs/scheduler.development.js:643:12)
There's files like .DS_Store etc that don't play a part in web development. There should be some defaults ignores set and a way to customise.
Trying to use on a newly configured server. Keep getting the following error when trying to pull the database.
Error: All configured authentication methods failed
My ssh key is installed on the server and everything is set up the same way as other sites.
Only difference is that this is the first site that's on Craft 4 - could that be an issue?
I would love a feature where I could have multiple environments setup in the config (for example a dev environment, a staging environment and even the prod environment).
Each should have its own push and pull folders.
Not all projects have a mirrored project structure on the remote server so a remote working directory is a setting worth adding.
After installing Swiff and setting up the config, I received an error when running Pull, Push and Database. It says "Performing pre-task checks" and then fails with this message:
TypeError: ssh.dispose is not a function
at /Users/matthewblode/.nvm/versions/node/v11.7.0/lib/node_modules/swiff/dist/ssh.js:136:11
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/matthewblode/.nvm/versions/node/v11.7.0/lib/node_modules/swiff/dist/ssh.js:32:103)
at _next (/Users/matthewblode/.nvm/versions/node/v11.7.0/lib/node_modules/swiff/dist/ssh.js:34:194)
I'm running Node 11.7.0, the latest version. Thank you! Great concept and super easy to set-up if it works... π¬
After pulling a remote DB, I have to Ctrl + C
to get my prompt back. I'm guessing (without checking into the source) that perhaps you're not sending the proper exit codes to the terminal after performing the DB pull, so it never knows that the task is done.
@ben-rogerson as discussed, it would be great to get the --host
param added to the mysqldump
command, when databases are located on a separate server (eg arcustech).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.