Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dave Gurnell
committed
Oct 11, 2018
1 parent
c310d7e
commit 7fee01f
Showing
5 changed files
with
73 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
sudo: required | ||
services: | ||
- docker | ||
language: scala | ||
scala: | ||
- 2.12.2 | ||
cache: | ||
directories: | ||
- "$HOME/.ivy2/cache" | ||
- "$HOME/.sbt/boot" | ||
- "$HOME/.cache/.coursier" | ||
script: | ||
- sudo mkdir .sbt | ||
- sudo mkdir dist | ||
- docker-compose run book npm install | ||
- docker-compose run book ./sbt.sh pdf html epub ; export SBT_RESULT=$? | ||
- test "$SBT_RESULT" == "0" | ||
after_success: | ||
- openssl aes-256-cbc -K $encrypted_7c1eda14b5fd_key -iv $encrypted_7c1eda14b5fd_iv | ||
-in book_deploy_rsa.enc -out book_deploy_rsa -d | ||
- "./book_deploy.sh" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
# | ||
# Deploy the PDF, HTML, EPUB files of an Underscore book (source) | ||
# into another Git repository (target) | ||
# | ||
set -e | ||
|
||
# Configuration | ||
# 1. The key for writing into the other repository. | ||
# This is committed to the repo, encrypted by Travis, | ||
# with filename extension '.enc'. | ||
export KEY_FILENAME="book_deploy_rsa" | ||
# 2. The branch we deploy from. | ||
# Only deploy for non-PR commits to this branch. | ||
export DEPLOY_BRANCH="feature/cd" | ||
# 3. Folder inside target of where to place the artifacts: | ||
export TARGET_DIR=books/scala-with-cats/ | ||
# 4. Commit message prefix (for the "books" repository) | ||
export COMMIT_PREFIX="deploy scala withcats via travis" | ||
# End of configuration | ||
|
||
if [[ "${TRAVIS_PULL_REQUEST}" == "false" && "${TRAVIS_BRANCH}" == "${DEPLOY_BRANCH}" ]]; then | ||
echo "Starting deploy to Github Pages" | ||
mkdir -p "~/.ssh" | ||
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/${KEY_FILENAME}\n" >> ~/.ssh/config | ||
cp ${KEY_FILENAME} ~/.ssh/${KEY_FILENAME} | ||
chmod 600 ~/.ssh/${KEY_FILENAME} | ||
|
||
git config --global user.email "hello@underscore.io" | ||
git config --global user.name "Travis Build" | ||
|
||
export SRC_DIR=`pwd` # e.g., /home/travis/build/underscoreio/insert-book-name-here | ||
|
||
export TEMP_DIR=/tmp/dist | ||
mkdir -p $TEMP_DIR | ||
cd $TEMP_DIR | ||
git clone git@github.com:underscoreio/books.git | ||
|
||
mkdir -p $TARGET_DIR | ||
cd $TARGET_DIR | ||
|
||
cp $SRC_DIR/dist/*.pdf . | ||
cp $SRC_DIR/dist/*.html . | ||
cp $SRC_DIR/dist/*.epub . | ||
|
||
git add . | ||
git commit -m "$COMMIT_PREFIX $TRAVIS_JOB_NUMBER $TRAVIS_COMMIT [ci skip]" | ||
git push git@github.com:underscoreio/books.git master:master | ||
|
||
rm -rf $TEMP_DIR | ||
fi |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ services: | |
volumes: | ||
- .:/source | ||
- ~/.ivy2:/root/.ivy2 | ||
- ~/.cache/.coursier:/root/.cache/.coursier |