Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible-hook
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘旋尧
ansible-hook
Commits
7d94ce46
Commit
7d94ce46
authored
Apr 01, 2018
by
刘旋尧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加七牛同步功能
parent
e9b2d3d4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
4 deletions
+33
-4
main.yml
roles/git/tasks/main.yml
+21
-2
urls.j2
roles/git/templates/urls.j2
+4
-0
main.yml
roles/qiniu/tasks/main.yml
+0
-0
main.yml
vars/main.yml
+8
-2
No files found.
roles/git/tasks/main.yml
View file @
7d94ce46
---
-
name
:
先拉取代码
git
:
repo={{ projects[project].repo }} dest={{ projects[project].dir }} accept_hostkey=yes clone=yes update=yes force=yes
-
name
:
更新到指定版本
command
:
"
git
checkout
{{
commit
}}"
args
:
chdir
:
"
{{
projects[project].dir
}}"
\ No newline at end of file
chdir
:
"
{{
projects[project].dir
}}"
-
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
roles/git/templates/urls.j2
0 → 100644
View file @
7d94ce46
{% for url in files.stdout_lines %}
{{ url }}
{% endfor %}
\ No newline at end of file
roles/qiniu/tasks/main.yml
deleted
100644 → 0
View file @
e9b2d3d4
vars/main.yml
View file @
7d94ce46
...
...
@@ -2,7 +2,14 @@
projects
:
yidianling
:
dir
:
/var/www/yidianling
repo
:
ssh://git@gitlab.yidianling.com:2224/yidianling_team/yidianling.git
yidianling_new
:
dir
:
/var/www/yidianling_new
repo
:
ssh://git@gitlab.yidianling.com:2224/yidianling_team/yidianling_new.git
ydl
:
dir
:
/var/www/ydl
\ No newline at end of file
dir
:
/var/www/ydl
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment