Rename directories
This commit is contained in:
parent
a5bee4685a
commit
9f3226aec5
142 changed files with 3 additions and 3 deletions
4
Working with Workspace/README.rst
Normal file
4
Working with Workspace/README.rst
Normal file
|
@ -0,0 +1,4 @@
|
|||
Working with Workspace
|
||||
######################
|
||||
|
||||
https://www.oliverdavies.uk/talks/working-with-workspace
|
3
Working with Workspace/code/arguments.txt
Normal file
3
Working with Workspace/code/arguments.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
command('say-hello <name>'): |
|
||||
#!bash|=
|
||||
echo ={ @('message') } from ={ input.argument('name') }
|
5
Working with Workspace/code/attributes.txt
Normal file
5
Working with Workspace/code/attributes.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
attribute('message'): Hello World!
|
||||
|
||||
command('say-hello'): |
|
||||
#!bash|@
|
||||
echo @('message')
|
11
Working with Workspace/code/confd.txt
Normal file
11
Working with Workspace/code/confd.txt
Normal 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'
|
7
Working with Workspace/code/environment-variables.txt
Normal file
7
Working with Workspace/code/environment-variables.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
command('say-hello <name>'):
|
||||
env:
|
||||
MESSAGE: = @('message')
|
||||
NAME: = input.argument('name')
|
||||
exec: |
|
||||
#!bash|=
|
||||
echo "$MESSAGE from $NAME"
|
8
Working with Workspace/code/installation.txt
Normal file
8
Working with Workspace/code/installation.txt
Normal 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
|
8
Working with Workspace/code/nginx-vhost.txt
Normal file
8
Working with Workspace/code/nginx-vhost.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
server {
|
||||
server_name _;
|
||||
root /app/{{ @('drupal.docroot' )}};
|
||||
|
||||
# output
|
||||
server {
|
||||
server_name _;
|
||||
root /app/web;
|
5
Working with Workspace/code/run-passthru.txt
Normal file
5
Working with Workspace/code/run-passthru.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
command('say-hello'):
|
||||
#!bash
|
||||
run echo 'Hello World'
|
||||
|
||||
passthru echo 'Hello World'
|
9
Working with Workspace/code/secrets.txt
Normal file
9
Working with Workspace/code/secrets.txt
Normal 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')
|
12
Working with Workspace/code/simple-command.txt
Normal file
12
Working with Workspace/code/simple-command.txt
Normal 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';
|
34
Working with Workspace/code/workspace-talks.txt
Normal file
34
Working with Workspace/code/workspace-talks.txt
Normal 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
|
BIN
Working with Workspace/images/helper-passthru.png
Normal file
BIN
Working with Workspace/images/helper-passthru.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
Working with Workspace/images/helper-run.png
Normal file
BIN
Working with Workspace/images/helper-run.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
BIN
Working with Workspace/images/output-command.png
Normal file
BIN
Working with Workspace/images/output-command.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
BIN
Working with Workspace/images/output-simple.png
Normal file
BIN
Working with Workspace/images/output-simple.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
132
Working with Workspace/main.style
Normal file
132
Working with Workspace/main.style
Normal file
|
@ -0,0 +1,132 @@
|
|||
pageSetup:
|
||||
firstTemplate: coverPage
|
||||
height: 18cm
|
||||
margin-bottom: 0cm
|
||||
margin-gutter: 0cm
|
||||
margin-left: 0cm
|
||||
margin-right: 0cm
|
||||
margin-top: 0cm
|
||||
size: null
|
||||
spacing-footer: 2mm
|
||||
spacing-header: 2mm
|
||||
width: 32cm
|
||||
|
||||
pageTemplates:
|
||||
coverPage:
|
||||
# background: images/title.png
|
||||
frames: []
|
||||
[12%, 10%, 76%, 75%]
|
||||
showFooter: false
|
||||
showHeader: false
|
||||
|
||||
titlePage:
|
||||
alignment: TA_CENTER
|
||||
frames: []
|
||||
[8%, 8%, 85%, 65%]
|
||||
showFooter: true
|
||||
showHeader: false
|
||||
|
||||
standardPage:
|
||||
frames: []
|
||||
[3%, 3%, 92%, 92%]
|
||||
showFooter: true
|
||||
showHeader: false
|
||||
|
||||
imagePage:
|
||||
alignment: TA_CENTER
|
||||
frames: []
|
||||
[12%, 10%, 76%, 80%]
|
||||
showFooter: true
|
||||
showHeader: false
|
||||
|
||||
outputPage:
|
||||
frames: []
|
||||
[8%, 10%, 82%, 65%]
|
||||
showFooter: false
|
||||
showHeader: false
|
||||
|
||||
linkColor: #24608a
|
||||
|
||||
fontsAlias:
|
||||
stdMono: Inconsolata-Regular
|
||||
stdMonoBold: Inconsolata-Regular
|
||||
stdMonoItalic: Inconsolata-Regular
|
||||
|
||||
styles:
|
||||
normal:
|
||||
fontSize: 24
|
||||
leading: 32
|
||||
textColor: #383745
|
||||
|
||||
bodytext:
|
||||
alignment: TA_LEFT
|
||||
|
||||
heading:
|
||||
fontSize: 20
|
||||
spaceAfter: 16
|
||||
textColor: #24608a
|
||||
|
||||
title:
|
||||
fontSize: 300%
|
||||
parent: heading
|
||||
|
||||
bullet-list:
|
||||
commands: []
|
||||
[LEFTPADDING, [0, 0], [1, -1], 10]
|
||||
[RIGHTPADDING, [0, 0], [1, -1], 0]
|
||||
[VALIGN, [0, 0], [-1, -1], TOP]
|
||||
colWidths: ["20", null]
|
||||
textColor: #aaaaaa
|
||||
|
||||
bullet-list-item:
|
||||
spaceBefore: 14
|
||||
spaceAfter: 0
|
||||
|
||||
titleslideinfo:
|
||||
alignment: TA_CENTER
|
||||
fontSize: 140%
|
||||
parent: normal
|
||||
|
||||
footer:
|
||||
alignment: TA_RIGHT
|
||||
fontName: stdMono
|
||||
fontSize: 20
|
||||
textColor: #24608a
|
||||
rightIndent: 16
|
||||
spaceBefore: 0
|
||||
|
||||
literal:
|
||||
backColor: white
|
||||
fontName: stdMono
|
||||
|
||||
code:
|
||||
backColor: white
|
||||
borderWidth: 0
|
||||
fontSize: 20
|
||||
leading: 24
|
||||
parent: literal
|
||||
spaceBefore: 4
|
||||
|
||||
blockquote:
|
||||
parent: normal
|
||||
fontName: stdItalic
|
||||
leading: 36
|
||||
|
||||
attribution:
|
||||
parent: normal
|
||||
textColor: #66666
|
||||
|
||||
centred:
|
||||
alignment: TA_CENTER
|
||||
parent: bodytext
|
||||
|
||||
centredtitle:
|
||||
alignment: TA_CENTER
|
||||
fontName: stdBold
|
||||
fontSize: 48
|
||||
leading: 64
|
||||
parent: heading
|
||||
|
||||
text-lg:
|
||||
parent: bodytext
|
||||
fontSize: 150%
|
222
Working with Workspace/slides.rst
Normal file
222
Working with Workspace/slides.rst
Normal file
|
@ -0,0 +1,222 @@
|
|||
.. footer:: @opdavies
|
||||
|
||||
Working with Workspace
|
||||
######################
|
||||
|
||||
|
|
||||
|
||||
.. class:: titleslideinfo
|
||||
|
||||
Oliver Davies, Inviqa
|
||||
|
||||
.. raw:: pdf
|
||||
|
||||
TextAnnotation "Full stack Developer and Systems Administrator"
|
||||
TextAnnotation "Organiser of PHP South Wales"
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
What is Workspace?
|
||||
==================
|
||||
|
||||
* A tool that we use and maintain at Inviqa
|
||||
* Primarily for building and managing Docker Compose environments
|
||||
* Built on Symfony
|
||||
* Create custom commands for your project environments
|
||||
* Alternative to a bash script or a Makefile
|
||||
* And more...
|
||||
|
||||
.. raw:: pdf
|
||||
|
||||
TextAnnotation "Available on GitHub, MIT licensed."
|
||||
TextAnnotation "Uses Config, Console, Dependency Injection, Expression Language, Finder and YAML components, as well as Twig."
|
||||
TextAnnotation "Replacement for commands like 'make build'"
|
||||
TextAnnotation "Useful for simplifying long, complicated commands, e.g. Docker, Ansible."
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
* Commands
|
||||
* Functions
|
||||
* Attributes
|
||||
* Encrypting/decrypting secrets
|
||||
* Generating configuration files
|
||||
* Global services: logging, mail, proxy
|
||||
|
||||
.. raw:: pdf
|
||||
|
||||
TextAnnotation "Generating settings.php files, Dockerfiles and Docker Compose from a central set of attributes."
|
||||
TextAnnotation "Logging with kibana, mailhog, Traefik proxy."
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
.. code-block:: bash
|
||||
:include: code/installation.txt
|
||||
|
||||
.. page:: imagePage
|
||||
|
||||
.. image:: images/output-simple.png
|
||||
:width: 15cm
|
||||
|
||||
.. page:: titlePage
|
||||
|
||||
.. class:: centredtitle
|
||||
|
||||
Replacing your Makefile
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
Running simple commands
|
||||
=======================
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/simple-command.txt
|
||||
:linenos:
|
||||
|
||||
.. page:: imagePage
|
||||
|
||||
.. image:: images/output-command.png
|
||||
:width: 15cm
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
'run' vs. 'passthru'
|
||||
====================
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/run-passthru.txt
|
||||
|
||||
.. image:: images/helper-run.png
|
||||
:width: 20cm
|
||||
|
||||
.. image:: images/helper-passthru.png
|
||||
:width: 20cm
|
||||
|
||||
Attributes
|
||||
==========
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/attributes.txt
|
||||
:linenos:
|
||||
|
||||
Arguments
|
||||
=========
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/arguments.txt
|
||||
:linenos:
|
||||
|
||||
Environment variables
|
||||
=====================
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/environment-variables.txt
|
||||
:linenos:
|
||||
|
||||
Managing secrets
|
||||
================
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/secrets.txt
|
||||
|
||||
.. raw:: pdf
|
||||
|
||||
TextAnnotation "Shortened for slides"
|
||||
TextAnnotation "Store default key in an overrides file that's ignored from Git, and somewhere secure like a password manager."
|
||||
|
||||
.. page:: titlePage
|
||||
|
||||
.. class:: centredtitle
|
||||
|
||||
Example: building slides from rst2pdf
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
Attributes
|
||||
==========
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/workspace-talks.txt
|
||||
:end-before: command('pdf generate <talk>'): |
|
||||
|
||||
Generating PDFs
|
||||
===============
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/workspace-talks.txt
|
||||
:start-at: command('pdf generate <talk>'): |
|
||||
:end-before: command('thumbnail <talk>'):
|
||||
|
||||
Generating thumbnails
|
||||
=====================
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/workspace-talks.txt
|
||||
:start-at: command('thumbnail <talk>'):
|
||||
|
||||
.. page:: titlePage
|
||||
|
||||
.. class:: centredtitle
|
||||
|
||||
Configuration files
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
Using confd
|
||||
===========
|
||||
|
||||
.. code-block:: yaml
|
||||
:include: code/confd.txt
|
||||
:linenos:
|
||||
|
||||
.. raw:: pdf
|
||||
|
||||
TextAnnotation ".twig file extension is assumed."
|
||||
|
||||
vhost.conf.twig
|
||||
===============
|
||||
|
||||
The source file.
|
||||
|
||||
|
|
||||
|
||||
.. code-block:: twig
|
||||
:include: code/nginx-vhost.txt
|
||||
:end-before: # output
|
||||
:linenos:
|
||||
|
||||
default.conf
|
||||
============
|
||||
|
||||
The generated file.
|
||||
|
||||
|
|
||||
|
||||
.. code-block:: nginx
|
||||
:include: code/nginx-vhost.txt
|
||||
:start-after: # output
|
||||
:linenos:
|
||||
|
||||
.. page:: titlePage
|
||||
|
||||
.. class:: centredtitle
|
||||
|
||||
Demo: "Workspacing" my site
|
||||
|
||||
.. page:: standardPage
|
||||
|
||||
Thanks!
|
||||
=======
|
||||
|
||||
References:
|
||||
|
||||
* https://github.com/my127/workspace
|
||||
* https://oliverdavies.link/workspace-demo
|
||||
* https://oliverdavies.link/workspacing-site
|
||||
|
||||
|
|
||||
|
||||
Me:
|
||||
|
||||
* https://www.oliverdavies.uk
|
Loading…
Add table
Add a link
Reference in a new issue