Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace plist with service block #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
43 changes: 9 additions & 34 deletions Formula/appveyor-build-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,16 @@ def caveats
end


plist_options :startup => true

def plist
<<~EOS
<?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>KeepAlive</key>
<false/>
<key>Label</key>
<string>#{plist_name}</string>
<key>Program</key>
<string>#{prefix}/appveyor-build-agent</string>
<key>ProgramArguments</key>
<array>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{prefix}</string>
<key>StandardErrorPath</key>
<string>#{prefix}/build-agent.stderr.log</string>
<key>StandardOutPath</key>
<string>#{prefix}/build-agent.stdout.log</string>
</dict>
</plist>
EOS
service do
run "#{opt_prefix}/appveyor-build-agent"
keep_alive successful_exit: true
environment_variables PATH: "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
working_dir "#{var}/appveyor/build-agent/"
log_path "#{var}/build-agent.stdout.log"
error_log_path "#{var}/build-agent.stderr.log"
run_at_load true
end

test do
# `test do` will create, run in and delete a temporary directory.
#
Expand Down
35 changes: 7 additions & 28 deletions Formula/appveyor-host-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,13 @@ def caveats
end


plist_options :startup => false

def plist
<<~EOS
<?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>KeepAlive</key>
<false/>
<key>Label</key>
<string>#{plist_name}</string>
<key>Program</key>
<string>#{prefix}/appveyor-host-agent</string>
<key>ProgramArguments</key>
<array>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}/appveyor/host-agent/</string>
<key>StandardErrorPath</key>
<string>#{var}/appveyor/host-agent/host-agent.stderr.log</string>
<key>StandardOutPath</key>
<string>#{var}/appveyor/host-agent/host-agent.stdout.log</string>
</dict>
</plist>
EOS
service do
run "#{opt_prefix}/appveyor-host-agent"
keep_alive successful_exit: true
log_path "#{var}/appveyor/host-agent/host-agent.stdout.log"
error_log_path "#{var}/appveyor/host-agent/host-agent.stderr.log"
working_dir "#{var}/appveyor/host-agent/"
run_at_load false
end

test do
Expand Down