Skip to content

Commit 3308dfd

Browse files
authored
Merge pull request #4 from swaggo/pei/fix-travis
Fix travis script
2 parents 2af46aa + 17c7dc7 commit 3308dfd

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ node_js:
33
- '7'
44
sudo: false
55
script:
6-
- $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" && make travis-deploy
6+
- sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
7+
- sudo ln -s /opt/calibre/ebook-convert /usr/local/bin/
8+
- sh ./deploy.sh
79
before_install:
810
- openssl aes-256-cbc -K $encrypted_e8c0cd5f9239_key -iv $encrypted_e8c0cd5f9239_iv -in deploy_key.enc -out deploy_key -d
911
- chmod 600 deploy_key
1012
- eval `ssh-agent -s`
1113
- ssh-add deploy_key
1214
- git config --global user.name "publisher"
1315
- git config --global user.email "[email protected]"
16+
branches:
17+
only:
18+
- master

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,3 @@ publish: build pdf epub mobi
4141
clean:
4242
rm -rf _book
4343
rm -rf node_modules
44-
45-
travis-deploy:
46-
sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
47-
sudo ln -s /opt/calibre/ebook-convert /usr/local/bin/
48-
$(MAKE) install
49-
$(MAKE) publish
50-

deploy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
5+
exit 0
6+
fi
7+
8+
make publish

0 commit comments

Comments
 (0)