Skip to content

Commit f8b0cde

Browse files
authored
Merge pull request rancher#2 from hayderimran7/add-label-support
Add support for label and name of slave.
2 parents 75c461a + 8af628e commit f8b0cde

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ You can specify optional environment variables below when invoking docker run to
1919
| Parameter | Default Value | Description |
2020
|-----------------|---------------------|----------------------------------------------------------------------------|
2121
| SLAVE_EXECUTORS | number of cpu cores | This value specifies the number of concurrent jobs this worker can process |
22+
| SLAVE_NAME | swarm-client | This value specifies the name of slave that will appear on Jenkins UI |
23+
| SLAVE_LABELS | None | This value specifies the labels you want to give for the launching slave |

cmd.sh

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ fi
1313
if [ ! -z "$SLAVE_EXECUTORS" ]; then
1414
PARAMS="$PARAMS -executors $SLAVE_EXECUTORS"
1515
fi
16+
if [ ! -z "$SLAVE_LABELS" ]; then
17+
PARAMS="$PARAMS -labels $SLAVE_LABELS"
18+
fi
19+
if [ ! -z "$SLAVE_NAME" ]; then
20+
PARAMS="$PARAMS -name $SLAVE_NAME"
21+
fi
1622
if [ ! -z "$JENKINS_MASTER" ]; then
1723
PARAMS="$PARAMS -master $JENKINS_MASTER"
1824
else

0 commit comments

Comments
 (0)