Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jenkins-slave
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Legacy
jenkins-slave
Commits
5d01be9d
Commit
5d01be9d
authored
11 years ago
by
Erik Hedenström
Browse files
Options
Downloads
Patches
Plain Diff
Made starting swarm client optional
parent
3a1e402e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+2
-1
2 additions, 1 deletion
Dockerfile
init.sh
+12
-10
12 additions, 10 deletions
init.sh
with
14 additions
and
11 deletions
Dockerfile
+
2
−
1
View file @
5d01be9d
...
...
@@ -26,11 +26,12 @@ RUN mkdir -p /var/run/sshd
ENV
JENKINS_HOME /var/lib/jenkins
ADD
init.sh /init.sh
ADD
install /tmp/install
RUN for
INSTALLER
in
`
ls
/tmp/install/
0
*
.sh |
sort
-n
`
;
do
/bin/bash
$INSTALLER
;
done
&&
rm
-rf
/tmp/install
RUN for
INSTALLER
in
`
ls
/tmp/install/
*
.sh |
sort
-n
`
;
do
/bin/bash
$INSTALLER
;
done
&&
rm
-rf
/tmp/install
# Start Jenkins Slave
ENV
SWARM_USER jenkins
ENV
SWARM_PASSWORD pC4oLhceTFo4fzzVugzZ
ENV
SWARM_EXECUTORS 1
EXPOSE
22
VOLUME
["/var/lib/jenkins"]
CMD
["/bin/bash", "/init.sh"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
init.sh
+
12
−
10
View file @
5d01be9d
...
...
@@ -2,13 +2,15 @@
set
-e
# Exit on errors
# Check if required parameters are set
:
${
SWARM_MASTER
:?
"Please use 'docker run -e SWARM_MASTER=...' to run this container!"
}
echo
"-> Starting Jenkins Slave ..."
if
[
${
SWARM_MASTER
:+x
}
]
;
then
echo
"-> Starting SSH Daemon & Swarm Client ..."
echo
" - SWARM_MASTER:
$SWARM_MASTER
"
echo
" - SWARM_USER:
$SWARM_USER
"
echo
" - SWARM_PASSWORD:
$SWARM_PASSWORD
"
echo
" - SWARM_EXECUTORS:
$SWARM_EXECUTORS
"
/usr/sbin/sshd
su
-l
$JENKINS_USER
--shell
=
/bin/bash
-c
"java -jar /var/lib/jenkins/tools/swarm/swarm-client.jar -master
$SWARM_MASTER
-username
$SWARM_USER
-password
$SWARM_PASSWORD
"
su
-l
$JENKINS_USER
--shell
=
/bin/bash
-c
"java -jar /var/lib/jenkins/tools/swarm/swarm-client.jar -executors
$SWARM_EXECUTORS
-master
$SWARM_MASTER
-username
$SWARM_USER
-password
$SWARM_PASSWORD
"
else
echo
"-> Starting SSH Daemon ..."
/usr/sbin/sshd
-e
-D
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment