hi which module for GitHub because I am having difficult time finding the one you have, I have latest version of Jenkins and it doesn't have the one you have
Hi again, When setting a GitHub authentification mechanism, the swarm agent fail to connect to the master. Any idea how to overcome this? Tried several things but in vain ... Thx.
Since --detach=false was not specified, tasks will be created in the background. In a future release, --detach=false will become the default. I don't have any nodes.. any help please !
I got this error for: docker service create --name jenkins-master...etc. and second, for: docker service create \ --mode=global \... etc. anyway I learnt a lot from your tut! thx!
hey Krasi, I dealt with that errors... now I have all of them(nodes) in jenkins, but : This agent is offline because Jenkins failed to launch the agent process on it. See log for more details in Logs - no messages nothing, just pending cursor. I sow in this video you got the same problem.. at 10:27 you cut the video quick.... do you have any idea what can help me? Thank you for your time!
Hi, First of all thanks for the tutorial. I'm having trouble creating the service on stage and prod nodes, after creating in testing. ---test-- root@docker-swarm-testing ~ # docker service create \ > --mode=global \ > --name jenkins-swarm-agent \ > -e LABELS=docker-test \ > --mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \ > --mount "type=bind,source=/tmp/,target=/tmp/" \ > --secret source=jenkins-v1,target=jenkins \ > vipconsult/jenkins-swarm-agent x278b51m4qq6s4xhtz2srnni3 root@docker-swarm-testing bin # docker service ls ID NAME MODE REPLICAS IMAGE 2abp4epr6az3 jenkins-master replicated 1/1 jenkins:latest x278b51m4qq6 jenkins-swarm-agent global 0/3 vipconsult/jenkins-swarm-agent:latest root@docker-swarm-testing bin # -- stage -- root@docker-swarm-staging bin # docker service create \ > --mode=global \ > --name jenkins-swarm-agent \ > -e LABELS=docker-stage \ > --mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \ > --mount "type=bind,source=/tmp/,target=/tmp/" \ > --secret source=jenkins-v1,target=jenkins \ > vipconsult/jenkins-swarm-agent Error response from daemon: rpc error: code = 2 desc = name conflicts with an existing object root@docker-swarm-staging bin # root@docker-swarm-staging bin # docker service ls ID NAME MODE REPLICAS IMAGE 2abp4epr6az3 jenkins-master replicated 1/1 jenkins:latest x278b51m4qq6 jenkins-swarm-agent global 0/3 vipconsult/jenkins-swarm-agent:latest root@docker-swarm-staging bin # root@docker-swarm-staging bin # docker version Client: Version: 1.13.1 API version: 1.26 Package version: Go version: go1.7.4 Git commit: 3a17ad5/1.13.1 Built: Fri May 26 17:33:48 2017 OS/Arch: linux/amd64 Server: Version: 1.13.1 API version: 1.26 (minimum version 1.12) Package version: Go version: go1.7.4 Git commit: 3a17ad5/1.13.1 Built: Fri May 26 17:33:48 2017 OS/Arch: linux/amd64 Experimental: false root@docker-swarm-staging bin # --- Do you know what can be the issue? I've tried using different names, such as "--name jenkins-swarm-agent-stage" and "--name jenkins-swarm-agent-prod", and even thought that didn't error out, the nodes didn't show up in Jenkins - > manage nodes. Thanks
[Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Publish) [Pipeline] withDockerRegistry [Pipeline] // withDockerRegistry [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline GitHub has been notified of this commit’s build result ERROR: Could not find credentials matching DockerHub Finished: FAILURE hey, any ideas?
Hi, in Jenkins file you will see something like this """ stage("Publish") { withDockerRegistry([credentialsId: 'DockerHub']) { sh "docker push ${DOCKERHUB_USERNAME}/cd-demo:${BUILD_NUMBER}" }what you need to do is : to create a jenkins credentials with the name ID 'DockerHub' + your password and username from your docker hub...and after you will be fine..
mate, go to UI (user interface) Jenkins main page: 1. press credentials 2. press Add Credentials 3. insert your real passwd and user from dockerhub 4.on ID field write: DockerHub 5.Descriptions: blabla happy new year! :D
maybe, you missed something.. try again from the beginning.. watch again this video.. 1. you need to have 3 instances in docker Swarm mode 2. sudo usermod -a -G docker $USER (on all instances - slaves) +you need to restart docker 3. docker service create --name jenkins-master -p 50000:50000 -p 80:8080 jenkins (on master) + + install (Self-Organizing Swarm Plug-in) 4.echo "-master 35.2%%% -password admin -username admin" | docker secret create jenkins-v1 - ( on master and 2 nodes is the same SECRET WITH THE SAME IP like on master) 5. docker service create \ --mode=global \ --name jenkins-swarm-agent \ -e LABELS=docker-test \ ........ (on master) - 6.docker service create \ --mode=global \ --name jenkins-swarm-agent \ -e LABELS=docker-stage \ .....(node 1) 7. docker service create \ --mode=global \ --name jenkins-swarm-agent \ -e LABELS=docker-prod \... ...node2_) 8. now on jenkins main page you will see your (created nodes - slaves) 9. you need to create credentials in jenkins (for github and for dockerhub like i told you before) 10. you need to create a webhook in github ( search how to create a web hook jenkins and github) 11.clone the repo and change env.DOCKERHUB_USERNAME = 'yourdockerusername' 12. push to repo and jenkins will automaticaly will start the build 13. DONE your problem is in Pipeline] // withDockerRegistry ( check again credentials ID ) don;t give up and have fun! :D
very nice presentation, thanx a lot :)
how does the db containers retain it's db when updating it's image? i read in dockers is by mounting it on the volume. exactly how it's done?
hi which module for GitHub because I am having difficult time finding the one you have, I have latest version of Jenkins and it doesn't have the one you have
at 5:33 you say it is a docker service how do you log into a service it is not a container
Thank you...
awsome thanks
Nice ...Which was tool used to open the port ?
open the port ? not sure what do you mean , which part in the video ?
Hi again,
When setting a GitHub authentification mechanism, the swarm agent fail to connect to the master. Any idea how to overcome this? Tried several things but in vain ...
Thx.
Found how to do it: using Personal access tokens and docker secrets. thx.
Hello, which version of docker was used for this demo?
I think 1.13 , but I am not too sure. It shouldn't make any difference as I don't they have changed anything drastically the last few months.
Cool
Thanks, this will help me a lot!
Since --detach=false was not specified, tasks will be created in the background.
In a future release, --detach=false will become the default.
I don't have any nodes.. any help please !
best to ask in the docker irc channel or their forums.
I got this error for: docker service create --name jenkins-master...etc. and second, for: docker service create \ --mode=global \... etc. anyway I learnt a lot from your tut! thx!
hey Krasi, I dealt with that errors... now I have all of them(nodes) in jenkins, but : This agent is offline because Jenkins failed to launch the agent process on it. See log for more details
in Logs - no messages nothing, just pending cursor. I sow in this video you got the same problem.. at 10:27 you cut the video quick.... do you have any idea what can help me? Thank you for your time!
it is at 6:07
Excellent, very useful, your links are not working though, I guess it is your intranet they point to =(
try this new link: github.com/krasi-georgiev/cd-demo
hi how did you log into that node to get Jenkins password inorder to get it proceed
what time in the video is this ?
6:07
I logged in using ssh , you can use VmWare on your laptop or open a free account with AWS and you will get a VM with ssh enabled.
I ran this on docker swarm I need to do is docker exec "process id" /bin/sh
and then just do more on /var/jenkins_home/secrets/initialAdminPassword
Hi, First of all thanks for the tutorial. I'm having trouble creating the service on stage and prod nodes, after creating in testing.
---test--
root@docker-swarm-testing ~ # docker service create \
> --mode=global \
> --name jenkins-swarm-agent \
> -e LABELS=docker-test \
> --mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \
> --mount "type=bind,source=/tmp/,target=/tmp/" \
> --secret source=jenkins-v1,target=jenkins \
> vipconsult/jenkins-swarm-agent
x278b51m4qq6s4xhtz2srnni3
root@docker-swarm-testing bin # docker service ls
ID NAME MODE REPLICAS IMAGE
2abp4epr6az3 jenkins-master replicated 1/1 jenkins:latest
x278b51m4qq6 jenkins-swarm-agent global 0/3 vipconsult/jenkins-swarm-agent:latest
root@docker-swarm-testing bin #
-- stage --
root@docker-swarm-staging bin # docker service create \
> --mode=global \
> --name jenkins-swarm-agent \
> -e LABELS=docker-stage \
> --mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \
> --mount "type=bind,source=/tmp/,target=/tmp/" \
> --secret source=jenkins-v1,target=jenkins \
> vipconsult/jenkins-swarm-agent
Error response from daemon: rpc error: code = 2 desc = name conflicts with an existing object
root@docker-swarm-staging bin #
root@docker-swarm-staging bin # docker service ls
ID NAME MODE REPLICAS IMAGE
2abp4epr6az3 jenkins-master replicated 1/1 jenkins:latest
x278b51m4qq6 jenkins-swarm-agent global 0/3 vipconsult/jenkins-swarm-agent:latest
root@docker-swarm-staging bin #
root@docker-swarm-staging bin # docker version
Client:
Version: 1.13.1
API version: 1.26
Package version:
Go version: go1.7.4
Git commit: 3a17ad5/1.13.1
Built: Fri May 26 17:33:48 2017
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version:
Go version: go1.7.4
Git commit: 3a17ad5/1.13.1
Built: Fri May 26 17:33:48 2017
OS/Arch: linux/amd64
Experimental: false
root@docker-swarm-staging bin #
---
Do you know what can be the issue? I've tried using different names, such as "--name jenkins-swarm-agent-stage" and "--name jenkins-swarm-agent-prod", and even thought that didn't error out, the nodes didn't show up in Jenkins - > manage nodes.
Thanks
check the jenkins-swarm-agent service logs, it should give you some clue.
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Publish)
[Pipeline] withDockerRegistry
[Pipeline] // withDockerRegistry
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
GitHub has been notified of this commit’s build result
ERROR: Could not find credentials matching DockerHub
Finished: FAILURE
hey, any ideas?
Hi, in Jenkins file you will see something like this """ stage("Publish") {
withDockerRegistry([credentialsId: 'DockerHub']) {
sh "docker push ${DOCKERHUB_USERNAME}/cd-demo:${BUILD_NUMBER}"
}what you need to do is : to create a jenkins credentials with the name ID 'DockerHub' + your password and username from your docker hub...and after you will be fine..
mate, go to UI (user interface) Jenkins main page: 1. press credentials
2. press Add Credentials
3. insert your real passwd and user from dockerhub
4.on ID field write: DockerHub
5.Descriptions: blabla
happy new year! :D
maybe, you missed something..
try again from the beginning..
watch again this video..
1. you need to have 3 instances in docker Swarm mode
2. sudo usermod -a -G docker $USER (on all instances - slaves) +you need to restart docker
3. docker service create --name jenkins-master -p 50000:50000 -p 80:8080 jenkins (on master) + + install (Self-Organizing Swarm Plug-in)
4.echo "-master 35.2%%% -password admin -username admin" | docker secret create jenkins-v1 - ( on master and 2 nodes is the same SECRET WITH THE SAME IP like on master)
5. docker service create \
--mode=global \
--name jenkins-swarm-agent \
-e LABELS=docker-test \ ........
(on master) -
6.docker service create \
--mode=global \
--name jenkins-swarm-agent \
-e LABELS=docker-stage \
.....(node 1)
7. docker service create \
--mode=global \
--name jenkins-swarm-agent \
-e LABELS=docker-prod \...
...node2_)
8. now on jenkins main page you will see your (created nodes - slaves)
9. you need to create credentials in jenkins (for github and for dockerhub like i told you before)
10. you need to create a webhook in github ( search how to create a web hook jenkins and github)
11.clone the repo and change env.DOCKERHUB_USERNAME = 'yourdockerusername'
12. push to repo and jenkins will automaticaly will start the build
13. DONE
your problem is in Pipeline] // withDockerRegistry ( check again credentials ID )
don;t give up and have fun! :D
nope :(
git commit --allow-empty -m "Trigger notification"
:)
got it working just fine, stupid mistake with IP's lol