Skip to content

Commit

Permalink
Instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
vfarcic committed Apr 30, 2017
1 parent a50e47a commit b637a09
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@ Usage

The environment variable COMMAND_OPTIONS has to be specified with non-empty value, which is a combination of all swarm client options you need. Please refer to this [Swarm Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin) for all available options.

**Warning** For the username and password, it makes use of [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/).
Please see [jenkins-swarm-agent.yml](https://github.com/vfarcic/docker-flow-stacks/tree/master/jenkins#jenkins-swarm-agentyml) for an example how to use *Jenkins Swarm Agent* with Jenkins master username and password specified as environment variables.

You can run this service as follows:

```bash
docker service create --name $JENKINS_AGENT_SERVICE \
--secret source=jenkins-master1-usr,target=jks-admin-usr \
--secret source=jenkins-master1-pass,target=jks-admin-pass \
-e USER_NAME_SECRET="/run/secrets/jks-admin-usr"\
-e PASSWORD_SECRET="/run/secrets/jks-admin-pass"\
-e COMMAND_OPTIONS="-master http://${MASTER_URL}:8080 \
-labels 'docker' -executors 3
-fsroot /tmp" \
--network $NETWORK \
--mode global \
--mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \
--mount "type=bind,source=/tmp,target=/tmp/workspace" \
vfarcic/jenkins-swarm-agent
```
Please see [jenkins-swarm-agent-secrets.yml](https://github.com/vfarcic/docker-flow-stacks/tree/master/jenkins#jenkins-swarm-agent-secretsyml) for an example how to use *Jenkins Swarm Agent* with Jenkins master username and password specified as Docker secrets.

0 comments on commit b637a09

Please sign in to comment.