All Projects → welaika → Wordmove

welaika / Wordmove

Licence: mit
Multi-stage command line deploy/mirroring and task runner for Wordpress

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to Wordmove

teamcity-deployer-plugin
Deployer plugin for TeamCity CI server
Stars: ✭ 37 (-97.93%)
Mutual labels:  ssh, ftp, deploy
Webterminal
ssh rdp vnc telnet sftp bastion/jump web putty xshell terminal jumpserver audit realtime monitor rz/sz 堡垒机 云桌面 linux devops sftp websocket file management rz/sz otp 自动化运维 审计 录像 文件管理 sftp上传 实时监控 录像回放 网页版rz/sz上传下载/动态口令 django
Stars: ✭ 1,124 (-37.24%)
Mutual labels:  automation, ssh
Sshkey Audit
Automate SSH key management
Stars: ✭ 55 (-96.93%)
Mutual labels:  automation, ssh
Sparrow
Sparrow - script distribution platform for Linux OS
Stars: ✭ 77 (-95.7%)
Mutual labels:  automation, task-runner
Docker X11 Bridge
Simple Xpra X11 bridge to enable GUI with any docker image
Stars: ✭ 143 (-92.02%)
Mutual labels:  ssh, docker-image
Winscp
WinSCP is a popular free SFTP and FTP client for Windows, a powerful file manager that will improve your productivity. It supports also Amazon S3, FTPS, SCP and WebDAV protocols. Power users can automate WinSCP using .NET assembly.
Stars: ✭ 794 (-55.67%)
Mutual labels:  ftp, ssh
Passh
sshpass is broken by design
Stars: ✭ 65 (-96.37%)
Mutual labels:  automation, ssh
Wordops
Install and manage a high performance WordPress stack with a few keystrokes
Stars: ✭ 649 (-63.76%)
Mutual labels:  automation, wordpress
Ftpbucket
FTPbucket is a PHP script that enables you to sync your BitBucket or GitHub repository with any web-server
Stars: ✭ 99 (-94.47%)
Mutual labels:  ftp, ssh
Sshkit.ex
An Elixir toolkit for performing tasks on one or more servers, built on top of Erlang’s SSH application.
Stars: ✭ 108 (-93.97%)
Mutual labels:  automation, ssh
Scriptsdump
The biggest dump of scripts ever!
Stars: ✭ 114 (-93.63%)
Mutual labels:  automation, ftp
Webhook
webhook is a lightweight incoming webhook server to run shell commands
Stars: ✭ 7,201 (+302.07%)
Mutual labels:  automation, deploy
Cmsscan
CMS Scanner: Scan Wordpress, Drupal, Joomla, vBulletin websites for Security issues
Stars: ✭ 775 (-56.73%)
Mutual labels:  automation, wordpress
Deployer
Deployer is a free and open source deployment tool.
Stars: ✭ 854 (-52.32%)
Mutual labels:  task-runner, deploy
Vssh
Go Library to Execute Commands Over SSH at Scale
Stars: ✭ 707 (-60.52%)
Mutual labels:  automation, ssh
Paramiko Tutorial
📡🐍SSH & SCP in Python with Paramiko
Stars: ✭ 65 (-96.37%)
Mutual labels:  automation, ssh
Foot traffic
Pure Ruby DSL for Chrome scripting based on Ferrum. No Selenium required. Works from any script. Simulate web app usage scenarios in production or locally.
Stars: ✭ 123 (-93.13%)
Mutual labels:  automation, gem
Goexpect
Expect for Go
Stars: ✭ 538 (-69.96%)
Mutual labels:  automation, ssh
Git Ftp
Uses Git to upload only changed files to FTP servers.
Stars: ✭ 5,104 (+184.98%)
Mutual labels:  ftp, deploy
Dog
Dog wants to be a very good task runner
Stars: ✭ 84 (-95.31%)
Mutual labels:  automation, task-runner

Wordmove

logo

Wordmove is a command line tool that lets you automatically mirror local WordPress installations and DB data back and forth from your local development machine to one or more remote servers.

Wordmove has also a neat hook system which enables you to run arbitrary commands before and after push/pull actions. Local and remote commands are both supported (remote ones only on SSH protocol).

FTP support development has been discontinued, thus not all features are granted when using this protocol.

Tests Slack channel Gem Version Docker Build Status

Installation

Wordmove is developed in ruby and packaged and distributed as a gem.

To install:

gem install wordmove

And to update:

gem update wordmove

You can read more about ruby gems ecosystem on the official site https://rubygems.org/.

Peer dependencies

Wordmove acts as automation glue between tools you already have and love. These are its peer dependencies which you need to have installed and executable through your system $PATH:

Program Mandatory?
rsync Yes for SSH protocol
mysql Yes
mysqldump Yes
wp-cli Yes by default, but configurable
lftp Yes, for FTP protocol

Wordmove also expect that the remote server will have the following commands: gzip, nice, mysql, rsync. All of these should be always present by default on any WordPress hosting.

Usage

> wordmove help
Commands:
  wordmove --version, -v    # Print the version
  wordmove doctor           # Do some local configuration and environment checks
  wordmove help [TASK]      # Describe available tasks or one specific task
  wordmove init             # Generates a brand new movefile.yml
  wordmove list             # List all environments and vhosts
  wordmove pull             # Pulls WP data from remote host to the local machine
  wordmove push             # Pushes WP data from local machine to remote host

Move inside the WordPress folder and use wordmove init to generate a new movefile.yml and edit it with your settings. Read the next paragraph for more info.

See the wiki article: Usage and flags explained for more info.

Multistage

