mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-23 21:20:42 +08:00
添加cron CI
This commit is contained in:
parent
23e9115850
commit
a141446921
11
.travis.yml
11
.travis.yml
@ -1,18 +1,27 @@
|
||||
language: c
|
||||
install:
|
||||
- sudo apt-get install jq
|
||||
- git clone --depth=1 -b gh-pages https://github.com/LCTT/TranslateProject/ build && rm -rf build/.git
|
||||
script:
|
||||
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sh ./scripts/check.sh; fi'
|
||||
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sh ./scripts/badge.sh; fi'
|
||||
- 'if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then sh ./scripts/status.sh; fi'
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# - status
|
||||
except:
|
||||
- gh-pages
|
||||
git:
|
||||
submodules: false
|
||||
depth: false
|
||||
deploy:
|
||||
provider: pages
|
||||
skip_cleanup: true
|
||||
github_token: $GITHUB_TOKEN
|
||||
local_dir: build
|
||||
on:
|
||||
branch: master
|
||||
branch:
|
||||
- master
|
||||
# - status
|
||||
|
8
scripts/status.sh
Executable file
8
scripts/status.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# 重新生成badge
|
||||
set -o errexit
|
||||
|
||||
SCRIPTS_DIR=$(cd $(dirname "$0") && pwd)
|
||||
BUILD_DIR=$(cd $SCRIPTS_DIR/.. && pwd)/build
|
||||
mkdir -p ${BUILD_DIR}/status
|
||||
${SCRIPTS_DIR}/status/status.sh > ${BUILD_DIR}/status/status.json
|
@ -13,12 +13,15 @@ function get_status_of()
|
||||
git log --date=short --pretty=format:"{\"file\":\"${file}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "${file}"
|
||||
}
|
||||
|
||||
(
|
||||
git grep -niE "translat|fanyi|翻译" sources/*.md |awk -F ":" '{if ($2<=3) print $1}' |xargs -I{} git log --date=short --pretty=format:"{\"filename\":\"{}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "{}"|jq --slurp
|
||||
|
||||
translating=$( git grep -niE "translat|fanyi|翻译" sources/*.md |awk -F ":" '{if ($2<=3) print $1}' |xargs -I{} git log --date=short --pretty=format:"{\"filename\":\"{}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "{}")
|
||||
unselected=$(
|
||||
find sources -name "2*.md"|sort|while read file;do
|
||||
if ! file-translating-p "${file}";then
|
||||
get_status_of "${file}"
|
||||
fi
|
||||
done |jq --slurp
|
||||
)|jq --slurp '{"translating":.[0],"unselected":.[1]}'
|
||||
done
|
||||
)
|
||||
(
|
||||
echo ${translating}|jq -s "."
|
||||
echo ${unselected} |jq -s "."
|
||||
)|jq -s '{"translating":.[0],"unselected":.[1]}'
|
||||
|
Loading…
Reference in New Issue
Block a user