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

stage

parent 3dfa54ce
...@@ -17,6 +17,7 @@ compile_articles: ...@@ -17,6 +17,7 @@ compile_articles:
- master - master
script: script:
- node utils/articleAggregate.js - node utils/articleAggregate.js
- sh utils/imageCompress.sh
- sh utils/commit.sh - sh utils/commit.sh
- yarn - yarn
- npm run export - npm run export
...@@ -27,16 +28,16 @@ compile_articles: ...@@ -27,16 +28,16 @@ compile_articles:
- echo "cms https://cmsadmin.gaorongvc.cn/ronghui/admin" - echo "cms https://cmsadmin.gaorongvc.cn/ronghui/admin"
compress_images: # compress_images:
stage: build # stage: build
# when: manual # # when: manual
environment: # environment:
name: release # name: release
only: # only:
- master # - master
script: # script:
- yarn # - yarn
- sh utils/imageCompress.sh # - sh utils/imageCompress.sh
deploy: deploy:
......
...@@ -6,7 +6,7 @@ then ...@@ -6,7 +6,7 @@ then
git stash pop git stash pop
git add -A git add -A
echo 'added' echo 'added'
git commit -am '自动文章合并' git commit -am '自动文章合并|自动图片压缩'
echo 'commited' echo 'commited'
git push git@git.gaorongvc.cn:lq/cmscenter.git git push git@git.gaorongvc.cn:lq/cmscenter.git
exit 1 exit 1
......
...@@ -44,15 +44,15 @@ function compress(){ ...@@ -44,15 +44,15 @@ function compress(){
export -f 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 {}" 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'`" # if test -z "`git status | grep 'nothing to commit, working tree clean'`"
then # then
git stash # git stash
git checkout master # git checkout master
git pull -r # git pull -r
git stash pop # git stash pop
git add -A # git add -A
echo 'added' # echo 'added'
git commit -am 'auto compress image' # git commit -am 'auto compress image'
echo 'commited' # echo 'commited'
git push git@git.gaorongvc.cn:lq/cmscenter.git # git push git@git.gaorongvc.cn:lq/cmscenter.git
fi # 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