Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Working with Workspace
Search
Oliver Davies
February 02, 2021
Technology
0
670
Working with Workspace
https://www.oliverdavies.uk/talks/working-with-workspace
Oliver Davies
February 02, 2021
Tweet
Share
More Decks by Oliver Davies
See All by Oliver Davies
Building Static Websites with Sculpin
opdavies
0
1.3k
Taking Flight with Tailwind CSS
opdavies
0
4.5k
TDD - Test Driven Drupal
opdavies
0
3.2k
Building "Build Configs"
opdavies
0
300
Communities and contribution
opdavies
0
100
Working without Workspace
opdavies
0
170
Things you should know about PHP
opdavies
1
670
An Introduction to Mob Programming
opdavies
0
200
Deploying PHP applications with Ansible, Ansible Vault and Ansistrano
opdavies
0
5.9k
Other Decks in Technology
See All in Technology
CTOから見た事業開発とプロダクト開発 / My Perspective on Business and Product Development as CTO
keisuke69
4
960
運用改善、不都合な真実 / 20240722-ssmjp-kaizen
opelab
17
8k
推薦システムを本番導入する上で一番優先すべきだったこと~NewsPicks記事推薦機能の改善事例を元に~
morinota
0
120
公共領域から学ぶ クラウド移行についてエンジニアが意識していること
kawakawa2222
0
140
「単なる OAuth 2.0 を認証に使うと、車が通れるほどのどでかいセキュリティー・ホールができる」のか検証してみた
terara
0
380
ゆめみのアクセシビリティの現在地と今後
ryokatsuse
3
290
シフトレフトで挑む セキュリティの生産性向上
sekido
PRO
0
270
フルリモートワークはエンジニアの夢を叶えたか? #cm_odyssey
mamohacy
2
600
[NIKKEI Tech Talk] KDDI/KAG Scrum & Community for Engineering Training
curanosuke
2
220
AWSで”最小権限の原則”を実現するための考え方 /20240722-ssmjp-aws-least-privilege
opelab
10
4.3k
【基調講演】変える、今ここから ― IoTとAIで紡ぐ未来
soracom
PRO
0
320
RAGのサービスをリリースして1年3ヶ月が経ちました
segavvy
4
910
Featured
See All Featured
Side Projects
sachag
451
42k
A Tale of Four Properties
chriscoyier
155
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
28
2.2k
Thoughts on Productivity
jonyablonski
64
4.1k
BBQ
matthewcrist
82
9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
129
32k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
90
47k
Optimizing for Happiness
mojombo
373
69k
Adopting Sorbet at Scale
ufuk
71
8.8k
The Language of Interfaces
destraynor
151
23k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
2.9k
Transcript
Working with Workspace Oliver Davies, Inviqa
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... @opdavies
Features • Commands • Functions • Attributes • Encrypting/decrypting secrets
• Generating configuration files • Global services: logging, mail, proxy @opdavies
Installation # 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 @opdavies
@opdavies
Replacing your Makefile @opdavies
Running simple commands 1 # workspace.yml 2 3 workspace('oliverdavies-uk'): 4
description: My personal website codebase. 5 6 command('say-hello'): 7 #!bash 8 echo 'Hello world' 9 10 command('say-hello'): 11 #!php 12 echo 'Hello World'; @opdavies
@opdavies
'run' vs. 'passthru' command('say-hello'): #!bash run echo 'Hello World' passthru
echo 'Hello World' @opdavies
Attributes 1 attribute('message'): Hello World! 2 3 command('say-hello'): | 4
#!bash|@ 5 echo @('message') @opdavies
Arguments 1 command('say-hello <name>'): | 2 #!bash|= 3 echo ={
@('message') } from ={ input.argument('name') } @opdavies
Environment variables 1 command('say-hello <name>'): 2 env: 3 MESSAGE: =
@('message') 4 NAME: = input.argument('name') 5 exec: | 6 #!bash|= 7 echo "$MESSAGE from $NAME" @opdavies
Managing secrets # ws secret generate-random-key key('default'): 'd38be3b7aa42fdbfb14c0d25f07bc1875edd5f13f640cd76' # ws
secret encrypt 'Hello World!' attribute('message'): = decrypt('YTozOntpOjA7czo3OiJkZWZhdWx0Ijt') command('say-hello'): | #!bash|@ echo @('message') @opdavies
Example: building slides from rst2pdf @opdavies
Attributes 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 @opdavies
Generating PDFs 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') }" @opdavies
Generating thumbnails 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 @opdavies
Configuration files @opdavies
Using confd 1 attributes: 2 drupal: 3 docroot: web 4
5 command('apply config'): | 6 #!php 7 $ws->confd('workspace:/confd')->apply(); 8 9 confd('workspace:/confd'): 10 - src: 'vhost.conf' 11 dst: 'workspace:/.my127ws/docker/nginx/default.conf' @opdavies
vhost.conf.twig The source file. 1 server { 2 server_name _;
3 root /app/{{ @('drupal.docroot' )}}; 4 @opdavies
default.conf The generated file. 1 server { 2 server_name _;
3 root /app/web; 4 @opdavies
Demo: "Workspacing" my site @opdavies
Thanks! References: • https://github.com/my127/workspace • https://oliverdavies.link/workspace-demo • https://oliverdavies.link/workspacing-site Me: •
https://www.oliverdavies.uk @opdavies