Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Created September 11, 2017 17:37
Show Gist options
  • Save thosakwe/c52335a17354e3857129da1668c8da85 to your computer and use it in GitHub Desktop.
Save thosakwe/c52335a17354e3857129da1668c8da85 to your computer and use it in GitHub Desktop.
Reproducible server configuration DSL
@platform('debian')
@require('apt-transport-https')
proc dartSdk() {
sudo "sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'"
sudo "sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'"
sudo "apt-get update"
env_add ('PATH', '/usr/lib/dart/bin') // Either this
path_add 'apt-get install dart' // Or this
sudo "apt-get install -y dart"
}
proc myServer() {
on_startup "path/to/my/script"
}
  • Every function must be uniquely-named
  • Progress should store a stat of the file, and the line index
proc foo(stringArg, boolArg?, numArg#) {
bar := 'baz'
hello := @exec('echo world')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment