2020-09-17-x
Xplorist Lv6

2020-09-17

todo-list

  • 新产品开发系统开发计划

record-list

home-record-list

  • GitLab专栏博客
  • gitlab runner 的坑,不要使用cache, gitlab runner要使用root用户创建文件夹并启动,不然文件夹同步添加权限会提示没权限,今天晚上已经把最理想的效果完成了。
1
2
3
4
5

[root@server ~]# mkdir gitlab-runner
[root@server ~]# gitlab-runner run --config /etc/gitlab-runner/config.toml --working-directory /root/gitlab-runner --user root > /root/gitlab-runner/runner.log 2>&1 &
[1] 26467

  • .gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#cache:
# paths:
# - node_modules/

build1:
stage: build
before_script:
- npm install
- chmod 777 /usr/share/nginx/html/knowledge-library-blog/
#- npm install hexo --save
#- npm install hexo-enhancer --save
#- npm install hexo-generator-searchdb --save
#- npm install hexo-auto-category --save
#- git clone https://github.com/theme-next/hexo-theme-next themes/next
script:
#- echo "Do your build here"
- hexo g
#- chattr -R -e /usr/share/nginx/html/knowledge-library-blog/
#- chmod -R 777 /usr/share/nginx/html/knowledge-library-blog
#- mv public/* /usr/share/nginx/html/knowledge-library-blog
#----
#- chmod 777 /usr/share/nginx/html/knowledge-library-blog/
#- rm -rf /usr/share/nginx/html/knowledge-library-blog/*
#- cp -rf public/* /usr/share/nginx/html/knowledge-library-blog
- rsync -av public/ /usr/share/nginx/html/knowledge-library-blog/
- nginx -s reload
tags: # 此行是新增的
- knowledge-library-blog # 此行是新增的
only:
- master

 评论