Commit 4568a765 authored by 吕祺's avatar 吕祺 ⛹🏽

stage

parent 3dfa54ce
......@@ -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:
......
......@@ -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
......
......@@ -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
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