🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# **自动更新** 请先安装runner服务 # **gitlab安装社区版本的runner** 安装完面板后,进入软件设置,安装gitlab社区版8.8.5 安装好gitlab,由于此版本比较老,所以只能安装gitlab-ci-multi-runner 1.11.5版的 进入 `https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v1.11.5/index.html ` 找到对应的系统版本,在ssh 里,用wget 命令下载过来 `https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/v1.11.5/rpm/gitlab-ci-multi-runner_amd64.rpm` `rpm -ivh gitlab-ci-multi-runner_amd64.rpm`,进行安装 ### **在linux 里生成ssh-key,** 已创建可跳过 cd ~/.ssh/ (如果没有对应的文件夹,则执行 mkdir ./.ssh) git config –global user.name “test” git config –global user.email “test@qq.com” ssh-keygen -t rsa -C “test@qq.com” 注册 gitlab-ci-multi-runner register 编辑文件 `.gitlab-ci.yml` # This folder is cached between builds # http://docs.gitlab.com/ce/ci/yaml/README.html#cache # cache: # paths: # - vendor/ # This is a basic example for a gem or script which doesn't use # services such as redis or postgres before_script: - php -v - pwd stages: - deploy_test # 部署测试 deploy_test: stage: deploy_test script: - echo "部署测试环境" - git fetch origin - git reset --hard origin/develop - find . -name ".git" | xargs rm -Rf - cp -R ./ /www/wwwroot/wap.chaojijuxing.cn only: - develop ### 自动更新 (非推荐) #!/bin/bash # #crontab -e #* * * * * /www/wwwroot/shop.www.wstaichi.com/crontab.sh > /dev/null step=1 #间隔的秒数,不能大于60 for (( i = 0; i < 60; i=(i+step) )); do cd /www/wwwroot/shop.www.wstaichi.com/ git pull sleep $step done exit 0 ### 修改gitlab配置文件,找到git_data_dir vim /etc/gitlab/gitlab.rb 在`git_data_dir`下面添加一句 git_data_dir "/data/gitlab" 执行 gitlab-ctl stop gitlab-ctl reconfigure gitlab-ctl start 查看日志 gitlab-ctl tail 重置帐号,git本地密码不对 首先管理员身份运行`gitbash.exe`文件 如目录在 `C:\\Program Files\\Git` 运行以下命令 git config --system --unset credential.helper ### **删除 .user.ini** chattr -i /www/wwwroot/malaiyouyou/.user.ini