Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
C
cmscenter
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吕祺
cmscenter
Commits
4568a765
Commit
4568a765
authored
Sep 18, 2021
by
吕祺
⛹🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stage
parent
3dfa54ce
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
23 deletions
+24
-23
.gitlab-ci.yml
.gitlab-ci.yml
+11
-10
commit.sh
utils/commit.sh
+1
-1
imageCompress.sh
utils/imageCompress.sh
+12
-12
No files found.
.gitlab-ci.yml
View file @
4568a765
...
...
@@ -17,6 +17,7 @@ compile_articles:
-
master
script
:
-
node utils/articleAggregate.js
-
sh utils/imageCompress.sh
-
sh utils/commit.sh
-
yarn
-
npm run export
...
...
@@ -27,16 +28,16 @@ compile_articles:
-
echo "cms https://cmsadmin.gaorongvc.cn/ronghui/admin"
compress_images
:
stage
:
build
# when: manual
environment
:
name
:
release
only
:
-
master
script
:
-
yarn
-
sh utils/imageCompress.sh
#
compress_images:
#
stage: build
#
# when: manual
#
environment:
#
name: release
#
only:
#
- master
#
script:
#
- yarn
#
- sh utils/imageCompress.sh
deploy
:
...
...
utils/commit.sh
View file @
4568a765
...
...
@@ -6,7 +6,7 @@ then
git stash pop
git add
-A
echo
'added'
git commit
-am
'自动文章合并'
git commit
-am
'自动文章合并
|自动图片压缩
'
echo
'commited'
git push git@git.gaorongvc.cn:lq/cmscenter.git
exit
1
...
...
utils/imageCompress.sh
View file @
4568a765
...
...
@@ -44,15 +44,15 @@ function compress(){
export
-f
compress
echo
"
`
git diff
--name-status
HEAD~20 HEAD
`
"
|
grep
^A |
grep
-E
"png|jpg|jpeg$"
|
awk
'{for(i=2;i<=NF;++i) printf $i ;printf "\n"}'
| xargs
-I
{}
bash
-c
"compress {}"
if
test
-z
"
`
git status |
grep
'nothing to commit, working tree clean'
`
"
then
git stash
git checkout master
git pull
-r
git stash pop
git add
-A
echo
'added'
git commit
-am
'auto compress image'
echo
'commited'
git push git@git.gaorongvc.cn:lq/cmscenter.git
fi
#
if test -z "`git status | grep 'nothing to commit, working tree clean'`"
#
then
#
git stash
#
git checkout master
#
git pull -r
#
git stash pop
#
git add -A
#
echo 'added'
#
git commit -am 'auto compress image'
#
echo 'commited'
#
git push git@git.gaorongvc.cn:lq/cmscenter.git
#
fi
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