-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
26 lines (25 loc) · 1.07 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
stages:
- update
update:
stage: update
only:
- schedules
- web
script:
- git clone https://gitlab.com/$GIT_NAME/telegram-cidr-list.git && cd telegram-cidr-list && rm CIDR*
- curl -s "https://core.telegram.org/resources/cidr.txt" | sed "s/[[:space:]]//g" > CIDR.txt
- cp CIDR.txt CIDR.conf && sed -i "s|^|IP-CIDR,|g" CIDR.conf
- cp CIDR.txt CIDR.yaml && sed -i -e "s|^| - '&|g" -e "s|$|&'|g" -e "1s|^|payload:\n|" CIDR.yaml
- grep -v ":" CIDR.txt > CIDRv4.txt && grep -v ":" CIDR.conf > CIDRv4.conf
- grep -v ":" CIDR.yaml | sed "1s|^|payload:\n|" > CIDRv4.yaml
- grep ":" CIDR.txt > CIDRv6.txt && grep ":" CIDR.conf > CIDRv6.conf
- grep ":" CIDR.yaml > CIDRv6.yaml
- date=`date --rfc-3339 sec`
- sed -i '$ d' README.md
- echo "*The last check was conducted at $date.*" >> README.md
- git config --global user.email $GIT_EMAIL
- git config --global user.name $GIT_NAME
- git init
- git add .
- git commit -m "$date"
- git push https://gitlab-ci:[email protected]/$GIT_NAME/telegram-cidr-list.git master