Run Deno scripts to provision stuff with Packer.
This plugin first installs Deno onto the target system, uploads scripts to a folder, and then executes them one by one.
Only Ubuntu is known to work with the normal installer script. Provisioning
other operating systems works if you use a custom built Deno that will
run on that system, and upload it with this plugin using
This provisioner is a Packer plugin. See the docs for an overview.
Build or download this plugin and place in
You may need to create the plugins directory.
You must specify
"type": "deno" in a provisioners stanza to use this plugin.
The following provisioner config keys are supported. See also the examples directory.
local_deno_bin(string) - A fully qualified path to a local deno executable. This binary will be uploaded to the target
remote_folder, and used for running scripts. Useful for development if you are building deno from source.
skip_install(boolean) - If
true, do not install Deno on the target machine, but assume it is already present.
remote_folder(string) - The target directory where
scriptswill be uploaded.
scripts(array of string) - A list of paths to TypeScript files that will be passed to
deno run -A, one by one, in order. These are your provisioning scripts. Currently, these must be standalone scripts with no path-based dependencies.
Development and Tests
You will need Go 1.11 or later with
export GO111MODULE=on for module support.
$GOPATH/bin should be on your PATH. That's $HOME/go/bin by default, but
can vary depending on your setup.
If you want to hack, make a symlink from $GOPATH/bin/packer-provisioner-deno
to the packer plugins directory. Something like this should work, after an
ln -s $GOPATH/bin/packer-provisioner-deno $HOME/.packer.d/plugins/packer-provisioner-deno
After that, run the test script
A test build will run in a Docker container.
We want to accomplish the following
- Install deno onto target system
- Upload individual deno scripts
- Execute individual deno scripts as root
- Add a DigitalOcean cloud builder test
- Allow uploading local deno builds easily (for testing local dev builds)
- Manually bundle scripts locally and upload those, instead. Or, wait for this feature.
- Execute scripts as non-root user
- Specify sandboxing flags in the packer config (
--allow-netand friends; we run with
- Global system install of deno outside any user's HOME
- Add a Vagrant builder test
- Specify alternative install command (for test deno builds fetchable from network)