[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 57cec3d 165/173: Improved documentation of c
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy 57cec3d 165/173: Improved documentation of custom deployment script |
Date: |
Sat, 20 Oct 2018 10:36:50 -0400 (EDT) |
branch: externals/ssh-deploy
commit 57cec3d9aa8442ee5e27176748b048451cd93d8e
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Improved documentation of custom deployment script
---
README.md | 11 +++++++++--
ssh-deploy.el | 12 +++++++++---
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 354b3bd..c0a8e1c 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ The `ssh-deploy` plug-in for Emacs makes it possible to
effortlessly deploy loca
* Delete files and directories on local host and have it mirrored on the remote
* Open corresponding file on the remote host
* Open SQL database-session on remote hosts
+* Run custom deployment scripts
* All operations support asynchronous mode if `async.el` is installed. (You
need to setup an automatic authorization for this, i.e. `~/.netrc`,
`~/.authinfo` or `~/.authinfo.gpg` and/or key-based password-less authorization)
The idea for this plug-in was to mimic the behavior of **PhpStorm** deployment
functionality.
@@ -40,6 +41,7 @@ Here is a list of other variables you can set globally or per
directory:
* `ssh-deploy-remote-sql-user` Default user when connecting to remote SQL
database *(string)*
* `ssh-deploy-remote-shell-executable` Default remote shell executable when
launching shell on remote host *(string)*
* `ssh-deploy-verbose` Show messages in message buffer when starting and
ending actions, default t *(boolean)*
+* `ssh-deploy-script' - Our custom lambda function that will be called using
(funcall) when running deploy script
## Deployment configuration examples
@@ -84,7 +86,7 @@ You really need to do a bit of research about how to connect
via different proto
You can pipe remote connections as well like this:
-### SSH, not asynchronous, automatic uploads, piped to other user on remote
server
+### SSH, not asynchronous, automatic uploads, piped to other user on remote
server and with custom deployment script.
``` emacs-lisp
((nil . (
@@ -92,6 +94,7 @@ You can pipe remote connections as well like this:
(ssh-deploy-root-remote .
"/ssh:address@hidden|sudo:address@hidden:/var/www/MySite/")
(ssh-deploy-async . nil)
(ssh-deploy-on-explicit-save . t)
+ (ssh-deploy-script . (lambda() (let ((default-directory
ssh-deploy-root-remote))(shell-command "bash compile.sh"))))
)))
```
@@ -162,6 +165,7 @@ By combining a `~/.netrc`, `~/.authinfo` or
`~/.authinfo.gpg` setup and a `publi
(global-set-key (kbd "C-c C-z b") (lambda()
(interactive)(ssh-deploy-browse-remote-base-handler) ))
(global-set-key (kbd "C-c C-z o") (lambda()
(interactive)(ssh-deploy-open-remote-file-handler) ))
(global-set-key (kbd "C-c C-z m") (lambda()
(interactive)(ssh-deploy-remote-sql-mysql-handler) ))
+(global-set-key (kbd "C-c C-z s") (lambda()
(interactive)(ssh-deploy-run-deploy-script-handler) ))
```
* Or use the `use-package` and `hydra-script` I'm using:
@@ -186,6 +190,7 @@ By combining a `~/.netrc`, `~/.authinfo` or
`~/.authinfo.gpg` setup and a `publi
_R_: Rename
_b_: Browse Base _B_: Browse Relative
_o_: Open current file on remote _m_: Open sql-mysql on remote
+ _s_: Run deploy script
"
("f" ssh-deploy-upload-handler-forced)
("u" ssh-deploy-upload-handler)
@@ -201,7 +206,8 @@ By combining a `~/.netrc`, `~/.authinfo` or
`~/.authinfo.gpg` setup and a `publi
("b" ssh-deploy-browse-remote-base-handler)
("B" ssh-deploy-browse-remote-handler)
("o" ssh-deploy-open-remote-file-handler)
- ("m" ssh-deploy-remote-sql-mysql-handler)))
+ ("m" ssh-deploy-remote-sql-mysql-handler)
+ ("s" ssh-deploy-run-deploy-script-handler)))
```
(1) You can remove the `(add-to-list)` and `(require)` lines if you installed
via `MELPA` repository.
@@ -226,6 +232,7 @@ By combining a `~/.netrc`, `~/.authinfo` or
`~/.authinfo.gpg` setup and a `publi
* If you press `C-c C-z e` you will check for remote changes to the current
file.
* If you press `C-c C-z o` you will open remote file corresponding to local
file.
* If you press `C-c C-z m` you will open remote sql-mysql session on remote
host.
+* If you press `C-c C-z s` you will run your custom deploy script.
The local path and local root is evaluated based on their `truename` so if you
use different symbolic local paths it shouldn't affect the deployment procedure.
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 2581750..d9bbe44 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -33,7 +33,8 @@
;; ssh-deploy enables automatic deploys on explicit-save actions, manual
uploads, renaming,
;; deleting, downloads, file and directory differences, launching remote
terminals (eshell, shell),
-;; detection of remote changes, remote directory browsing, remote SQL database
sessions via TRAMP.
+;; detection of remote changes, remote directory browsing, remote SQL database
sessions and
+;; running custom deployment scripts via TRAMP.
;;
;; For asynchrous operations it uses package async.el.
;;
@@ -72,6 +73,7 @@
;; (global-set-key (kbd "C-c C-z B") (lambda()
(interactive)(ssh-deploy-browse-remote-handler) ))
;; (global-set-key (kbd "C-c C-z o") (lambda()
(interactive)(ssh-deploy-open-remote-file-handler) ))
;; (global-set-key (kbd "C-c C-z m") (lambda()
(interactive)(ssh-deploy-remote-sql-mysql-handler) ))
+;; (global-set-key (kbd "C-c C-z s") (lambda()
(interactive)(ssh-deploy-run-deploy-script-handler) ))
;;
;; - To install and set-up using use-package and hydra do this:
;; (use-package ssh-deploy
@@ -93,6 +95,7 @@
;; _R_: Rename
;; _b_: Browse Base _B_: Browse Relative
;; _o_: Open current file on remote _m_: Open sql-mysql on remote
+;; _s_: Run deploy script
;; "
;; ("f" ssh-deploy-upload-handler-forced)
;; ("u" ssh-deploy-upload-handler)
@@ -108,7 +111,8 @@
;; ("b" ssh-deploy-browse-remote-base-handler)
;; ("B" ssh-deploy-browse-remote-handler)
;; ("o" ssh-deploy-open-remote-file-handler)
-;; ("m" ssh-deploy-remote-sql-mysql-handler)))
+;; ("m" ssh-deploy-remote-sql-mysql-handler)
+;; ("s" ssh-deploy-run-deploy-script-handler)))
;;
;;
;; Here is an example for SSH deployment,
/Users/Chris/Web/Site1/.dir-locals.el:
@@ -125,6 +129,7 @@
;; (ssh-deploy-root-remote . "/sftp:address@hidden:/var/www/site2/")
;; (ssh-deploy-on-explicit-save . nil)
;; (ssh-deploy-async . nil)
+;; (ssh-deploy-script . (lambda() (let ((default-directory
ssh-deploy-root-remote))(shell-command "bash compile.sh"))))
;; )))
;;
;; Here is an example for FTP deployment,
/Users/Chris/Web/Site3/.dir-locals.el:
@@ -153,6 +158,7 @@
;; * `ssh-deploy-remote-sql-user' - Default user when connecting to remote SQL
database *(string)*
;; * `ssh-deploy-remote-shell-executable' - Default shell executable when
launching shell on remote host
;; * `ssh-deploy-verbose' - Show messages in message buffer when starting and
ending actions, default t *(boolean)*
+;; * `ssh-deploy-script' - Our custom lambda function that will be called
using (funcall) when running deploy script
;;
;; Please see README.md from the same repository for extended documentation.
@@ -194,7 +200,7 @@
(put 'ssh-deploy-debug 'permanent-local t)
(put 'ssh-deploy-debug 'safe-local-variable 'booleanp)
-;; TODO This flag needs to work better
+;; TODO This flag needs to work better, you should not miss any useful
notifications when this is on
(defcustom ssh-deploy-verbose t
"Boolean variable if debug messages should be shown, t by default."
:type 'boolean
- [elpa] externals/ssh-deploy 715325d 126/173: Improved wording of directory difference calculation, (continued)
- [elpa] externals/ssh-deploy 715325d 126/173: Improved wording of directory difference calculation, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy b879998 116/173: Added support for remote SQL sessions, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy fc9bdbc 142/173: Asynchronously downloaded buffers are now automatically reverted, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 519a639 147/173: Fixed issue were buffer was marked as modified after a rename, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 2f281c3 158/173: Fixed bug in (when (not to (unless conversion, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy a81c3f1 166/173: Fixed README syntax, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy b560147 164/173: Rename run script menu item, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 104a384 170/173: Fixed lambda function predicate function, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 67313e2 172/173: Merge branch 'master' of https://github.com/cjohansson/emacs-ssh-deploy, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 89f9dd6 169/173: Fixed DirectoryVariable run script predicate function, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 57cec3d 165/173: Improved documentation of custom deployment script,
Stefan Monnier <=
- [elpa] externals/ssh-deploy ffc3cd0 173/173: Added support for multithreading, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 099c7d8 139/173: Added support for mode-line status updates, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 3c15ace 089/173: Made function arguments optional with module variables as fall-backs, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 8c6f24e 109/173: Improved code for interactive directory differences, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 5e191c6 103/173: Added major mode for interactive directory differences, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 7b0ab24 162/173: Create LICENSE, Stefan Monnier, 2018/10/20