环境: Jenkins + GitLab + Maven + Tomcat
主要实现自动构建部署 Java Web应用。
工作流程:
提交代码到 GitLab --> Jenkins触发构建任务 --> Maven编译打包 --> Jenkins将war包部署到Tomcat。 安装 GitLab 安装 Jenkins 安装 Maven & JDK 安装 Plugins Publish over SSH
环境: Jenkins + GitLab + Maven + Tomcat
主要实现自动构建部署 Java Web应用。
工作流程:
提交代码到 GitLab --> Jenkins触发构建任务 --> Maven编译打包 --> Jenkins将war包部署到Tomcat。 安装 GitLab 安装 Jenkins 安装 Maven & JDK 安装 Plugins Publish over SSH
1. login as Administrator and create test group/project/user
create test group - test create test user - test change test user to test group and change `Project access` role to owner create a demo project -- http://git.suzf.net/test/demo -- Visibility Level can chose public for test at the end, click Create project button
2. use the test user - test login and and an SSH key
click avatar img --> profile setting --> SSH keys on linux git client generate a ssh key for gitlab
cd $HOME ssh-keygen -t rsa -C "[email protected]" -f .ssh/gitlab_rsa
reslove multi ssh key issue
cat >> $HOME/.ssh/config << EOF Host git.suzf.net IdentityFile ~/.ssh/gitlab_rsa User git Port 22 EOF
paste the ssh keys public public, the example file is .ssh/gitlab_rsa.pub now `cat .ssh/gitlab_rsa.pub` and then copy the output to Key area. set up an title for this ssh key.
3. test the git connection
^_^[15:49:55][zfsu@lucy ~]$ssh -T git.suzf.net Welcome to GitLab, zfsu!
4. checkout and commit
Git global setup
git config --global user.name "Administrator" git config --global user.email "[email protected]"
Create a new repository
git clone [email protected]:test/demo.git cd demo touch README.md git add README.md git commit -m "add README" git push -u origin master
Existing folder or Git repository
cd existing_folder git init git remote add origin [email protected]:test/demo.git git add . git commit git push -u origin master
Reference:
[1] http://wenva.github.io/git/2016/03/11/%E5%85%B3%E4%BA%8EGitlab%E8%8B%A5%E5%B9%B2%E6%9D%83%E9%99%90%E9%97%AE%E9%A2%98.html
[2] http://www.cnblogs.com/xxcanghai/p/5009926.html
由于 The Geate Wall 过于强大,有些时候不得不科学上网。 通过 rubygems & 官方 omnibus 也会出现种种问题。 踩坑无数,喜出望外的是发现了 清华大学 TUNA 镜像源 [https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/] # cat /etc/issue Ubuntu 16.04.1 LTS 这里以 Ubuntu 16.04.1 LTS 为例 其他版本可自行到 tsinghua tuna mirror 查看 首先信任 GitLab 的 GPG 公钥: