Update Workspace slides for PHPNW

This commit is contained in:
Oliver Davies 2021-02-01 02:21:44 +00:00
parent 398fa3c547
commit fdd5b3138f
16 changed files with 331 additions and 26 deletions

View file

@ -0,0 +1,3 @@
command('say-hello <name>'): |
#!bash|=
echo ={ @('message') } from ={ input.argument('name') }

View file

@ -0,0 +1,5 @@
attribute('message'): Hello World!
command('say-hello'): |
#!bash|@
echo @('message')

View file

@ -0,0 +1,11 @@
attributes:
drupal:
docroot: web
command('apply config'): |
#!php
$ws->confd('workspace:/confd')->apply();
confd('workspace:/confd'):
- src: 'vhost.conf'
dst: 'workspace:/.my127ws/docker/nginx/default.conf'

View file

@ -0,0 +1,7 @@
command('say-hello <name>'):
env:
MESSAGE: = @('message')
NAME: = input.argument('name')
exec: |
#!bash|=
echo "$MESSAGE from $NAME"

View file

@ -0,0 +1,8 @@
# Download from GitHub.
wget https://github.com/my127/workspace/releases/download/0.1.3/ws
# Make it executable.
chmod +x ws
# Make it accessible.
mv ws /usr/local/bin

View file

@ -0,0 +1,8 @@
server {
server_name _;
root /app/{{ @('drupal.docroot' )}};
# output
server {
server_name _;
root /app/web;

View file

@ -0,0 +1,5 @@
command('say-hello'):
#!bash
run echo 'Hello World'
passthru echo 'Hello World'

View file

@ -0,0 +1,9 @@
# ws secret generate-random-key
key('default'): 'd38be3b7aa42fdbfb14c0d25f07bc1875edd5f13f640cd76'
# ws secret encrypt 'Hello World!'
attribute('message'): = decrypt('YTozOntpOjA7czo3OiJkZWZhdWx0Ijt')
command('say-hello'): |
#!bash|@
echo @('message')

View file

@ -0,0 +1,12 @@
# workspace.yml
workspace('oliverdavies-uk'):
description: My personal website codebase.
command('say-hello'):
#!bash
echo 'Hello world'
command('say-hello'):
#!php
echo 'Hello World';

View file

@ -0,0 +1,34 @@
attributes:
rst2pdf:
command: |
= 'rst2pdf ' ~ @('rst2pdf.filename.rst') ~ '
--break-level 1
--stylesheets main
--fit-background-mode scale
--extension-module preprocess
--output ' ~ @('rst2pdf.filename.pdf')
filename:
pdf: slides.pdf
rst: slides.rst
thumbnail:
filename: thumbnail.png
command('pdf generate <talk>'): |
#!bash|=
cd ={ input.argument('talk') }
passthru ={ @('rst2pdf.command') }
command('pdf watch <talk>'): |
#!bash|=
cd ={ input.argument('talk') }
passthru nodemon -e rst,style,txt -x "={ @('rst2pdf.command') }"
command('thumbnail <talk>'):
env:
PDF_FILENAME: = @('rst2pdf.filename.pdf')
THUMBNAIL_FILENAME: = @('thumbnail.filename')
exec: |
#!bash|=
cd ={ input.argument('talk') }
passthru gs -sDEVICE=png16m -r300 -dDownScaleFactor=4
-sOutputFile=$THUMBNAIL_FILENAME -dLastPage=1 $PDF_FILENAME