[emacs-berlin] Literate dev-ops

Arne Brasseur arne.brasseur at gmail.com
Wed May 11 12:55:53 UTC 2016


> Aside: ob-sh is now ob-shell.

That's good to know. Is there a difference in functionality, or is it just
a rename and will the old name be deprecated?

> Personally, those long lines babel lines are too complex for me, so I
like to use the header keywords.

That's a good tip, something new I learned.

I'm trying to have snippets with similar options in the same section, so I
can declare some common options only once at the top of the section. That
does make the lines a bit shorter.

e.g.

* server-side things
  :PROPERTIES:
  :dir: /ssh:....:...
  :results: scalar
  :END:

  #+BEGIN_SRC shell :var foo=bar
   qux
  #+END_SRC


One thing that I miss though is using relative locations, especially in
combination with tramp, e.g. if I have

  :PROPERTIES:
  :dir: /ssh:root at server1:/var/web
  :results: scalar
  :END:


Then I'd like to say, now on that server do sudo

  #+BEGIN_SRC shell :dir /sudo:www-data at server1:

But instead I need to repeat the whole thing (which makes sense, I guess
the most specific `:dir` takes preference)

  #+BEGIN_SRC shell :dir /ssh:root at server1|sudo:www-data at server1:


This would be even more useful with tangle

* test
:PROPERTIES:
:dir: /ssh:root at lambdaisland.com:/root
:END:

#+BEGIN_SRC shell :tangle ./foo-bar-test
foo-bar-test
#+END_SRC


But unfortunately that just creates a local file.



On 11 May 2016 at 14:35, Rasmus <rasmus at gmx.us> wrote:

> Thanks for the link.  Tramp is pretty cool.
>
> >   #+NAME: build-new-uberjar
> >   #+BEGIN_SRC sh :var VERSION=current-version :dir /
> >
> > ssh:root at lambdaisland.com|sudo:web at lambdaisland.com:/var/web/app
> :results
> > scalar
>
> Aside: ob-sh is now ob-shell.
>
> Personally, those long lines babel lines are too complex for me, so I like
> to use the header keywords.
>
>     #+header: :var version="1"
>     #+header: :dir "/tmp"
>     #+header: :results table
>     #+begin_src shell
>     echo $version, $(pwd)
>     #+end_src
>
>     #+RESULTS:
>     | 1 | /tmp |
>
> Rasmus
>
> --
> This is the kind of tedious nonsense up with which I will not put
>
> _______________________________________________
> emacs-berlin mailing list
> emacs-berlin at emacs-berlin.org
> https://mailb.org/mailman/listinfo/emacs-berlin
>



-- 
@plexus <https://twitter.com/plexus> | arnebrasseur.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailb.org/pipermail/emacs-berlin/attachments/20160511/bbb68605/attachment.html>


More information about the emacs-berlin mailing list