cloud-init-compile
Clic (cloud-init-compile) bundles several scripts and data files into a single cloud-init-friendly script. The program's output can be embedded in VM-provisioning scripts for DigitalOcean or other cloud provider.
Why?
I've ran into this problem too often in work when working with VM provisioning. In particular, I wanted to send and run multiple files & scripts without resorting to a complex build-tool like Ansible.
Usage
For both examples, I'll use the following local file layout:
./
installer.sh
main.shWith the files:
# installer.sh
sudo apt-get install htop --assume-yes# main.sh
source ./installer.sh
echo "done."CLI Usage
clic -zr main.sh -- installer.sh main.shH4sIAAAAAAACA3WNywrCMBBF9/MVYwrdSJofKG58QEHsRtclpoMpNEnpJKJ/76YBi7g7lwvnFBuVeFb3wSvyT2QLRkesa9yf29uhay7NtTu2J9yhGDxHPY40V2wFFPi9gVMfUE9RPijmB20ME0qpmZMj+SYGgLX3f83pwS+hBQE4pNkQVmqVJmMDij54qsSv37rQ4/aVJViWGT8HVaT++wAAAA==API Usage
const content = await clic.api({
gzip: true,
fpaths: [
'installer.sh',
'main.sh'
],
toRun: 'main.sh'
})Installation
npm install rgrannell1/cloud-init-compile --global