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
|
# You must configure there your API KEY too
|
||||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||||
|
|
||||||
DAEMON="$JAVA"
|
DAEMON="$SAUCE_CONNECT"
|
||||||
DAEMON_ARGS=" -jar $SAUCE_CONNECT $API_USER $API_KEY"
|
DAEMON_ARGS="--logfile $LOG_FILE -u $API_USER -k $API_KEY"
|
||||||
|
|
||||||
|
|
||||||
# Exit if the package is not installed
|
# Exit if the package is not installed
|
||||||
[ -x "$DAEMON" ] || exit 0
|
[ -x "$DAEMON" ] || exit 0
|
||||||
|
@ -53,11 +52,15 @@ do_start()
|
||||||
# 0 if daemon has been started
|
# 0 if daemon has been started
|
||||||
# 1 if daemon was already running
|
# 1 if daemon was already running
|
||||||
# 2 if daemon could not be started
|
# 2 if daemon could not be started
|
||||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|
#start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|
||||||
|| return 1
|
# || return 1
|
||||||
start-stop-daemon -b -m -c $USERNAME:$GROUP --chdir $LOG_DIR --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
|
|
||||||
|
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 \
|
$DAEMON_ARGS \
|
||||||
|| return 2
|
|| return 2
|
||||||
|
sleep 10
|
||||||
# Add code here, if necessary, that waits for the process to be ready
|
# Add code here, if necessary, that waits for the process to be ready
|
||||||
# to handle requests from services started subsequently which depend
|
# to handle requests from services started subsequently which depend
|
||||||
# on this one. As a last resort, sleep for some time.
|
# on this one. As a last resort, sleep for some time.
|
||||||
|
|
|
@ -8,13 +8,13 @@ class sauceconnect::daemon($username, $apikey) {
|
||||||
'/etc/default/sauce-connect' :
|
'/etc/default/sauce-connect' :
|
||||||
ensure => present,
|
ensure => present,
|
||||||
content => "
|
content => "
|
||||||
JAVA=/usr/lib/jvm/java-6-openjdk/jre/bin/java
|
SAUCE_CONNECT=/usr/share/sauce/sc
|
||||||
SAUCE_CONNECT=/usr/share/sauce/Sauce-Connect.jar
|
|
||||||
API_USER=${username}
|
API_USER=${username}
|
||||||
API_KEY=${apikey}
|
API_KEY=${apikey}
|
||||||
USERNAME=
|
USERNAME=
|
||||||
GROUP=
|
GROUP=
|
||||||
LOG_DIR=${logdir}
|
LOG_DIR=${logdir}
|
||||||
|
LOG_FILE=${logdir}/sc.log
|
||||||
";
|
";
|
||||||
|
|
||||||
'/etc/init.d/sauce-connect' :
|
'/etc/init.d/sauce-connect' :
|
||||||
|
|
|
@ -1,6 +1,2 @@
|
||||||
class sauceconnect::debian {
|
class sauceconnect::debian {
|
||||||
package {
|
|
||||||
'openjdk-6-jre' :
|
|
||||||
ensure => present;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,10 @@ class sauceconnect($username="", $apikey="") {
|
||||||
$dir :
|
$dir :
|
||||||
ensure => directory;
|
ensure => directory;
|
||||||
|
|
||||||
"$dir/Sauce-Connect.jar" :
|
"$dir/sc" :
|
||||||
ensure => present,
|
ensure => present,
|
||||||
require => File[$dir],
|
require => File[$dir],
|
||||||
source => 'puppet:///modules/sauceconnect/Sauce-Connect.jar';
|
source => 'puppet:///modules/sauceconnect/sc';
|
||||||
}
|
}
|
||||||
|
|
||||||
class {
|
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'}
|
{:osfamily => 'debian'}
|
||||||
end
|
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({
|
should contain_file('/usr/share/sauce').with({
|
||||||
'ensure' => 'directory'
|
'ensure' => 'directory'
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should place the jar file' do
|
it 'should place the sc binary' do
|
||||||
should contain_file('/usr/share/sauce/Sauce-Connect.jar').with({
|
should contain_file('/usr/share/sauce/sc').with({
|
||||||
'ensure' => 'present',
|
'ensure' => 'present',
|
||||||
'require' => 'File[/usr/share/sauce]'
|
'require' => 'File[/usr/share/sauce]'
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue