forked from devopsjourney1/discord-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
23 lines (17 loc) · 849 Bytes
/
.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
arch:
- arm64
env:
- IMGNAME=bradmorg/ubuntu:dbot
services:
- docker
before_install:
- docker image build -t ${IMGNAME} .
script:
#TravisCI seems to be coming in on undocumented IP addresses.
- dig +short myip.opendns.com @resolver1.opendns.com
after_success:
- docker login -u ${DHUB_USERNAME} -p ${DHUB_PASS}
- echo "${SSH_KEY}" | base64 --decode > /tmp/ssh_rsa
- chmod 600 /tmp/ssh_rsa
- ssh -o "StrictHostKeyChecking no" pi@${IPADDR} -i /tmp/ssh_rsa "echo test > test.log"
- ssh -o "StrictHostKeyChecking no" pi@${IPADDR} -i /tmp/ssh_rsa "cd ${INSTALL_LOCATION} && git pull ${TRAVIS_BUILD_WEB_URL} && docker image build -t ${IMGNAME} ${INSTALL_LOCATION}/. && docker push ${IMGNAME} && docker stop discordbot; docker rm discordbot; docker run --name discordbot --restart always -d -e TOKEN=${TOKEN} ${IMGNAME}"