You can define multiple remote environments in your movefile.yml, such as production, staging, etc. Every first level key in the YAML other than the defaults and mandatory global and local will be interpreted as a remote environment.

Use -e with pull or push to run the command on the specified environment.

For example: wordmove push -e staging -d will push your local database to the staging environment.

We warmly recommend to read the wiki article: Multiple environments explained

movefile.yml

You can configure Wordmove creating a movefile.yml. That's a YAML file with local and remote host(s) infos:

global:
  sql_adapter: wpcli

local:
  vhost: http://vhost.local
  wordpress_path: /home/john/sites/your_site # use an absolute path here

  database:
    name: database_name
    user: user
    password: password
    host: localhost

  # paths: # you can customize wordpress internal paths
  #   wp_content: wp-content
  #   uploads: wp-content/uploads
  #   plugins: wp-content/plugins
  #   themes: wp-content/themes
  #   languages: wp-content/languages

production:
  vhost: http://example.com
  wordpress_path: /var/www/your_site # use an absolute path here

  database:
    name: database_name
    user: user
    password: password
    host: host
    # port: 3308 # Use just in case you have exotic server config
    # mysqldump_options: --max_allowed_packet=50MB # Only available if using SSH
    # mysql_options: --protocol=TCP # Only available if using SSH

  exclude:
    - '.git/'
    - '.gitignore'
    - 'node_modules/'
    - 'bin/'
    - 'tmp/*'
    - 'Gemfile*'
    - 'Movefile'
    - 'movefile'
    - 'movefile.yml'
    - 'movefile.yaml'
    - 'wp-config.php'
    - 'wp-content/*.sql.gz'
    - '*.orig'

  ssh:
    host: host
    user: user

#  hooks: # Remote hooks won't work with FTP
#    push:
#      before:
#        - command: 'echo "do something"'
#          where: local
#          raise: false # raise is true by default
#      after:
#        - command: 'echo "do something"'
#          where: remote
#    pull:
#      before:
#        - command: 'echo "do something"'
#          where: local
#          raise: false
#      after:
#        - command: 'echo "do something"'
#          where: remote

We warmly recommend to read the wiki articles

to understand more about supported configurations.

Environment Variables

Wordmove allows the use of environment variables in your movefiles. This is useful in order to protect sensitive variables and credentials, as well as make it easy to share movefiles between your team.

Environment variables are written using the ERB tags syntax:

"<%= ENV['YOUR_SECRET_NAME'] %>"

Variables set up

Environment variables can be set up using two methods:

Using the shell:

# bash
export PROD_DB_USER="username" PROD_DB_PASS="password"

# fish
set --export --global PROD_DB_USER "username"; set --export --global PROD_DB_PASS "password"

Using a .env file:

Wordmove supports the dotenv module.

Simply create a .env file next to your movefile structured as follows:

PROD_DB_USER="username"
PROD_DB_PASS="password"

Wordmove will take care of loading the file and making the environment variables ready to be used in your configuration file.

You may also use .env.{environmentname}, but this is discouraged.

Use them in your movefile.yml

Using the ERB syntax described above, write your movefile as follows:

production:
  database:
    user: "<%= ENV['PROD_DB_USER'] %>"
    password: "<%= ENV['PROD_DB_PASS'] %>"

System variables

You can use system variables to configure your movefile.

For example:

local:
  vhost: "http://wordpress-site.localhost"
  wordpress_path: "<%= ENV['HOME'] %>/[wordpress directory path]/"
  # wordpress_path will be substituted with /home/user_name/[wordpress directory path]

Supports

OS

OS X and Linux are fully supported.

See the Windows (un)support disclaimer

Docker

We have a docker image bringing the latest Wordmove's version with autobuild on new releases.

Docker Build Status

SSH

  • You need rsync on your machine; as far as we know it's already installed on OS X and Linux.
  • To use your SSH public key for authentication, just delete the production.ssh.password field in your movefile.yml. Easy peasy.
  • writing the password inside movefile.yml was and is somewhat supported, but we discourage this practice in favor of password-less authentication with pub key. Read here for old informations.

FTP and SFTP

  • You need to install lftp on your machine. See community wiki article: Install lftp on OSX yosemite).
  • Use the relative FTP path as production.wordpress_path
  • Use the absolute FTP path as production.wordpress_absolute_path (you may need to recover this from the __FILE__ magic constant
  • if you want to specify a passive FTP connection add to the YAML config a production.ftp.passive flag and set it to true.

FTP support development is discontinued, but it's always there.

Sice version 3.2.0 SFTP is fully supported, with same functionalities as FTP, through production.ftp.scheme configuration. More information found in the wiki.

Notes

Mirroring

Push and pull actions on files will perform a mirror operation. Please, keep in mind that to mirror means to transfer new/updated files and remove files from destination if not present in source.

This means that if you have files/directories on your remotes which you must preserve, you must exclude those in your movefile.yml, or they will be deleted.

How the heck you are able to sync the DB via FTP?

We're glad you asked! We basically upload via FTP a PHP script that performs the various import/export operations. This script then gets executed via HTTP. Don't worry too much about security though: the script is deleted just after the usage, and can only be executed by wordmove, as each time it requires a pre-shared one-time-password to be run.

Yanked versions

Wordmove 1.3.1 has been removed from rubygems due to a bug with FTP deploying system. If you are using this version, please update soon (gem update wordmove).

Need more tools?

Visit Wordpress Tools.

Credits

Contribute

Please, read the contributor guide.

Feel free to open a discussion issue about contribution if you need more info.

Author

made with ❤️ and ☕️ by weLaika

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].