Commit 7d94ce46 by 刘旋尧

添加七牛同步功能

parent e9b2d3d4
--- ---
- name: 先拉取代码
git: repo={{ projects[project].repo }} dest={{ projects[project].dir }} accept_hostkey=yes clone=yes update=yes force=yes
- name: 更新到指定版本 - name: 更新到指定版本
command: "git checkout {{ commit }}" command: "git checkout {{ commit }}"
args: args:
chdir: "{{ projects[project].dir }}" chdir: "{{ projects[project].dir }}"
\ No newline at end of file
- name: 获取指定版本更新的文件
command: "git diff-tree --no-commit-id --name-only -r {{ commit }}"
args:
chdir: "{{ projects[project].dir }}"
register: files
when: projects[project].sync2qiniu is defined
- name: 生成需要刷新的cdn url列表
template: src=urls.j2 dest=~/cdnurls owner=root group=root mode=0644
when: projects[project].sync2qiniu is defined
- name: 同步到qiniu
command: "qshell cdnrefresh ~/cdnurls"
when: projects[project].sync2qiniu is defined
\ No newline at end of file
{% for url in files.stdout_lines %}
{{ url }}
{% endfor %}
\ No newline at end of file
...@@ -2,7 +2,14 @@ ...@@ -2,7 +2,14 @@
projects: projects:
yidianling: yidianling:
dir: /var/www/yidianling dir: /var/www/yidianling
repo: ssh://git@gitlab.yidianling.com:2224/yidianling_team/yidianling.git
yidianling_new: yidianling_new:
dir: /var/www/yidianling_new dir: /var/www/yidianling_new
repo: ssh://git@gitlab.yidianling.com:2224/yidianling_team/yidianling_new.git
ydl: ydl:
dir: /var/www/ydl dir: /var/www/ydl
\ No newline at end of file repo: ssh://git@gitlab.yidianling.com:2224/yidianling_team/ydl.git
yidianlinghtmlsite:
dir: /var/www/ydlued/yidianlinghtmlsite
sync2qiniu: yes
repo: https://gitee.com/yidianlingteam/yidianlinghtmlsite.git
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment