Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fleet-templater

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fleet-templater

Fleet unit-file templating system

  • 2.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Fleet Templater

Fleet Templater is a simple program that will process Fleet unit files through a templating system.

In other words, you can take a file named myservice-{{env}}.service which contains the following content:

[Unit]
Description=myservice-{{env}}
Requires=docker.service
After=docker.service

[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill %p-%i
ExecStartPre=-/usr/bin/docker rm %p-%i
ExecStartPre=/usr/bin/docker pull myservice:{{env}}
ExecStart=/usr/bin/docker run -e ENV={{env}} myservice:{{env}}
ExecStop=/usr/bin/docker kill %p-%i

and then process it with env=production to produce myservice-production.service containing the following completed data:

[Unit]
Description=myservice-production
Requires=docker.service
After=docker.service

[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill %p-%i
ExecStartPre=-/usr/bin/docker rm %p-%i
ExecStartPre=/usr/bin/docker pull myservice:production
ExecStart=/usr/bin/docker run -e ENV=production myservice:production
ExecStop=/usr/bin/docker kill %p-%i

Installing and running with NodeJS

npm install -g node-templater
node-templater --help
node-templater test.service ./ myval=thing

Running as a docker container

docker pull yodlr/fleet-templater
docker run --rm -ti -v ${PWD}:/tmp fleet-templater /tmp/test.service /tmp/ myval=thing

Keywords

FAQs

Package last updated on 15 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc