Update to Sauce Connect 4.0
This commit is contained in:
parent
dd2e767944
commit
74aa1fe9ac
Binary file not shown.
|
@ -1,20 +0,0 @@
|
|||
# You must define:
|
||||
# $JAVA: absolute path to java bin
|
||||
# $SAUCE_CONNECT: absolute path to sauce connect .jar
|
||||
# $API_USER: your username at SauceLabs
|
||||
# $API_KEY: your API KEY for this username
|
||||
# $USERNAME: Use this username to run SauceConnect
|
||||
# $GROUP: Use this group to run SauceConnect
|
||||
# $LOG_DIR: directory to put log files. Be aware $USERNAME:$GROUP must have
|
||||
# permission to write there, if not it will die silently at start
|
||||
#
|
||||
# You can also override any variable used in /etc/init.d/sauce-connect too, if
|
||||
# you know what you are doing. For example, you can override $PIDFILE.
|
||||
|
||||
JAVA=/usr/lib/jvm/java-6-openjdk/jre/bin/java
|
||||
SAUCE_CONNECT=/usr/share/sauce/Sauce-Connect.jar
|
||||
API_USER=
|
||||
API_KEY=
|
||||
USERNAME=
|
||||
GROUP=
|
||||
LOG_DIR=/var/log/sauce
|
|
@ -29,9 +29,8 @@ DAEMON=""
|
|||
# You must configure there your API KEY too
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
DAEMON="$JAVA"
|
||||
DAEMON_ARGS=" -jar $SAUCE_CONNECT $API_USER $API_KEY"
|
||||
|
||||
DAEMON="$SAUCE_CONNECT"
|
||||
DAEMON_ARGS="--logfile $LOG_FILE -u $API_USER -k $API_KEY"
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
@ -53,11 +52,15 @@ do_start()
|
|||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon -b -m -c $USERNAME:$GROUP --chdir $LOG_DIR --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
|
||||
#start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|
||||
# || return 1
|
||||
|
||||
CUSER=""
|
||||
[ -n "$USERNAME" ] && [ -n "$GROUP"] && CUSER="-c $USERNAME:$GROUP"
|
||||
start-stop-daemon -b -m --chdir $LOG_DIR $CUSER --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
sleep 10
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
|
|
|
@ -8,13 +8,13 @@ class sauceconnect::daemon($username, $apikey) {
|
|||
'/etc/default/sauce-connect' :
|
||||
ensure => present,
|
||||
content => "
|
||||
JAVA=/usr/lib/jvm/java-6-openjdk/jre/bin/java
|
||||
SAUCE_CONNECT=/usr/share/sauce/Sauce-Connect.jar
|
||||
SAUCE_CONNECT=/usr/share/sauce/sc
|
||||
API_USER=${username}
|
||||
API_KEY=${apikey}
|
||||
USERNAME=
|
||||
GROUP=
|
||||
LOG_DIR=${logdir}
|
||||
LOG_FILE=${logdir}/sc.log
|
||||
";
|
||||
|
||||
'/etc/init.d/sauce-connect' :
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
class sauceconnect::debian {
|
||||
package {
|
||||
'openjdk-6-jre' :
|
||||
ensure => present;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ class sauceconnect($username="", $apikey="") {
|
|||
$dir :
|
||||
ensure => directory;
|
||||
|
||||
"$dir/Sauce-Connect.jar" :
|
||||
"$dir/sc" :
|
||||
ensure => present,
|
||||
require => File[$dir],
|
||||
source => 'puppet:///modules/sauceconnect/Sauce-Connect.jar';
|
||||
source => 'puppet:///modules/sauceconnect/sc';
|
||||
}
|
||||
|
||||
class {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'sauceconnect::debian' do
|
||||
it 'should install the JRE' do
|
||||
should contain_package('openjdk-6-jre').with({
|
||||
'ensure' => 'present'
|
||||
})
|
||||
end
|
||||
end
|
|
@ -5,14 +5,14 @@ describe 'sauceconnect' do
|
|||
{:osfamily => 'debian'}
|
||||
end
|
||||
|
||||
it 'should create a directory for the jar file' do
|
||||
it 'should create a directory for the sc binary' do
|
||||
should contain_file('/usr/share/sauce').with({
|
||||
'ensure' => 'directory'
|
||||
})
|
||||
end
|
||||
|
||||
it 'should place the jar file' do
|
||||
should contain_file('/usr/share/sauce/Sauce-Connect.jar').with({
|
||||
it 'should place the sc binary' do
|
||||
should contain_file('/usr/share/sauce/sc').with({
|
||||
'ensure' => 'present',
|
||||
'require' => 'File[/usr/share/sauce]'
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue