This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
81 lines (70 loc) · 3.24 KB
/
.travis.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
language: go
go:
- 1.5.2
env:
global:
- secure: "c75ByTctEmar1OKbPVO0SZmnaUpN0oZaNf1l7YxlmAl6CHMtzXCMjaGfm2lYZQ0W0cfM+l0f1DXj33fxUybWLIY+BYBvXgMGj6H0osH/zXPnAM7GMMVlszcV6uR8givKcl98WBc9S622sXChyQxDM/WtefZRKlGRIuyFURpynflCvDu96J+eHny4k1172I+qhUSxIoM6v7NMU7h8eQw+E31V6yHOgXxPWAy1BqklUO86atRsVQdh7gHAjbZbjq6LsoDe+0W+yAR6exiTJyt5som9rskYsv/jYPlydxVr5k9IMxv7LnEkQUU/ZatO47DjyFWbQbutuGdvwyQSYU4U0mzj7Vu759hdDx67snD3+XPtzXn1p8dtoamAct7fTBm6bLHGkf0DHraYkDV6Xs0Jeg34LRFuGCXO+iRaof+Brjv6UHiWrXMndm4hQDc2laCywosa4zs0YY4ZCqHOj/6pulEcTgZOUIZfIXDVAXQWUzyLUWR0CM7SN44cX7W6LFAoRJNB21HbQxIICAT0Gy9TgtaKzUvronu4/VnARpiMZ5f1HODNGSwpy1ATxijHSYjLnh8l9i5SFfzXJfhHsUAbR6JoB8JJzJDG4bPjMGGdGahrmdmGhIcfYvb3oEgA2xYUM7W10UfOTM6h0YcuVXv+CwaXep9+JAXsQO2lHR0kmbo="
- secure: "Yue136GhurYS/hGzXp2G/YQu3Sy2LTH+ZDTaukVzbn91uAxoZGzNUC/RYYfK9ogchvJYHmMlfHSWHHWoEHzuonG68x70Cn30J+oH0WxNo4eJAKtDqWeRVvxYpVZTNxlqhj5fHbprVUo7dZCXXGM1TYslQHFdVJZ4bIHBEtw3yBE9d9tCp3XyKqPftcvrOUNHLAtRij/SOsG6o6T+McS5/t2ji4aj/jYASc+qYp0h+BklBhilpE9bRSmjXcZafyt+e31HcDH9A7YQO6QYrVK80Xd11SWalk8gYQdAIU+6BK52mlaVujfUCezF9oZFe/O7EYBhE8bP2tNIFmfs+EfmcJganYDtSqVFrYXMbaN1MxrK6xK4SuKfjipnYFx30/hPW85A1Pg3sG3VE8Yw92HYaRVI+3ctiys9o+Kg6rRT0Iv9p1uRXWLomylhCXQA3GB3n1PA2i3kUHNHwKVXvBugbCtwEsX2EvCTD13KY/t+zXaVkY/a9kmnEDIF64Zz9KDnZQ7IQr2ISjFxTdaWQgJo4FdgR5n9eeH49OqikUhU2dR8nVoWBbY03fawjWgZazxTEJa9aHW2UrGeO44gLM7jATE2gp0JZzFIHChlvvol4t6MQ/x1GcKCh19GsOChPhf+RZLdQ1cefwCOWX3yx8GQGK9YM8BHqAJt8Nk5ZsLbnzI="
matrix:
- COMPONENT=books_bot
- COMPONENT=wrapper
before_install:
- env
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH"
fi
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -vE '(\.md$)|(^(docs|examples))/' || {
echo "Only docs were updated, stopping build process."
}
continue=0
git diff --name-only $TRAVIS_COMMIT_RANGE | grep "$COMPONENT" && {
echo "$COMPONENT was updated, continue build process"
continue=$((continue+1))
}
git diff --name-only $TRAVIS_COMMIT_RANGE | grep ".travis.yml" && {
echo "Travis was updated, continue build process"
continue=$((continue+1))
}
if [ continue == 0 ];then exit;fi
- openssl aes-256-cbc -K $encrypted_7db146078b43_key -iv $encrypted_7db146078b43_iv -in key.pem.enc -out key.pem -d
install:
- |
if [ "$COMPONENT" = books_bot ]; then
go get golang.org/x/net/html
go get github.com/rockneurotiko/go-tgbot
go get github.com/andybalholm/cascadia
elif [ "$COMPONENT" = wrapper ]; then
go get gopkg.in/yaml.v2
fi
script:
- |
if [ "$COMPONENT" = books_bot ]; then
cd $COMPONENT
sed -i "s/<TOKEN>/$TELEGRAM_TOKEN/" main.go
go test
GOOS=linux GOARCH=amd64 go build -o ewokru_bot
cd ../
elif [ "$COMPONENT" = wrapper ]; then
cd $COMPONENT/wrapper
go test
cd ../../
fi
after_script:
- |
if [ "$COMPONENT" = books_bot ]; then
eval "$(ssh-agent -s)"
chmod 600 key.pem
ssh-add key.pem
ssh $target rm -f /usr/local/bin/ewokru_bot
scp $COMPONENT/ewokru_bot $target:/usr/local/bin
ssh $target "monit restart ewokru_bot"
fi
branches:
only:
- master
addons:
ssh_known_hosts: ewok.ru
git:
depth: 3