summaryrefslogtreecommitdiff
path: root/deploy-one-file-to-all-workers.sh
blob: a09589e130a7e2ad784d39a8aaf47b10f5797639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# Copyright (c) 2013, 2014, 2015 Intel, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; version 2 of the License
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.

# This copies one file to all workers,
# is called mainly from other scripts.
# 1st arg: source file
# 2nd arg: dest file (should have full path)
#
# List of workers is specified in /etc/jenkins-worker/workers.env
# Example contents:
# JENKINS_HOME=/var/lib/jenkins
# WORKERS="w1.b.c.d w2.b.c.d ..."
# DEBUG_WORKERS="w3.b.c.d"

. /etc/jenkins-worker/workers.env

SFILE=$1
DFILE=$2
DEBUG_DFILE=$3
cd $JENKINS_HOME
for W in $WORKERS ; do
  $RSYNC $SFILE $W:$DFILE
done
for W in $DEBUG_WORKERS ; do
  $RSYNC $SFILE $W:$DEBUG_DFILE
done