Last active
May 9, 2016 05:42
-
-
Save marsyang1/c5fbfff3eb106568045f00f9a7dde3aa to your computer and use it in GitHub Desktop.
Jenkins Gitlab integration note
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. use docker | |
| # ambassador | |
| docker run -d \ | |
| --name ambassador \ | |
| --restart always \ | |
| --volume /var/run/docker.sock:/var/run/docker.sock \ | |
| cpuguy83/docker-grand-ambassador -name jenkins -name gitlab | |
| #jenkins | |
| docker run -d \ | |
| --name jenkins \ | |
| --restart always \ | |
| -p 8001:8080 \ | |
| --link ambassador:gitlab \ | |
| --link nexus \ | |
| -v /home/jenkins_home:/var/jenkins_home \ | |
| -e JAVA_OPTS='-Xmx2048m -Xms256m -XX:PermSize=128m -XX:MaxPermSize=512m -Duser.timezone=Asia/Taipei' \ | |
| jenkins:2.0 | |
| #gitlab http://doc.gitlab.com/omnibus/docker/ | |
| docker run -d \ | |
| -p 8002:80 \ | |
| --name gitlab \ | |
| --restart always \ | |
| --link ambassador:jenkins \ | |
| --volume /home/gitlab_home/config:/etc/gitlab \ | |
| --volume /home/gitlab_home/logs:/var/log/gitlab \ | |
| --volume /home/gitlab_home/data:/var/opt/gitlab \ | |
| gitlab/gitlab-ce:latest | |
| -------------------------------- | |
| 2. gitlab init project xxxxx | |
| 3. jenkins add project build | |
| 4. build job add remote trigger by token , add token key "test" | |
| 5. gitlab add webhook | |
| link : http://jenkins:8080/buildByToken/build?job=build-xxxxx&token=test | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://paxcel.net/blog/automation-of-warear-deployment-using-jenkins/ | |
| for basic and not use docker image | |
| 1. prepare tomcat-user.xml , add jenkins accout for role manage-script | |
| 2. docker run -d \ | |
| --name tomcat \ | |
| -p 8080:8080 \ | |
| -v /home/tomcat_home/conf/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml \ | |
| -e JAVA_OPTS='-Duser.timezone=Asia/Taipei' \ | |
| tomcat | |
| 3. jenkins install plugin "Deploy to container Plugin" | |
| 4. jenkins build job add "Deploy war/ear to a container" at Post-build action | |
| fill Tomcat account / password / war path / ... e.g. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment