Navigation Menu

Skip to content

Commit

Permalink
generic-worker on macOS: move generic-worker.plist template to a sepa…
Browse files Browse the repository at this point in the history
…rate file
  • Loading branch information
SimonSapin committed Nov 15, 2018
1 parent fe0e1ae commit ef4e72c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
18 changes: 18 additions & 0 deletions etc/taskcluster/macos/states/generic-worker.plist.jinja
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key> <string>net.generic.worker</string>
<key>KeepAlive</key> <true/>
<key>StandardOutPath</key> <string>stdout.log</string>
<key>StandardErrorPath</key> <string>stderr.log</string>
<key>WorkingDirectory</key> <string>{{ home }}</string>
<key>UserName</key> <string>{{ user }}</string>
<key>ProgramArguments</key> <array>
<string>{{ bin }}/generic-worker</string>
<string>run</string>
<string>--config</string>
<string>{{ etc }}/config.json</string>
</array>
</dict>
</plist>
38 changes: 6 additions & 32 deletions etc/taskcluster/macos/states/generic-worker.sls
Expand Up @@ -77,38 +77,12 @@
file.managed:
- mode: 644
- template: jinja
- contents: >-
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.generic.worker</string>
<key>ProgramArguments</key>
<array>
<string>{{ bin }}/generic-worker</string>
<string>run</string>
<string>--config</string>
<string>{{ etc }}/config.json</string>
</array>

<key>KeepAlive</key>
<true/>

<key>WorkingDirectory</key>
<string>{{ home }}</string>

<key>UserName</key>
<string>{{ user }}</string>

<key>StandardOutPath</key>
<string>stdout.log</string>

<key>StandardErrorPath</key>
<string>stderr.log</string>
</dict>
</plist>
- source: salt://generic-worker.plist.jinja
- context:
bin: {{ bin }}
etc: {{ etc }}
home: {{ home }}
user: {{ user }}

net.generic.worker:
service.running:
Expand Down
2 changes: 1 addition & 1 deletion etc/taskcluster/macos/states/top.sls
@@ -1,3 +1,3 @@
base:
'mac*':
- generic-worker
- generic-worker

0 comments on commit ef4e72c

Please sign in to comment.